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@v4
14+ with :
15+ python-version : " >=3.10" # Specify the minimum Python version required
16+
17+ - name : Install pypa/build
18+ run : >-
19+ python3 -m
20+ pip install
21+ build
22+ --user
23+ - name : Build a binary wheel and a source tarball
24+ run : python3 -m build
25+ - name : Store the distribution packages
26+ uses : actions/upload-artifact@v4
27+ with :
28+ name : python-package-distributions
29+ path : dist/
30+
31+ publish-to-pypi :
32+ name : >-
33+ Publish Python 🐍 distribution 📦 to PyPI
34+ if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
35+ needs :
36+ - build
37+ runs-on : ubuntu-latest
38+ environment :
39+ name : pypi
40+ url : https://pypi.org/p/semantic_world # Replace <package-name> with your PyPI project name
41+ permissions :
42+ id-token : write # IMPORTANT: mandatory for trusted publishing
43+
44+ steps :
45+ - name : Download all the dists
46+ uses : actions/download-artifact@v4
47+ with :
48+ name : python-package-distributions
49+ path : dist/
50+ - name : Publish distribution 📦 to PyPI
51+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments