diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index ed6f700..afee0d1 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -3,10 +3,15 @@ name: Publish Python Package on: workflow_dispatch: inputs: - publish: + publish_release: 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: @@ -23,7 +28,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: @@ -32,7 +37,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: | @@ -40,7 +45,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 @@ -132,6 +137,7 @@ jobs: dist/*.tar.gz - 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/