Skip to content

Commit e79e958

Browse files
author
ericoder960803
committed
fix and test
1 parent 2a95c22 commit e79e958

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

‎.github/workflows/python-publish.yml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
18
jobs:
29
build-n-publish:
3-
name: Build and publish to PyPI (Python ${{ matrix.python-version }})
10+
name: Build and publish (Python ${{ matrix.python-version }})
411
runs-on: ubuntu-latest
512

6-
# 使用策略矩陣 (Matrix Strategy)
13+
# 設定矩陣策略
714
strategy:
815
matrix:
916
python-version: ["3.9", "3.10", "3.11"]
17+
# 如果其中一個版本失敗,其他版本繼續執行
18+
fail-fast: false
1019

1120
permissions:
1221
id-token: write
@@ -29,4 +38,8 @@ jobs:
2938
run: python -m build
3039

3140
- name: Publish package to PyPI
32-
uses: pypa/gh-action-pypi-publish@release/v1
41+
uses: pypa/gh-action-pypi-publish@release/v1
42+
with:
43+
# 關鍵:允許上傳重複的版本檔案(因為多個 Job 會推同一個版號)
44+
# 這樣 3.9 傳完後,3.10 傳的時候才不會因為版號相同而被 PyPI 擋掉
45+
skip-existing: true

0 commit comments

Comments
 (0)