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 : Manual Publish to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : ' Version tag to publish (e.g. v0.2.0)'
8+ required : true
9+ type : string
10+
11+ jobs :
12+ build-and-publish :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repo
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ' 3.10' # Adjust as needed
23+
24+ - name : Fetch all tags
25+ run : git fetch --tags
26+
27+ - name : Check out the specified tag
28+ run : git checkout ${{ github.event.inputs.tag }}
29+
30+ - name : Install build tools
31+ run : pip install --upgrade build
32+
33+ - name : Build package
34+ run : python -m build
35+
36+ - name : Publish to PyPI
37+ uses : pypa/gh-action-pypi-publish@release/v1
38+ with :
39+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments