File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Release Step 2 - Publish to PyPI
2- run-name : publish to pypi ${{ github.event.release.tag_name }}
2+ run-name : publish to pypi
33
44on :
5- release :
6- types : [published]
5+ workflow_run :
6+ workflows : ["Release Step 1 - Release on GitHub"] # Must match name exactly
7+ types : [completed]
8+ workflow_dispatch :
9+ inputs :
10+ ref :
11+ description : ' Branch or tag to publish'
12+ default : ' main'
13+ required : false
714
815jobs :
916 pypi-publish :
17+ # Only run if Step 1 was successful, or if triggered manually
18+ if : ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
1019 name : Build and publish Python package
1120 runs-on : ubuntu-latest
1221 environment : release
1322
14- # Required for PyPI Trusted Publishing
1523 permissions :
16- id-token : write
24+ id-token : write # Required for PyPI Trusted Publishing
1725 contents : read
1826
1927 steps :
2028 - name : Checkout repository
2129 uses : actions/checkout@v4
2230 with :
23- ref : ${{ github.event.release.tag_name }}
31+ # Use branch from trigger, or default to main
32+ ref : ${{ github.event.workflow_run.head_branch || inputs.ref || 'main' }}
2433
2534 - name : Install uv
2635 uses : astral-sh/setup-uv@v5
You can’t perform that action at this time.
0 commit comments