File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Python Package to PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*' # Trigger on version tags like v1.0.0
7+ workflow_dispatch : # Allow manual trigger
8+
9+ jobs :
10+ build-and-publish :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+
17+ - name : Set up Python 3.12
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : ' 3.12'
21+
22+ - name : Upgrade pip
23+ run : python -m pip install --upgrade pip
24+
25+ - name : Install build tools
26+ run : pip install build twine
27+
28+ - name : Build the package
29+ run : python -m build
30+
31+ - name : Publish package to PyPI
32+ env :
33+ TWINE_USERNAME : __token__
34+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
35+ run : twine upload dist/* --non-interactive --skip-existing
You can’t perform that action at this time.
0 commit comments