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