Skip to content

Commit 3eef15c

Browse files
committed
更新 GitHub Actions 工作流以修复 Release 创建问题
1 parent 6fc2b2d commit 3eef15c

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
# 显式声明权限
14+
permissions:
15+
contents: write # 允许创建 Release
16+
1317
steps:
1418
- uses: actions/checkout@v4
1519

@@ -40,6 +44,9 @@ jobs:
4044
echo "VERSION=${VERSION}" >> $GITHUB_ENV
4145
echo "版本信息: ${VERSION}"
4246
47+
- name: List files in dist/
48+
run: ls -la dist/
49+
4350
- name: Upload wheel package
4451
uses: actions/upload-artifact@v4
4552
with:
@@ -50,10 +57,13 @@ jobs:
5057
overwrite: false
5158

5259
- name: Create Release
53-
uses: softprops/action-gh-release@v1
54-
if: startsWith(github.ref, 'refs/tags/')
60+
uses: softprops/action-gh-release@v2 # 升级到 v2
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 显式传递 Token
5563
with:
56-
files: dist/*.whl
64+
files: |
65+
dist/*.whl
66+
LICENSE
5767
tag_name: ${{ github.ref }}
5868
name: Version ${{ env.VERSION }} - Stable Release
5969
body: |
@@ -64,4 +74,5 @@ jobs:
6474
### Build Details:
6575
- Built from tag: ${{ github.ref }}
6676
draft: false
67-
prerelease: false
77+
prerelease: false
78+
overwrite: true # 允许覆盖已存在的 Release

0 commit comments

Comments
 (0)