From adef0b814b2cae7e6b026528db5487fcb230df5e Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Tue, 26 Nov 2024 10:28:13 +1100 Subject: [PATCH 1/3] ci: Refactor publish input --- .github/workflows/pypi-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 101f2cfe..4712780c 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -3,7 +3,7 @@ name: Publish Python Package on: workflow_dispatch: inputs: - publish: + publish_release: description: 'Create Production Release' required: true type: boolean @@ -25,7 +25,7 @@ jobs: fetch-depth: 0 - name: Get Next Version - if: ${{ github.event.inputs.publish }} + if: ${{ inputs.publish_release }} id: semver uses: ietf-tools/semver-action@v1 with: @@ -34,7 +34,7 @@ jobs: branch: main - name: Set Next Version Env Var - if: ${{ github.event.inputs.publish }} + if: ${{ inputs.publish_release }} env: NEXT_VERSION: ${{ steps.semver.outputs.next }} run: | @@ -42,7 +42,7 @@ jobs: - name: Create Draft Release uses: ncipollo/release-action@v1 - if: ${{ github.event.inputs.publish }} + if: ${{ inputs.publish_release }} with: prerelease: true draft: false @@ -134,7 +134,7 @@ jobs: build-base: runs-on: ubuntu-latest - if: github.event.inputs.publish + if: ${{ inputs.publish_release }} needs: [publish] permissions: contents: read From a82a4e1c6f9fe70ce33c161ddb64ce0c9a425bc8 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Tue, 26 Nov 2024 10:30:02 +1100 Subject: [PATCH 2/3] ci: Add ability skip test PyPI publishing --- .github/workflows/pypi-publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 4712780c..1fc623fe 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,6 +7,11 @@ on: description: 'Create Production Release' required: true type: boolean + skip_test_pypi: + description: "Skip publishing to test PyPI" + required: false + type: boolean + default: "false" jobs: publish: @@ -124,6 +129,7 @@ jobs: makeLatest: true - name: Publish to Test PyPI + if: ${{ !inputs.skip_test_pypi }} uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ From 9b061e9d652d5274c2b1a1e71ddcab0265373f20 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Tue, 26 Nov 2024 10:31:05 +1100 Subject: [PATCH 3/3] ci: Set attestations: false See https://github.com/pypa/gh-action-pypi-publish/issues/283 --- .github/workflows/pypi-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 1fc623fe..14e3f13e 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -137,6 +137,8 @@ jobs: - name: Publish to PyPI if: env.SHOULD_DEPLOY == 'true' uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: false build-base: runs-on: ubuntu-latest