File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *.*.*' # Triggers on version tags like 2.4.0, 1.0.0, etc.
7+
8+ jobs :
9+ build-and-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+ with :
17+ fetch-depth : 0 # Fetch full history for setuptools_scm
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ' 3.12'
23+
24+ - name : Install build dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install build setuptools_scm[toml]
28+
29+ - name : Build package
30+ run : python -m build
31+
32+ - name : Publish to PyPI
33+ uses : pypa/gh-action-pypi-publish@release/v1
34+ with :
35+ # Using trusted publishing (recommended)
36+ # No API token needed if trusted publishing is configured
37+ # Otherwise, add PYPI_API_TOKEN to repository secrets
38+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments