File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and publish Python package
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # publish only on tag pushes like v1.2.3
7+
8+ jobs :
9+ build-and-publish :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0 # necessary for setuptools_scm to see tags
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : " 3.10"
21+
22+ - name : Install build & twine
23+ run : python -m pip install --upgrade pip build twine setuptools_scm
24+
25+ - name : Build sdist and wheel
26+ run : python -m build --sdist --wheel
27+
28+ - name : Check artifacts
29+ run : ls -l dist
30+
31+ - name : Publish to PyPI
32+ env :
33+ TWINE_USERNAME : __token__
34+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
35+ run : |
36+ python -m twine check dist/*
37+ python -m twine upload dist/* --non-interactive
You can’t perform that action at this time.
0 commit comments