Skip to content

Commit

Permalink
ci: Add ability to skip test PyPI publishing (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesara authored Nov 5, 2024
1 parent fae72e6 commit 9c4dbec
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -32,15 +37,15 @@ 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: |
echo "NEXT_VERSION=$next" >> $GITHUB_ENV
- name: Create Draft Release
uses: ncipollo/release-action@v1
if: ${{ github.event.inputs.publish }}
if: ${{ inputs.publish_release }}
with:
prerelease: true
draft: false
Expand Down Expand Up @@ -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/
Expand Down

0 comments on commit 9c4dbec

Please sign in to comment.