Skip to content

Commit 2a95c22

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

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
name: Publish to PyPI
2-
3-
on:
4-
push:
5-
branches:
6-
- main # 只要 main 分支有新的 push 就觸發
7-
81
jobs:
92
build-n-publish:
10-
name: Build and publish to PyPI
3+
name: Build and publish to PyPI (Python ${{ matrix.python-version }})
114
runs-on: ubuntu-latest
125

6+
# 使用策略矩陣 (Matrix Strategy)
7+
strategy:
8+
matrix:
9+
python-version: ["3.9", "3.10", "3.11"]
10+
1311
permissions:
1412
id-token: write
1513
contents: read
1614

1715
steps:
1816
- uses: actions/checkout@v3
1917

20-
- name: Set up Python
18+
- name: Set up Python ${{ matrix.python-version }}
2119
uses: actions/setup-python@v4
2220
with:
23-
python-version: "3.10"
21+
python-version: ${{ matrix.python-version }}
2422

2523
- name: Install build dependencies
2624
run: |
@@ -31,4 +29,4 @@ jobs:
3129
run: python -m build
3230

3331
- name: Publish package to PyPI
34-
uses: pypa/gh-action-pypi-publish@release/v1
32+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)