Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manual publish option to skip publish to PyPA #135

Merged
merged 3 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading