File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI + Publish to PyPI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ tags :
8+ - " v*"
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout repo
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Python
19+ uses : actions/setup-python@v5
20+ with :
21+ python-version : " 3.12"
22+
23+ - name : Install build backend
24+ run : pip install build
25+
26+ - name : Build package
27+ run : python -m build
28+
29+ - name : Upload build artifact
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : dist-files
33+ path : dist/
34+
35+ publish :
36+ needs : build
37+ runs-on : ubuntu-latest
38+ if : startsWith(github.ref, 'refs/tags/v')
39+
40+ steps :
41+ - name : Download build artifacts
42+ uses : actions/download-artifact@v4
43+ with :
44+ name : dist-files
45+ path : dist/
46+
47+ - name : Publish to PyPI
48+ uses : pypa/gh-action-pypi-publish@release/v1
49+ with :
50+ password : ${{ secrets.PYPI_API_TOKEN }}
51+ skip_existing : true
You can’t perform that action at this time.
0 commit comments