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 : CI
22
3+ # Tag pushes must be listed explicitly; branch-only `push` does not run on new tags,
4+ # so "Publish to PyPI" would always be skipped without `tags:` here.
35on :
46 push :
57 branches : [main, dev]
8+ tags :
9+ - " v*"
610 pull_request :
711 branches : [main]
12+ workflow_dispatch :
13+ inputs :
14+ publish_to_pypi :
15+ description : " Publish to PyPI after tests (only if this version is not already on PyPI)"
16+ required : false
17+ default : false
18+ type : boolean
819
920jobs :
1021 test :
4758 name : Publish to PyPI
4859 runs-on : ubuntu-latest
4960 needs : test
50- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
61+ # Runs after a version tag push (e.g. v0.1.3), or manual run with publish enabled.
62+ if : |
63+ needs.test.result == 'success' &&
64+ (
65+ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) ||
66+ (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'true')
67+ )
5168
5269 steps :
5370 - uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments