From 69ec22f53ad3d2fb9c1e4b3f7e1b4862f33f396d Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Wed, 17 Feb 2021 12:56:33 +0100 Subject: [PATCH 1/8] bump 0.3.1.dev0 --- autorelease-travis.yml | 10 +++++----- devtools/conda-recipe/meta.yaml | 2 +- setup.cfg | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/autorelease-travis.yml b/autorelease-travis.yml index cb318e4..81fdffd 100644 --- a/autorelease-travis.yml +++ b/autorelease-travis.yml @@ -1,4 +1,4 @@ -# AUTORELEASE v0.3.0 +# AUTORELEASE v0.3.1.dev0 # for nonrelease, use @master # for release, use v${VERSION}, e.g., v1.0.0 stages: @@ -9,7 +9,7 @@ stages: - deploy pypi import: - - dwhswenson/autorelease:travis_stages/deploy_testpypi.yml@v0.3.0 - - dwhswenson/autorelease:travis_stages/test_testpypi.yml@v0.3.0 - - dwhswenson/autorelease:travis_stages/cut_release.yml@v0.3.0 - - dwhswenson/autorelease:travis_stages/deploy_pypi.yml@v0.3.0 + - dwhswenson/autorelease:travis_stages/deploy_testpypi.yml@master + - dwhswenson/autorelease:travis_stages/test_testpypi.yml@master + - dwhswenson/autorelease:travis_stages/cut_release.yml@master + - dwhswenson/autorelease:travis_stages/deploy_pypi.yml@master diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index bdc85ea..f410e9e 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: autorelease # add ".dev0" for unreleased versions - version: "0.3.0" + version: "0.3.0.dev0" source: path: ../../ diff --git a/setup.cfg b/setup.cfg index 32fed74..de34a81 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = autorelease -version = 0.3.0 +version = 0.3.1.dev0 # version should end in .dev0 if this isn't to be released short_description = Tools to keep the release process clean. description = Tools to keep the release process clean. From ba742e3940aa41b9050dec055c2b258f8327baee Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Wed, 17 Feb 2021 13:16:41 +0100 Subject: [PATCH 2/8] fix version in conda recipe --- devtools/conda-recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index f410e9e..27329b1 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: autorelease # add ".dev0" for unreleased versions - version: "0.3.0.dev0" + version: "0.3.1.dev0" source: path: ../../ From 61a99148627475bf81744019ea2cc15466bab50b Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Wed, 12 May 2021 21:16:02 +0200 Subject: [PATCH 3/8] Vendored workflows are templates In particular, this allows us to attach a version to the workflows, but still keep that version information in a single source of truth. --- .github/workflows/autorelease-default-env.sh | 4 +++- .github/workflows/autorelease-deploy.yml | 2 ++ .github/workflows/autorelease-gh-rel.yml | 2 ++ .github/workflows/autorelease-prep.yml | 4 ++-- .../gh_actions_stages/autorelease-default-env.sh | 4 +++- .../gh_actions_stages/autorelease-deploy.yml | 8 +++++--- .../gh_actions_stages/autorelease-gh-rel.yml | 12 +++++++----- .../gh_actions_stages/autorelease-prep.yml | 16 ++++++++-------- autorelease/scripts/vendor.py | 15 ++++++++++----- 9 files changed, 42 insertions(+), 25 deletions(-) diff --git a/.github/workflows/autorelease-default-env.sh b/.github/workflows/autorelease-default-env.sh index 064478c..f15ac5c 100644 --- a/.github/workflows/autorelease-default-env.sh +++ b/.github/workflows/autorelease-default-env.sh @@ -1,4 +1,6 @@ -INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.0" +# Vendored from Autorelease 0.3.1 +# Update by updating Autorelease and running `autorelease vendor actions` +INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.1" if [ -f autorelease-env.sh ]; then source autorelease-env.sh fi diff --git a/.github/workflows/autorelease-deploy.yml b/.github/workflows/autorelease-deploy.yml index 5192236..f30139c 100644 --- a/.github/workflows/autorelease-deploy.yml +++ b/.github/workflows/autorelease-deploy.yml @@ -1,3 +1,5 @@ +# Vendored from Autorelease 0.3.1 +# Update by updating Autorelease and running `autorelease vendor actions` name: Autorelease on: release: diff --git a/.github/workflows/autorelease-gh-rel.yml b/.github/workflows/autorelease-gh-rel.yml index 32cd720..0d17f90 100644 --- a/.github/workflows/autorelease-gh-rel.yml +++ b/.github/workflows/autorelease-gh-rel.yml @@ -1,3 +1,5 @@ +# Vendored from Autorelease 0.3.1 +# Update by updating Autorelease and running `autorelease vendor actions` name: Autorelease on: push: diff --git a/.github/workflows/autorelease-prep.yml b/.github/workflows/autorelease-prep.yml index ae965dc..3fc009d 100644 --- a/.github/workflows/autorelease-prep.yml +++ b/.github/workflows/autorelease-prep.yml @@ -1,5 +1,5 @@ -# File vencdored from Autorelease; specific version information should be in -# the INSTALL_AUTORELEASE variable in autorelease-default-env.sh +# Vendored from Autorelease 0.3.1 +# Update by updating Autorelease and running `autorelease vendor actions` name: "Autorelease" on: pull_request: diff --git a/autorelease/gh_actions_stages/autorelease-default-env.sh b/autorelease/gh_actions_stages/autorelease-default-env.sh index 064478c..2b62a7e 100644 --- a/autorelease/gh_actions_stages/autorelease-default-env.sh +++ b/autorelease/gh_actions_stages/autorelease-default-env.sh @@ -1,4 +1,6 @@ -INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.0" +# Vendored from Autorelease $VERSION +# Update by updating Autorelease and running `autorelease vendor actions` +INSTALL_AUTORELEASE="python -m pip install autorelease==$VERSION" if [ -f autorelease-env.sh ]; then source autorelease-env.sh fi diff --git a/autorelease/gh_actions_stages/autorelease-deploy.yml b/autorelease/gh_actions_stages/autorelease-deploy.yml index 5192236..08b643c 100644 --- a/autorelease/gh_actions_stages/autorelease-deploy.yml +++ b/autorelease/gh_actions_stages/autorelease-deploy.yml @@ -1,3 +1,5 @@ +# Vendored from Autorelease $VERSION +# Update by updating Autorelease and running `autorelease vendor actions` name: Autorelease on: release: @@ -15,12 +17,12 @@ jobs: - run: | # TODO: move this to an action source ./.github/workflows/autorelease-default-env.sh if [ -f "autorelease-env.sh" ]; then - cat autorelease-env.sh >> $GITHUB_ENV + cat autorelease-env.sh >> $$GITHUB_ENV fi if [ -f "./.autorelease/install-autorelease" ]; then source ./.autorelease/install-autorelease else - eval $INSTALL_AUTORELEASE + eval $$INSTALL_AUTORELEASE fi name: "Install autorelease" - run: | @@ -32,6 +34,6 @@ jobs: name: "Build and check package" - uses: pypa/gh-action-pypi-publish@master with: - password: ${{ secrets.pypi_password }} + password: $${{ secrets.pypi_password }} name: "Deploy to pypi" diff --git a/autorelease/gh_actions_stages/autorelease-gh-rel.yml b/autorelease/gh_actions_stages/autorelease-gh-rel.yml index 32cd720..1809fee 100644 --- a/autorelease/gh_actions_stages/autorelease-gh-rel.yml +++ b/autorelease/gh_actions_stages/autorelease-gh-rel.yml @@ -1,3 +1,5 @@ +# Vendored from Autorelease $VERSION +# Update by updating Autorelease and running `autorelease vendor actions` name: Autorelease on: push: @@ -16,18 +18,18 @@ jobs: - run: | # TODO: move this to an action source ./.github/workflows/autorelease-default-env.sh if [ -f "autorelease-env.sh" ]; then - cat autorelease-env.sh >> $GITHUB_ENV + cat autorelease-env.sh >> $$GITHUB_ENV fi if [ -f "./.autorelease/install-autorelease" ]; then source ./.autorelease/install-autorelease else - eval $INSTALL_AUTORELEASE + eval $$INSTALL_AUTORELEASE fi name: "Install autorelease" - run: | VERSION=`python setup.py --version` PROJECT=`python setup.py --name` - echo $PROJECT $VERSION - autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN + echo $$PROJECT $$VERSION + autorelease-release --project $$PROJECT --version $$VERSION --token $$AUTORELEASE_TOKEN env: - AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }} + AUTORELEASE_TOKEN: $${{ secrets.AUTORELEASE_TOKEN }} diff --git a/autorelease/gh_actions_stages/autorelease-prep.yml b/autorelease/gh_actions_stages/autorelease-prep.yml index ae965dc..c3e8086 100644 --- a/autorelease/gh_actions_stages/autorelease-prep.yml +++ b/autorelease/gh_actions_stages/autorelease-prep.yml @@ -1,5 +1,5 @@ -# File vencdored from Autorelease; specific version information should be in -# the INSTALL_AUTORELEASE variable in autorelease-default-env.sh +# Vendored from Autorelease $VERSION +# Update by updating Autorelease and running `autorelease vendor actions` name: "Autorelease" on: pull_request: @@ -22,12 +22,12 @@ jobs: - run: | # TODO: move this to an action source ./.github/workflows/autorelease-default-env.sh if [ -f "autorelease-env.sh" ]; then - cat autorelease-env.sh >> $GITHUB_ENV + cat autorelease-env.sh >> $$GITHUB_ENV fi if [ -f "./.autorelease/install-autorelease" ]; then source ./.autorelease/install-autorelease else - eval $INSTALL_AUTORELEASE + eval $$INSTALL_AUTORELEASE fi name: "Install autorelease" - run: | @@ -43,7 +43,7 @@ jobs: name: "Build and check package" - uses: pypa/gh-action-pypi-publish@master with: - password: ${{ secrets.testpypi_password }} + password: $${{ secrets.testpypi_password }} repository_url: https://test.pypi.org/legacy/ name: "Deploy to testpypi" test_testpypi: @@ -58,12 +58,12 @@ jobs: - run: | # TODO: move this to an action source ./.github/workflows/autorelease-default-env.sh if [ -f "autorelease-env.sh" ]; then - cat autorelease-env.sh >> $GITHUB_ENV + cat autorelease-env.sh >> $$GITHUB_ENV fi if [ -f "./.autorelease/install-autorelease" ]; then source ./.autorelease/install-autorelease else - eval $INSTALL_AUTORELEASE + eval $$INSTALL_AUTORELEASE fi name: "Install autorelease" - name: "Install testpypi version" @@ -71,6 +71,6 @@ jobs: - name: "Test testpypi version" run: | if [ -f "autorelease-env.sh" ]; then - cat autorelease-env.sh >> $GITHUB_ENV + cat autorelease-env.sh >> $$GITHUB_ENV fi test-testpypi diff --git a/autorelease/scripts/vendor.py b/autorelease/scripts/vendor.py index 787415d..8e19a5a 100644 --- a/autorelease/scripts/vendor.py +++ b/autorelease/scripts/vendor.py @@ -1,8 +1,8 @@ -import pkg_resources +import string import pathlib -import shutil - -import click +import pkg_resources +from packaging.version import Version +import autorelease def vendor(resources, base_path, relative_target_dir): for resource in resources: @@ -12,7 +12,12 @@ def vendor(resources, base_path, relative_target_dir): target_dir.mkdir(parents=True, exist_ok=True) target_loc = base_path / relative_target_dir / name # print(f"cp {orig_loc} {target_loc}") - shutil.copy(orig_loc, target_loc) + with open(orig_loc, mode='r') as rfile: + template = string.Template(rfile.read()) + + version = Version(autorelease.version.version).base_version + with open(target_loc, mode='w') as wfile: + wfile.write(template.substitute(VERSION=version)) def vendor_actions(base_path): resources = ['autorelease-default-env.sh', 'autorelease-prep.yml', From 558bd49b2aec715b8865320b96e268c3a1fa4b86 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 13 May 2021 00:40:19 +0200 Subject: [PATCH 4/8] better workflow names --- autorelease/gh_actions_stages/autorelease-deploy.yml | 2 +- autorelease/gh_actions_stages/autorelease-gh-rel.yml | 4 +++- autorelease/gh_actions_stages/autorelease-prep.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/autorelease/gh_actions_stages/autorelease-deploy.yml b/autorelease/gh_actions_stages/autorelease-deploy.yml index 08b643c..9a92321 100644 --- a/autorelease/gh_actions_stages/autorelease-deploy.yml +++ b/autorelease/gh_actions_stages/autorelease-deploy.yml @@ -1,6 +1,6 @@ # Vendored from Autorelease $VERSION # Update by updating Autorelease and running `autorelease vendor actions` -name: Autorelease +name: "Autorelease Deploy" on: release: types: [published] diff --git a/autorelease/gh_actions_stages/autorelease-gh-rel.yml b/autorelease/gh_actions_stages/autorelease-gh-rel.yml index 1809fee..ba8105b 100644 --- a/autorelease/gh_actions_stages/autorelease-gh-rel.yml +++ b/autorelease/gh_actions_stages/autorelease-gh-rel.yml @@ -1,9 +1,10 @@ # Vendored from Autorelease $VERSION # Update by updating Autorelease and running `autorelease vendor actions` -name: Autorelease +name: "Autorelease Release" on: push: branches: + # TODO: this should come from yaml conf - stable jobs: @@ -33,3 +34,4 @@ jobs: autorelease-release --project $$PROJECT --version $$VERSION --token $$AUTORELEASE_TOKEN env: AUTORELEASE_TOKEN: $${{ secrets.AUTORELEASE_TOKEN }} + name: "Cut release" diff --git a/autorelease/gh_actions_stages/autorelease-prep.yml b/autorelease/gh_actions_stages/autorelease-prep.yml index c3e8086..1966ed3 100644 --- a/autorelease/gh_actions_stages/autorelease-prep.yml +++ b/autorelease/gh_actions_stages/autorelease-prep.yml @@ -1,9 +1,10 @@ # Vendored from Autorelease $VERSION # Update by updating Autorelease and running `autorelease vendor actions` -name: "Autorelease" +name: "Autorelease testpypi" on: pull_request: branches: + # TODO: this should come from yaml conf - stable defaults: From a1ebe6a5c70c5aa8b849c9290a871327ff81a5a1 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 13 May 2021 02:09:21 +0200 Subject: [PATCH 5/8] update vendored actions --- .github/workflows/autorelease-deploy.yml | 2 +- .github/workflows/autorelease-gh-rel.yml | 4 +++- .github/workflows/autorelease-prep.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autorelease-deploy.yml b/.github/workflows/autorelease-deploy.yml index f30139c..5b91173 100644 --- a/.github/workflows/autorelease-deploy.yml +++ b/.github/workflows/autorelease-deploy.yml @@ -1,6 +1,6 @@ # Vendored from Autorelease 0.3.1 # Update by updating Autorelease and running `autorelease vendor actions` -name: Autorelease +name: "Autorelease Deploy" on: release: types: [published] diff --git a/.github/workflows/autorelease-gh-rel.yml b/.github/workflows/autorelease-gh-rel.yml index 0d17f90..4d11807 100644 --- a/.github/workflows/autorelease-gh-rel.yml +++ b/.github/workflows/autorelease-gh-rel.yml @@ -1,9 +1,10 @@ # Vendored from Autorelease 0.3.1 # Update by updating Autorelease and running `autorelease vendor actions` -name: Autorelease +name: "Autorelease Release" on: push: branches: + # TODO: this should come from yaml conf - stable jobs: @@ -33,3 +34,4 @@ jobs: autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN env: AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }} + name: "Cut release" diff --git a/.github/workflows/autorelease-prep.yml b/.github/workflows/autorelease-prep.yml index 3fc009d..1f01841 100644 --- a/.github/workflows/autorelease-prep.yml +++ b/.github/workflows/autorelease-prep.yml @@ -1,9 +1,10 @@ # Vendored from Autorelease 0.3.1 # Update by updating Autorelease and running `autorelease vendor actions` -name: "Autorelease" +name: "Autorelease testpypi" on: pull_request: branches: + # TODO: this should come from yaml conf - stable defaults: From ca32d14b4debf1500bef5bb1bd8beec9825e7ca3 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 13 May 2021 02:16:37 +0200 Subject: [PATCH 6/8] master => main in action --- .github/workflows/unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 36c8411..ca7bbb9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,11 +2,11 @@ name: "Unit tests" on: pull_request: branches: - - master + - main - stable push: branches: - - master + - main tags: - "v*" schedule: From da4fc243a142f795bfa0761bf15e931aff7d3cfd Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 5 Jul 2021 14:51:27 -0400 Subject: [PATCH 7/8] Update PR links for changes in GitHub --- autorelease/release_notes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autorelease/release_notes.py b/autorelease/release_notes.py index 8154ed2..2726432 100644 --- a/autorelease/release_notes.py +++ b/autorelease/release_notes.py @@ -117,10 +117,12 @@ def write_pull_line(self, pull, extra_labels=None): title = pull['title'] number = str(pull['number']) author = pull['user']['login'] - out_str = "* " + title + " (#" + number + url = pull['html_url'] + pull_link = "([#" + number + "](" + url + ")" if author not in self.config['standard_contributors']: - out_str += " @" + author - out_str += ")" + pull_link += " @" + author + pull_link += ")" + out_str = "* " + title + " " + pull_link for label in extra_labels: label = label.replace(' ', '_') out_str += " #" + label @@ -139,7 +141,7 @@ def output_for_known_labels(self, pull_dict, pull_to_labels): out_str = "" for lbl in self.config['labels']: label = lbl['label'] - out_str += "\n# " + lbl['heading'] + "\n" + out_str += "\n## " + lbl['heading'] + "\n" for pull in pull_dict[label]: pull_labels = set(pull_to_labels[pull['number']]) extra_labels = pull_labels - set([label]) From a59aec9833446d76419c97d11366f06e17f6a391 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 6 Jul 2021 12:26:32 -0400 Subject: [PATCH 8/8] Autorelease 0.3.1 --- autorelease-travis.yml | 10 +++++----- devtools/conda-recipe/meta.yaml | 2 +- setup.cfg | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/autorelease-travis.yml b/autorelease-travis.yml index 81fdffd..82eac79 100644 --- a/autorelease-travis.yml +++ b/autorelease-travis.yml @@ -1,4 +1,4 @@ -# AUTORELEASE v0.3.1.dev0 +# AUTORELEASE v0.3.1 # for nonrelease, use @master # for release, use v${VERSION}, e.g., v1.0.0 stages: @@ -9,7 +9,7 @@ stages: - deploy pypi import: - - dwhswenson/autorelease:travis_stages/deploy_testpypi.yml@master - - dwhswenson/autorelease:travis_stages/test_testpypi.yml@master - - dwhswenson/autorelease:travis_stages/cut_release.yml@master - - dwhswenson/autorelease:travis_stages/deploy_pypi.yml@master + - dwhswenson/autorelease:travis_stages/deploy_testpypi.yml@v0.3.1 + - dwhswenson/autorelease:travis_stages/test_testpypi.yml@v0.3.1 + - dwhswenson/autorelease:travis_stages/cut_release.yml@v0.3.1 + - dwhswenson/autorelease:travis_stages/deploy_pypi.yml@v0.3.1 diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 27329b1..1fd7ded 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: autorelease # add ".dev0" for unreleased versions - version: "0.3.1.dev0" + version: "0.3.1" source: path: ../../ diff --git a/setup.cfg b/setup.cfg index de34a81..cef1898 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = autorelease -version = 0.3.1.dev0 +version = 0.3.1 # version should end in .dev0 if this isn't to be released short_description = Tools to keep the release process clean. description = Tools to keep the release process clean.