File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch : # Manual trigger for TestPyPI testing
7+
8+ jobs :
9+ publish :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ id-token : write # Required for trusted publishing
13+
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : ' 3.11'
21+
22+ - name : Install build tools
23+ run : pip install build
24+
25+ - name : Build package
26+ run : python -m build
27+
28+ - name : Verify package
29+ run : |
30+ pip install twine
31+ twine check dist/*
32+
33+ # TestPyPI for manual runs or pre-releases
34+ - name : Publish to TestPyPI
35+ if : github.event_name == 'workflow_dispatch' || github.event.release.prerelease
36+ uses : pypa/gh-action-pypi-publish@release/v1
37+ with :
38+ repository-url : https://test.pypi.org/legacy/
39+
40+ # PyPI for full releases only
41+ - name : Publish to PyPI
42+ if : github.event_name == 'release' && !github.event.release.prerelease
43+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments