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