File tree Expand file tree Collapse file tree 3 files changed +17
-20
lines changed
Expand file tree Collapse file tree 3 files changed +17
-20
lines changed Original file line number Diff line number Diff line change 33on :
44 push :
55 branches : [ master, develop ]
6+ tags :
7+ - ' [0-9]+.[0-9]+.[0-9]+' # Triggers on version tags like 0.1.0, 1.2.3, etc.
68 pull_request :
79 branches : [ master, develop ]
810
Original file line number Diff line number Diff line change 11name : Publish to PyPI
22
33on :
4- push :
5- tags :
6- - ' [0-9]+.[0-9]+.[0-9]+' # Triggers on version tags like 0.1.0, 1.2.3, etc.
4+ workflow_run :
5+ workflows : ["CI"]
6+ types :
7+ - completed
8+ branches : [master, develop]
79
810jobs :
911 publish :
1012 runs-on : ubuntu-latest
13+ if : ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/') }}
1114
1215 steps :
1316 - uses : actions/checkout@v4
1417
15- - name : Set up Python
16- uses : actions/setup-python@v4
18+ - name : Download build artifacts from CI
19+ uses : actions/download-artifact@v3
1720 with :
18- python-version : " 3.11"
19-
20- - name : Install uv
21- run : |
22- curl -LsSf https://astral.sh/uv/install.sh | sh
23- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
24-
25- - name : Install dependencies
26- run : |
27- uv sync
28-
29- - name : Build package
30- run : |
31- uv build
21+ name : dist
22+ path : dist/
23+ github-token : ${{ secrets.GITHUB_TOKEN }}
24+ run-id : ${{ github.event.workflow_run.id }}
3225
3326 - name : Publish to PyPI
3427 uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change @@ -307,8 +307,10 @@ To release a new version:
307307 git push origin 0.1.1
308308 ```
3093093 . The GitHub Action will automatically:
310+ - Run all tests across Python versions (3.8-3.12)
311+ - Run linting and type checking
310312 - Build the package
311- - Publish to PyPI
313+ - Publish to PyPI (only if all checks pass)
312314
313315** Note:** Make sure to set the ` PYPI_API_TOKEN ` secret in your GitHub repository settings.
314316
You can’t perform that action at this time.
0 commit comments