File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Upload Python Package on Tag Creation
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' *' # 匹配所有 tag
7
+
8
+ permissions :
9
+ contents : read
10
+ packages : write # 如果您的包发布到 GitHub Packages,则需要此权限
11
+
12
+ jobs :
13
+ deploy :
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+ - name : Set up Python
19
+ uses : actions/setup-python@v3
20
+ with :
21
+ python-version : ' 3.x'
22
+ - name : Install dependencies
23
+ run : |
24
+ python -m pip install --upgrade pip
25
+ pip install build
26
+ - name : Build package
27
+ run : python -m build
28
+ - name : Publish package
29
+ uses : pypa/gh-action-pypi-publish@release/v1 # 使用一个稳定的版本标签,而不是具体的提交哈希
30
+ with :
31
+ user : __token__
32
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments