File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ release :
5+ types : [created] # Trigger only when a release is created
6+ workflow_dispatch : # Allows manual triggering of the workflow
7+
8+ jobs :
9+ publish :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ # Step 1: Check out the code
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+
17+ # Step 2: Set up Python
18+ - name : Set up Python
19+ uses : actions/setup-python@v5
20+ with :
21+ python-version : 3.13
22+
23+ # Step 3: Install dependencies for building and publishing
24+ - name : Install build tools
25+ run : |
26+ pip install --upgrade pip
27+ pip install build twine
28+
29+ # Step 4: Build the package
30+ - name : Build the package
31+ run : |
32+ python -m build
33+
34+ # Step 5: Publish to PyPI
35+ - name : Publish to PyPI
36+ env :
37+ TWINE_USERNAME : __token__
38+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
39+ run : |
40+ python -m twine check dist/*
41+ python -m twine upload --skip-existing dist/*
You can’t perform that action at this time.
0 commit comments