1- name : Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
1+ name : Publish Python 🐍 Distribution 📦 to PyPI and TestPyPI
22
33on :
44 push :
99
1010jobs :
1111 build :
12- name : Build distribution 📦
12+ name : Build Distribution 📦
1313 runs-on : ubuntu-latest
1414
1515 steps :
16- - uses : actions/checkout@v4
17- - name : Set up Python
16+ - name : Checkout Code
17+ uses : actions/checkout@v4
18+
19+ - name : Set Up Python
1820 uses : actions/setup-python@v4
1921 with :
2022 python-version : " 3.*"
2123
22- - name : Install pypa/build
24+ - name : Install Build Dependencies
2325 run : pip install ".[build]"
2426
25- - name : Build a binary wheel and a source tarball
27+ - name : Build Distribution Packages
2628 run : python3 -m build
2729
28- - name : Store the distribution packages
29- uses : actions/upload-artifact@v3
30+ - name : Upload Distribution Packages
31+ uses : actions/upload-artifact@v4
3032 with :
3133 name : python-package-distributions
3234 path : dist/
3335
3436 publish-to-pypi :
35- name : >-
36- Publish Python 🐍 distribution 📦 to PyPI
37-
38- # only publish to PyPI on tag pushes
39- if : startsWith(github.ref, 'refs/tags/')
40- needs :
41- - build
37+ name : Publish Distribution 📦 to PyPI
38+ if : startsWith(github.ref, 'refs/tags/') # Only publish on tag pushes
39+ needs : build
4240 runs-on : ubuntu-latest
4341
4442 environment :
@@ -49,11 +47,11 @@ jobs:
4947 id-token : write
5048
5149 steps :
52- - name : Download all the dists
53- uses : actions/download-artifact@v3
50+ - name : Download Distribution Packages
51+ uses : actions/download-artifact@v4
5452 with :
5553 name : python-package-distributions
5654 path : dist/
5755
58- - name : Publish distribution 📦 to PyPI
56+ - name : Publish to PyPI
5957 uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments