@@ -2,43 +2,40 @@ name: Build and upload to PyPI
22
33on :
44 workflow_dispatch :
5- pull_request :
6- # push:
7- # branches:
8- # - main
9- release :
10- types :
11- - published
5+ push :
6+ tags :
7+ - v[0-9]+.[0-9]+.[0-9]+
8+
9+ permissions :
10+ contents : read
1211
1312jobs :
1413 build_wheels :
1514 name : Build wheels on ${{ matrix.os }}
1615 runs-on : ${{ matrix.os }}
1716 strategy :
1817 matrix :
19- os : [ubuntu-latest, windows-latest, macOS -latest]
18+ os : [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos -latest]
2019
2120 steps :
22- - uses : actions/checkout@v4
23- - name : Set up QEMU
24- if : runner.os == 'Linux'
25- uses : docker /setup-qemu-action@v1
21+ - uses : actions/checkout@v5
22+ with :
23+ persist-credentials : false
24+ - uses : actions /setup-python@v6
2625 with :
27- platforms : all
26+ python-version : " 3.12 "
2827 - name : Install cibuildwheel
29- run : python -m pip install cibuildwheel==2.16.5
28+ run : python -m pip install cibuildwheel==3.3.0
3029 - name : Build wheels
3130 run : python -m cibuildwheel --output-dir wheelhouse
3231 env :
33- CIBW_SKIP : " {cp27-*} "
32+ CIBW_SKIP : " *p38-macos* "
3433 CIBW_TEST_REQUIRES : pytest
3534 CIBW_TEST_COMMAND : " pytest {project}/test"
36- CIBW_ARCHS_MACOS : " x86_64 universal2 arm64"
37- CIBW_ARCHS_LINUX : " auto aarch64"
3835 - name : Show built files
3936 shell : bash
4037 run : ls -la wheelhouse
41- - uses : actions/upload-artifact@v4
38+ - uses : actions/upload-artifact@v5
4239 with :
4340 name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
4441 path : ./wheelhouse/*.whl
@@ -47,32 +44,33 @@ jobs:
4744 name : Build source distribution
4845 runs-on : ubuntu-latest
4946 steps :
50- - uses : actions/checkout@v4
47+ - uses : actions/checkout@v5
48+ with :
49+ persist-credentials : false
5150
5251 - name : Build sdist
5352 run : pipx run build --sdist
5453
55- - uses : actions/upload-artifact@v4
54+ - uses : actions/upload-artifact@v5
5655 with :
5756 name : cibw-sdist
5857 path : dist/*.tar.gz
5958
60- upload_pypi :
59+ pypi-publish :
6160 needs : [build_wheels, build_sdist]
6261 runs-on : ubuntu-latest
63- environment : pypi
62+ environment :
63+ name : pypi
64+ url : https://pypi.org/p/ilt-editdistance
6465 permissions :
6566 id-token : write
66- if : github.event_name == 'release' && github.event.action == 'published'
67- # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
68- # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
67+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
6968 steps :
70- - uses : actions/download-artifact@v4
69+ - uses : actions/download-artifact@v5
7170 with :
7271 # unpacks all CIBW artifacts into dist/
7372 pattern : cibw-*
7473 path : dist
7574 merge-multiple : true
76- - uses : pypa/gh-action-pypi-publish@release/v1
77- # with:
78- # To test: repository-url: https://test.pypi.org/legacy/
75+ - name : Publish package distributions to TestPyPI
76+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments