33 push :
44 branches :
55 - default
6- tags :
7- - v*
6+ # To simplify the release process, the publishing is triggered on tag.
7+ # We should make sure to only push tags for new releases.
8+ # If we start using tags for non-release purposes,
9+ # this needs to be updated.
10+ #
11+ # We need to explicitly configure an expression that matches anything.
12+ tags : [ "**" ]
813 pull_request :
914
15+
16+ defaults :
17+ run :
18+ # Use bash on Windows for consistency.
19+ shell : bash
20+
21+
1022jobs :
1123 build_wheels :
1224 name : Build wheels on ${{ matrix.os }}
1325 runs-on : ${{ matrix.os }}
1426 strategy :
27+ fail-fast : false
1528 matrix :
16- os : [ubuntu-20.04 , windows-latest, macos-latest]
29+ os : [ubuntu-latest , windows-latest, macos-latest]
1730
1831 steps :
19- - uses : actions/checkout@v2
32+ - uses : actions/checkout@v4
2033
21- - uses : actions/setup-python@v2
34+ - uses : actions/setup-python@v4
2235 name : Install Python
2336 with :
24- python-version : ' 3.9 '
37+ python-version : ' 3.14 '
2538
26- - name : Install cibuildwheel
39+ - name : Install deps
2740 run : |
28- python -m pip install cibuildwheel==2.1.1
41+ python -m pip install cibuildwheel==3. 2.1 abi3audit==0.0.22
2942
3043 - name : Build wheels
3144 run : |
3245 python -m cibuildwheel --output-dir wheelhouse
3346
34- - uses : actions/upload-artifact@v2
47+ - name : Check files
48+ run : ls -al wheelhouse/
49+
50+ - name : Audit ABI3 wheels
51+ run : |
52+ abi3audit -vsS wheelhouse/*abi3*.whl
53+
54+ - uses : actions/upload-artifact@v4
3555 with :
56+ name : artifact-wheels-${{ matrix.os }}
3657 path : ./wheelhouse/*.whl
3758
3859 build_sdist :
3960 name : Build source distribution
4061 runs-on : ubuntu-latest
4162 steps :
42- - uses : actions/checkout@v2
63+ - uses : actions/checkout@v4
4364
44- - uses : actions/setup-python@v2
65+ - uses : actions/setup-python@v4
4566 name : Install Python
4667 with :
4768 python-version : ' 3.9'
@@ -53,25 +74,28 @@ jobs:
5374 - name : Build sdist
5475 run : python -m build --sdist
5576
56- - uses : actions/upload-artifact@v2
77+ - uses : actions/upload-artifact@v4
5778 with :
79+ name : artifact-sdist
5880 path : dist/*.tar.gz
5981
6082 upload_pypi :
6183 needs : [build_wheels, build_sdist]
6284 runs-on : ubuntu-latest
63- # upload to PyPI on every tag starting with 'v'
64- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
65- # alternatively, to publish when a GitHub Release is created, use the following rule:
66- # if: github.event_name == 'release' && github.event.action == 'published'
85+ permissions :
86+ # IMPORTANT: this permission is mandatory for trusted publishing
87+ id-token : write
6788 steps :
68- - uses : actions/download-artifact@v2
89+ - uses : actions/download-artifact@v4
6990 with :
70- name : artifact
91+ pattern : artifact-*
92+ merge-multiple : true
7193 path : dist
7294
73- - uses : pypa/gh-action-pypi-publish@master
74- with :
75- user : __token__
76- password : ${{ secrets.pypi_password }}
77- # To test: repository_url: https://test.pypi.org/legacy/
95+ - name : Check files
96+ run : ls -al dist/
97+
98+ - name : Publish to PyPI - on tag
99+ # Skip upload to PyPI if we don't have a tag
100+ if : startsWith(github.ref, 'refs/tags/')
101+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments