diff --git a/.ci/ansible/Containerfile.j2 b/.ci/ansible/Containerfile.j2 index 482ee277..0eb5d5cc 100644 --- a/.ci/ansible/Containerfile.j2 +++ b/.ci/ansible/Containerfile.j2 @@ -8,23 +8,22 @@ ADD ./{{ item.name }} ./{{ item.name }} {% endfor %} # Install python packages -# Hacking botocore (https://github.com/boto/botocore/pull/1990) RUN pip3 install -{%- if s3_test | default(false) -%} -{{ " " }}django-storages[boto3] git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue -{%- endif -%} -{%- if azure_test | default(false) -%} -{{ " " }}django-storages[azure]>=1.12.2 -{%- endif -%} -{%- if gcp_test | default(false) -%} -{{ " " }}django-storages[google]>=1.13.2 -{%- endif -%} {%- for item in plugins -%} {%- if item.name == "pulp-certguard" -%} {{ " " }}python-dateutil rhsm {%- endif -%} {{ " " }}{{ item.source }} +{%- if item.name == "pulpcore" -%} +{%- if s3_test | default(false) -%} +[s3] +{%- elif azure_test | default(false) -%} +[azure] +{%- elif gcp_test | default(false) -%} +[google] +{%- endif -%} +{%- endif -%} {%- if item.ci_requirements | default(false) -%} {{ " " }}-r ./{{ item.name }}/ci_requirements.txt {%- endif -%} diff --git a/.github/template_gitref b/.github/template_gitref index e0764316..256a0012 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-248-g4bfc3e1 +2021.08.26-251-g45d399d diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6d76f64..1c986941 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,6 @@ on: inputs: release: description: "Release tag (e.g. 3.2.1)" - required: true before_script: description: | Bash code to run before bindings and docs are built. This should only be used when re-running @@ -287,9 +286,5 @@ jobs: echo "GH Issues $GH_ISSUES" python .ci/scripts/update_github.py - - name: Tweet - continue-on-error: true - run: python .ci/scripts/tweet.py ${{ github.event.inputs.release }} - - name: Create release on GitHub run: bash .github/workflows/scripts/create_release_from_tag.sh ${{ github.event.inputs.release }} diff --git a/.github/workflows/scripts/release.py b/.github/workflows/scripts/release.py index c6410fc5..d20b923b 100755 --- a/.github/workflows/scripts/release.py +++ b/.github/workflows/scripts/release.py @@ -10,6 +10,7 @@ import os import textwrap import requests +import subprocess from git import Repo from pathlib import Path @@ -56,11 +57,7 @@ def create_release_commits(repo, release_version, plugin_path): # Second commit: release version os.system("bump2version release --allow-dirty") - git.add(f"{plugin_path}/pulp_ostree/*") - git.add(f"{plugin_path}/docs/conf.py") - git.add(f"{plugin_path}/setup.py") - git.add(f"{plugin_path}/requirements.txt") - git.add(f"{plugin_path}/.bumpversion.cfg") + git.add(f"{plugin_path}") git.commit("-m", f"Release {release_version}\nGH Issues: {issues}\n\n[noissue]") sha = repo.head.object.hexsha short_sha = git.rev_parse(sha, short=7) @@ -75,11 +72,7 @@ def create_release_commits(repo, release_version, plugin_path): if not new_dev_version: raise RuntimeError("Could not detect new dev version ... aborting.") - git.add(f"{plugin_path}/pulp_ostree/*") - git.add(f"{plugin_path}/docs/conf.py") - git.add(f"{plugin_path}/setup.py") - git.add(f"{plugin_path}/requirements.txt") - git.add(f"{plugin_path}/.bumpversion.cfg") + git.add(f"{plugin_path}") git.commit("-m", f"Bump to {new_dev_version}\n\n[noissue]") print(f"Release commit == {short_sha}") print(f"All changes were committed on branch: release_{release_version}") @@ -143,6 +136,7 @@ def main(): "release_version", type=str, help="The version string for the release.", + nargs="?", ) args = parser.parse_args() @@ -152,20 +146,14 @@ def main(): release_path = os.path.dirname(os.path.abspath(__file__)) plugin_path = release_path.split("/.github")[0] - version = None - with open(f"{plugin_path}/setup.py") as fp: - for line in fp.readlines(): - if "version=" in line: - version = re.split("\"|'", line)[1] - if not version: - raise RuntimeError("Could not detect existing version ... aborting.") - release_version = version.replace(".dev", "") + output = subprocess.check_output(["bump2version", "--dry-run", "--list", "release"]) + release_version = re.findall(r"\nnew_version=([0-9.]*)\n", output.decode())[0] print(f"\n\nRepo path: {plugin_path}") repo = Repo(plugin_path) release_commit = None - if release_version != release_version_arg: + if release_version_arg and release_version != release_version_arg: # Look for a commit with the requested release version for commit in repo.iter_commits(): if f"Release {release_version_arg}\n" in commit.message: