Skip to content

Commit 674eeae

Browse files
zhengjiang shaozhengjiang shao
authored andcommitted
Add PyPI auto-publish workflow on version tag push
When a tag matching 'v*' is pushed, the workflow builds and publishes to PyPI automatically. Co-Authored-By: deepseek-v4-pro
1 parent 62e295f commit 674eeae

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.11'
17+
- name: Install build tools
18+
run: pip install build twine
19+
- name: Build package
20+
run: python -m build
21+
- name: Publish to PyPI
22+
run: twine upload dist/*
23+
env:
24+
TWINE_USERNAME: __token__
25+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)