Skip to content

Commit b1895aa

Browse files
authored
Create manual-publish.yml
1 parent 4e37ed0 commit b1895aa

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 }}

0 commit comments

Comments
 (0)