@@ -3,15 +3,10 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
33on : push
44
55jobs :
6- build-n-publish-pypi :
7- name : Build and publish Python 🐍 distributions 📦 to PyPI
6+ build :
7+ name : Build the source package
88 runs-on : ubuntu-latest
9- environment :
10- name : pypi
11- url : https://pypi.org/p/<package-name>
12- permissions :
13- id-token : write
14-
9+
1510 steps :
1611 - uses : actions/checkout@v3
1712 - name : Set up Python
@@ -28,11 +23,25 @@ jobs:
2823 run : >-
2924 python3 -m
3025 build
31- --sdist
32- --wheel
33- --outdir dist/
34- .
35- # Actually publish to PyPI
26+ - name : Store the distribution packages
27+ uses : actions/upload-artifact@v3
28+ with :
29+ name : python-package-distributions
30+ build-n-publish-pypi :
31+ name : Build and publish Python 🐍 distributions 📦 to PyPI
32+ runs-on : ubuntu-latest
33+ environment :
34+ name : pypi
35+ url : https://pypi.org/p/<package-name>
36+ permissions :
37+ id-token : write
38+
39+ steps :
40+ - name : Download all the dists
41+ uses : actions/download-artifact@v3
42+ with :
43+ name : python-package-distributions
44+ path : dist/
3645 - name : Publish distribution 📦 to PyPI
3746 if : startsWith(github.ref, 'refs/tags')
3847 uses : pypa/gh-action-pypi-publish@release/v1
@@ -46,25 +55,11 @@ jobs:
4655 id-token : write
4756
4857 steps :
49- - uses : actions/checkout@v3
50- - name : Set up Python
51- uses : actions/setup-python@v4
58+ - name : Download all the dists
59+ uses : actions/download-artifact@v3
5260 with :
53- python-version : " 3.x"
54- - name : Install pypa/build
55- run : >-
56- python3 -m
57- pip install
58- build
59- --user
60- - name : Build a binary wheel and a source tarball
61- run : >-
62- python3 -m
63- build
64- --sdist
65- --wheel
66- --outdir dist/
67- .
61+ name : python-package-distributions
62+ path : dist/
6863 - name : Publish distribution 📦 to Test PyPI
6964 uses : pypa/gh-action-pypi-publish@release/v1
7065 with :
0 commit comments