Skip to content

Commit

Permalink
Merge pull request #135 from ketozhang/master
Browse files Browse the repository at this point in the history
Fix manual publish option to skip publish to PyPA
  • Loading branch information
rpoleski authored Apr 29, 2024
2 parents 3e9ee85 + 90d3f04 commit 3e96b60
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ on:
types: [published]
workflow_dispatch:
inputs:
publish:
disable-publish:
description: |
Should publish to PyPA (default false for manual runs). Artifacts are
Disables publish to PyPA (default, true for manual runs). Artifacts are
available in both cases.
default: false
default: true
type: boolean

env:
PUBLISH: ${{ inputs.publish == '' && true || inputs.publish }} # Default true for automatic runs

jobs:

build_wheels:
Expand Down Expand Up @@ -77,6 +74,7 @@ jobs:

publish:
name: Publish to PyPI
if: ${{ !(inputs.disable-publish || false) }} # Only skips if inputs.disable-publish is true
runs-on: ubuntu-latest
needs: [build_source, build_wheels]

Expand All @@ -96,7 +94,6 @@ jobs:
path: dist/

- name: Publish package to PyPI
if: ${{ env.PUBLISH }}
# All files in dist/ are published
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 3e96b60

Please sign in to comment.