File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 11name : Publish to PyPI
22
33on :
4- release :
5- types : [published]
4+ workflow_run :
5+ workflows : ["Build wheels"]
6+ types : [completed]
67 workflow_dispatch :
78 inputs :
89 tag :
9- description : " Release tag to publish (e.g. v0.0.20 )"
10+ description : " Release tag to publish (e.g. v0.5.26 )"
1011 required : true
1112
1213jobs :
1314 publish :
1415 name : Upload to PyPI
1516 runs-on : ubuntu-latest
17+ # Only run if build-wheels succeeded (or manual dispatch)
18+ if : >-
19+ github.event_name == 'workflow_dispatch' ||
20+ (github.event.workflow_run.conclusion == 'success' &&
21+ startsWith(github.event.workflow_run.head_branch, 'v'))
1622 permissions :
1723 contents : read
1824 id-token : write
1925 steps :
26+ - name : Determine tag
27+ id : tag
28+ run : |
29+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
30+ echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
31+ else
32+ echo "tag=${{ github.event.workflow_run.head_branch }}" >> "$GITHUB_OUTPUT"
33+ fi
34+
2035 - name : Download release assets
2136 env :
2237 GH_TOKEN : ${{ github.token }}
2338 run : |
24- TAG="${{ github.event.release.tag_name || github.event.inputs.tag }}"
39+ TAG="${{ steps.tag.outputs.tag }}"
40+ echo "Downloading wheels for ${TAG}..."
2541 mkdir -p dist
2642 gh release download "${TAG}" \
2743 --repo "${{ github.repository }}" \
2844 --dir dist \
2945 --pattern "*.whl"
46+ ls -la dist/
3047
3148 - uses : pypa/gh-action-pypi-publish@release/v1
3249 with :
You can’t perform that action at this time.
0 commit comments