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
+
1
3
on :
2
4
push :
3
5
tags :
4
6
- " *"
5
7
6
- name : Release
7
-
8
8
jobs :
9
- pypi :
10
- name : Upload release to PyPI
9
+ build :
10
+ name : Build distribution 📦
11
11
runs-on : ubuntu-latest
12
- environment : release
13
- permissions :
14
- # Used to authenticate to PyPI via OIDC.
15
- id-token : write
12
+
16
13
steps :
17
14
- uses : actions/checkout@v4
18
- - uses : actions/setup-python@v5
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v5
19
17
with :
20
18
python-version : " 3.x"
21
- - name : Build sdist and wheel
19
+ - name : Build a binary wheel and a source tarball
22
20
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
24
46
uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments