File tree 1 file changed +43
-0
lines changed 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Python 🐍 distribution 📦 to PyPI
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' *'
7
+
8
+ jobs :
9
+ build :
10
+ name : Build distribution 📦
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v5
17
+ with :
18
+ python-version : " 3.x"
19
+ - name : Install pypa/build
20
+ run : python3 -m pip install build --user
21
+ - name : Build a binary wheel and a source tarball
22
+ run : python3 -m build
23
+ - name : Store the distribution packages
24
+ uses : actions/upload-artifact@v4
25
+ with :
26
+ name : python-package-distributions
27
+ path : dist/
28
+
29
+ publish-to-pypi :
30
+ name : Publish Python 🐍 distribution 📦 to PyPI
31
+ if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
32
+ needs : build
33
+ runs-on : ubuntu-latest
34
+ permissions :
35
+ id-token : write # Required for trusted publishing
36
+ steps :
37
+ - name : Download all the dists
38
+ uses : actions/download-artifact@v4
39
+ with :
40
+ name : python-package-distributions
41
+ path : dist/
42
+ - name : Publish distribution 📦 to PyPI
43
+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments