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 : Publish to PyPI
22
33on :
4+ # Trigger after CI workflow completes successfully on master/main
5+ workflow_run :
6+ workflows : ["CI"]
7+ types : [completed]
8+ branches : [master, main]
9+ # Also support manual tag-based releases
410 release :
511 types : [published]
612 push :
1016jobs :
1117 build :
1218 runs-on : ubuntu-latest
19+ # Only run if CI succeeded (for workflow_run trigger) or for tags/releases
20+ if : |
21+ github.event_name == 'release' ||
22+ github.event_name == 'push' ||
23+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1324 steps :
1425 - uses : actions/checkout@v4
26+ with :
27+ ref : ${{ github.event.workflow_run.head_sha || github.sha }}
1528
1629 - name : Install uv
1730 uses : astral-sh/setup-uv@v4
5669 publish-pypi :
5770 runs-on : ubuntu-latest
5871 needs : [build]
59- if : github.event_name == 'release'
72+ # Publish on: releases, tag pushes, or successful CI on master/main
73+ if : |
74+ github.event_name == 'release' ||
75+ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) ||
76+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
6077 environment :
6178 name : pypi
6279 url : https://pypi.org/p/klondike-spec-cli
7087
7188 - name : Publish to PyPI
7289 uses : pypa/gh-action-pypi-publish@release/v1
90+ with :
91+ skip-existing : true
You can’t perform that action at this time.
0 commit comments