@@ -3,15 +3,10 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
3
3
on : push
4
4
5
5
jobs :
6
- build-n-publish-pypi :
7
- name : Build and publish Python 🐍 distributions 📦 to PyPI
6
+ build :
7
+ name : Build the source package
8
8
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
+
15
10
steps :
16
11
- uses : actions/checkout@v3
17
12
- name : Set up Python
@@ -28,11 +23,25 @@ jobs:
28
23
run : >-
29
24
python3 -m
30
25
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/
36
45
- name : Publish distribution 📦 to PyPI
37
46
if : startsWith(github.ref, 'refs/tags')
38
47
uses : pypa/gh-action-pypi-publish@release/v1
@@ -46,25 +55,11 @@ jobs:
46
55
id-token : write
47
56
48
57
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
52
60
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/
68
63
- name : Publish distribution 📦 to Test PyPI
69
64
uses : pypa/gh-action-pypi-publish@release/v1
70
65
with :
0 commit comments