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 : Publish to PyPI
2+ on : release
3+
4+ jobs :
5+ build :
6+ name : Build distribution
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - uses : actions/checkout@v6
11+ with :
12+ persist-credentials : false
13+
14+ - name : Set up Python
15+ uses : actions/setup-python@v6
16+ with :
17+ python-version : " 3.x"
18+
19+ - name : Install pypa/build
20+ run : python3 -m pip install --user build
21+
22+ - name : Build a binary wheel and a source tarball
23+ run : python3 -m build
24+
25+ - name : Store the distribution packages
26+ uses : actions/upload-artifact@v5
27+ with :
28+ name : python-package-distributions
29+ path : dist/
30+
31+ publish-to-pypi :
32+ name : Publish Python distribution to PyPI
33+ needs :
34+ - build
35+ runs-on : ubuntu-latest
36+ environment :
37+ name : pypi
38+ url : https://pypi.org/p/pathspec
39+ permissions :
40+ id-token : write # IMPORTANT: mandatory for trusted publishing
41+
42+ steps :
43+ - name : Download all the dists
44+ uses : actions/download-artifact@v6
45+ with :
46+ name : python-package-distributions
47+ path : dist/
48+
49+ - name : Publish distribution to PyPI
50+ uses : pypa/gh-action-pypi-publish@v1.13.0
Original file line number Diff line number Diff line change 1+ name : Publish to TestPyPI
2+ on :
3+ push :
4+ branches :
5+ - master
6+
7+ jobs :
8+ build :
9+ name : Build distribution
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v6
14+ with :
15+ persist-credentials : false
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v6
19+ with :
20+ python-version : " 3.x"
21+
22+ - name : Install pypa/build
23+ run : python3 -m pip install --user build
24+
25+ - name : Build a binary wheel and a source tarball
26+ run : python3 -m build
27+
28+ - name : Store the distribution packages
29+ uses : actions/upload-artifact@v5
30+ with :
31+ name : python-package-distributions
32+ path : dist/
33+
34+ publish-to-testpypi :
35+ name : Publish Python distribution to TestPyPI
36+ needs :
37+ - build
38+ runs-on : ubuntu-latest
39+ environment :
40+ name : testpypi
41+ url : https://test.pypi.org/p/pathspec
42+ permissions :
43+ id-token : write # IMPORTANT: mandatory for trusted publishing
44+
45+ steps :
46+ - name : Download all the dists
47+ uses : actions/download-artifact@v6
48+ with :
49+ name : python-package-distributions
50+ path : dist/
51+
52+ - name : Publish distribution to TestPyPI
53+ uses : pypa/gh-action-pypi-publish@v1.13.0
54+ with :
55+ repository-url : https://test.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments