Skip to content

Commit e0ae984

Browse files
Python51888gitee-org
authored andcommitted
!3 添加了publish.yml
Merge pull request !3 from Python51888/mid_py
2 parents a6bf71b + 080abca commit e0ae984

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 当推送以 'v' 开头的标签时触发
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: windows-latest # 使用 Windows 环境
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Install uv
21+
run: |
22+
powershell -c "irm https://astral.sh/uv/install.sh | iex"
23+
echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
24+
25+
- name: Build package
26+
run: uv build
27+
28+
- name: Publish to PyPI
29+
env:
30+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} # 使用 UV_PUBLISH_TOKEN 替代 TWINE_PASSWORD
31+
run: uv publish dist/*

0 commit comments

Comments
 (0)