We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33753e0 commit 31a5af6Copy full SHA for 31a5af6
.github/workflows/release.yml
@@ -0,0 +1,35 @@
1
+name: Release to PyPI
2
+
3
+on:
4
+ push:
5
+ tags:
6
+ - 'v*' # 例如 v0.1.1
7
+ workflow_dispatch: {} # 允许手动触发
8
9
+jobs:
10
+ build-and-upload-pypi:
11
+ runs-on: ubuntu-latest
12
13
+ steps:
14
+ - name: Check out repo
15
+ uses: actions/checkout@v4
16
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.11'
21
22
+ - name: Upgrade build tools
23
+ run: python -m pip install --upgrade pip build twine
24
25
+ - name: Build wheel and sdist
26
+ run: python -m build
27
28
+ - name: Twine check
29
+ run: python -m twine check dist/*
30
31
+ - name: Upload to PyPI
32
+ env:
33
+ TWINE_USERNAME: __token__
34
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35
+ run: python -m twine upload dist/*
0 commit comments