File tree Expand file tree Collapse file tree 1 file changed +33
-11
lines changed Expand file tree Collapse file tree 1 file changed +33
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Python 🐍 distribution 📦 to PyPI
2+
13on :
24 push :
35 tags :
46 - " *"
57
6- name : Release
7-
88jobs :
9- pypi :
10- name : Upload release to PyPI
9+ build :
10+ name : Build distribution 📦
1111 runs-on : ubuntu-latest
12- environment : release
13- permissions :
14- # Used to authenticate to PyPI via OIDC.
15- id-token : write
12+
1613 steps :
1714 - uses : actions/checkout@v4
18- - uses : actions/setup-python@v5
15+ - name : Set up Python
16+ uses : actions/setup-python@v5
1917 with :
2018 python-version : " 3.x"
21- - name : Build sdist and wheel
19+ - name : Build a binary wheel and a source tarball
2220 run : pipx run build
23- - name : Publish to PyPI
21+ - name : Store the distribution packages
22+ uses : actions/upload-artifact@v4
23+ with :
24+ name : python-package-distributions
25+ path : dist/
26+
27+ publish-to-pypi :
28+ name : >-
29+ Publish Python 🐍 distribution 📦 to PyPI
30+ needs :
31+ - build
32+ runs-on : ubuntu-latest
33+ environment :
34+ name : pypi
35+ url : https://pypi.org/p/pip/${{ github.ref_name }}
36+ permissions :
37+ id-token : write # IMPORTANT: mandatory for trusted publishing
38+
39+ steps :
40+ - name : Download all the dists
41+ uses : actions/download-artifact@v4
42+ with :
43+ name : python-package-distributions
44+ path : dist/
45+ - name : Publish distribution 📦 to PyPI
2446 uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments