Skip to content

Commit 35d0545

Browse files
committedOct 22, 2024
2 parents 1f58cf4 + 519ad94 commit 35d0545

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
 

‎.github/workflows/python-publish.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 }}

0 commit comments

Comments
 (0)