1- name : build and publish
1+ name : Build and publish pyModeS
22
33on :
44 release :
5- types :
6- - published
5+ types : [published]
76 workflow_dispatch :
87
8+ env :
9+ CIBW_BUILD : cp310* cp311* cp312* cp313*
10+ CIBW_ARCHS_WINDOWS : auto64
11+ CIBW_ARCHS_LINUX : auto64 aarch64
12+ CIBW_ARCHS_MACOS : universal2
13+ # CIBW_ARCHS_MACOS: auto universal2
14+ CIBW_TEST_SKIP : " *universal2:arm64"
15+
916jobs :
10- deploy :
11- runs-on : ubuntu-latest
17+ build_wheels :
18+ name : Build wheels on ${{ matrix.os }}
19+ runs-on : ${{ matrix.os }}
20+ strategy :
21+ matrix :
22+ # macos-13 is an intel runner, macos-14 is apple silicon
23+ os : [ubuntu-latest, windows-latest, macos-14]
24+
1225 steps :
1326 - uses : actions/checkout@v4
1427
15- - name : Install uv
16- uses : astral-sh/setup-uv@v3
28+ - name : Set up QEMU
29+ if : runner.os == 'Linux' && runner.arch == 'X64'
30+ uses : docker/setup-qemu-action@v3
1731 with :
18- enable-cache : true
32+ platforms : all
33+
34+ - name : Build wheels
35+ uses : pypa/cibuildwheel@v2.22.0
36+
37+ - uses : actions/upload-artifact@v4
38+ with :
39+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
40+ path : ./wheelhouse/*.whl
41+
42+ build_sdist :
43+ name : Build source distribution
44+ runs-on : ubuntu-latest
45+ steps :
46+ - uses : actions/checkout@v4
47+
48+ - name : Build sdist
49+ run : pipx run build --sdist
1950
20- - name : Set up Python
21- uses : actions/setup-python@v5
51+ - uses : actions/upload-artifact@v4
2252 with :
23- python-version : " 3.11"
53+ name : cibw-sdist
54+ path : dist/*.tar.gz
2455
25- - name : Build packages
26- run : |
27- uvx --with cython --with setuptools hatchling build
56+ upload_pypi :
57+ needs : [build_wheels, build_sdist]
58+ runs-on : ubuntu-latest
59+ environment : pypi
60+ permissions :
61+ id-token : write
62+ if : github.event_name == 'release' && github.event.action == 'published'
63+ steps :
64+ - uses : actions/download-artifact@v4
65+ with :
66+ # unpacks all CIBW artifacts into dist/
67+ pattern : cibw-*
68+ path : dist
69+ merge-multiple : true
2870
29- - name : Publish a Python distribution to PyPI
30- uses : pypa/gh-action-pypi-publish@release/v1
71+ - uses : pypa/gh-action-pypi-publish@release/v1
3172 with :
3273 user : __token__
33- password : ${{ secrets.PYPI_API_TOKEN_PYMODES }}
74+ password : ${{ secrets.PYPI_API_TOKEN_PYMODES }}
0 commit comments