File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Publish to PyPI
2-
3- on :
4- push :
5- branches :
6- - main # 只要 main 分支有新的 push 就觸發
7-
81jobs :
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 : |
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
You can’t perform that action at this time.
0 commit comments