From 5f189f35df4e5dd31532de48e87dcf2e3f957d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sampaio?= Date: Wed, 23 Sep 2026 12:24:18 -0600 Subject: [PATCH 1/2] Fix "Release to PyPI" --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc08a22..9068d51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,13 +19,13 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v6 name: Install Python with: - python-version: 3.8 + python-version: '3.13' - run: | - pip install packaging + pip install packaging setuptools - name: Normalize the release version run: | echo "release_version=`echo '${{ github.event.inputs.requested_release_tag }}' | sed 's/^v//'`" >> $GITHUB_ENV From 69182b0ed6066bcb2d3a2908dcf4ab8eedd9d900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sampaio?= Date: Wed, 23 Sep 2026 12:30:58 -0600 Subject: [PATCH 2/2] Add `dry_run` so we can test this without actually create new releases --- .github/workflows/release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9068d51..2409f15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: requested_release_tag: description: 'The tag to use for this release (e.g., `v2.3.0`)' required: true + dry_run: + description: 'Dry run: Skip tag, upload to TestPyPI' + type: boolean + default: false jobs: build_and_upload: @@ -24,8 +28,10 @@ jobs: with: python-version: '3.13' + # setuptools 77 and later write Metadata-Version 2.4. The twine version + # in the publish action does not support it. - run: | - pip install packaging setuptools + pip install packaging 'setuptools<77' - name: Normalize the release version run: | echo "release_version=`echo '${{ github.event.inputs.requested_release_tag }}' | sed 's/^v//'`" >> $GITHUB_ENV @@ -67,6 +73,7 @@ jobs: echo "release_version=$release_version" >> $GITHUB_OUTPUT echo "release_tag=$release_tag" >> $GITHUB_OUTPUT - name: Tag commit + if: ${{ !inputs.dry_run }} uses: actions/github-script@v7.0.1 with: script: | @@ -80,4 +87,12 @@ jobs: run: | python setup.py sdist - name: Upload to PyPI + if: ${{ !inputs.dry_run }} uses: closeio/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9 + - name: Upload to TestPyPI + if: ${{ inputs.dry_run }} + uses: closeio/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9 + with: + repository-url: https://test.pypi.org/legacy/ + # Allow repeated dry runs for the same version. + skip-existing: true