File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Python Package
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*" # 仅在推送标签时触发
7
+
8
+ jobs :
9
+ publish :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout code
14
+ uses : actions/checkout@v2
15
+
16
+ - name : Set up Python
17
+ uses : actions/setup-python@v2
18
+ with :
19
+ python-version : " 3.9" # 选择 Python 版本
20
+
21
+ - name : Install dependencies
22
+ run : |
23
+ python -m pip install --upgrade pip
24
+ pip install setuptools wheel twine
25
+
26
+ - name : Build package
27
+ run : python setup.py sdist bdist_wheel
28
+
29
+ - name : Publish package to PyPI
30
+ env :
31
+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
32
+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
33
+ run : twine upload dist/*
34
+
35
+ - name : Clean up dist folder
36
+ run : rm -rf dist
You can’t perform that action at this time.
0 commit comments