@@ -14,11 +14,91 @@ concurrency:
1414
1515jobs :
1616 build_wheels :
17- name : Build wheels on ${{ matrix.os }}
17+ name : ${{ matrix.os }} ${{ matrix.arch }} py${{ matrix.python}} wheels
1818 runs-on : ${{ matrix.os }}
19+ continue-on-error : true
1920 strategy :
2021 matrix :
2122 # macos-13 is an intel runner, macos-14 is apple silicon
2223 os : [ubuntu-latest, windows-latest, macos-13, macos-14]
24+ arch : [native]
25+ python : ["*"]
26+ # Split aarch64 across jobs because it uses emulation (slow)
27+ include :
28+ - os : ubuntu-latest
29+ arch : i686
30+ python : " *"
31+ - os : ubuntu-latest
32+ arch : aarch64
33+ python : " 38"
34+ - os : ubuntu-latest
35+ arch : aarch64
36+ python : " 39"
37+ - os : ubuntu-latest
38+ arch : aarch64
39+ python : " 310"
40+ - os : ubuntu-latest
41+ arch : aarch64
42+ python : " 311"
43+ - os : ubuntu-latest
44+ arch : aarch64
45+ python : " 312"
2346 steps :
2447 - uses : actions/checkout@v4
48+ with :
49+ submodules : true
50+ # Linux emulation for aarch64 support
51+ # https://cibuildwheel.pypa.io/en/stable/faq/#emulation
52+ - uses : docker/setup-qemu-action@v3
53+ with :
54+ platforms : all
55+ if : runner.os == 'Linux' && matrix.arch == 'aarch64'
56+ 57+ env :
58+ CIBW_BUILDING : " true"
59+ CIBW_ARCHS : ${{ matrix.arch }} # simplest for now
60+ CIBW_BUILD : " {c,p}p${{ matrix.python }}-*"
61+ CIBW_SKIP : " {c,p}p3{6,7}-*"
62+ CIBW_TEST_COMMAND : " python -c \" import rtmixer; print(rtmixer.__version__)\" "
63+ # No portaudio on these platforms:
64+ CIBW_TEST_SKIP : " *_i686 *-musllinux_* *_aarch64"
65+ # To enable testing we'd have to bump up to the Almalinux 8-based image:
66+ # CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
67+ CIBW_BUILD_VERBOSITY : " 3"
68+ CIBW_BEFORE_TEST_LINUX : " bash {project}/tools/cibw_before_test_linux.sh"
69+ - uses : actions/upload-artifact@v4
70+ with :
71+ name : cibw-wheels-${{ matrix.os }}-${{ matrix.arch}}-${{ strategy.job-index }}
72+ path : ./wheelhouse/*.whl
73+
74+ # From https://cibuildwheel.pypa.io/en/stable/deliver-to-pypi/
75+ # and https://github.com/pypa/gh-action-pypi-publish?tab=readme-ov-file#trusted-publishing
76+ make_sdist :
77+ name : Make SDist
78+ runs-on : ubuntu-latest
79+ steps :
80+ - uses : actions/checkout@v4
81+ - run : pipx run build --sdist
82+ - uses : actions/upload-artifact@v4
83+ with :
84+ name : cibw-sdist
85+ path : dist/*.tar.gz
86+
87+ pypi-publish :
88+ name : Upload release to PyPI
89+ needs : [build_wheels, make_sdist]
90+ if : github.event_name == 'release' && github.event.action == 'published'
91+ environment :
92+ name : pypi
93+ url : https://pypi.org/p/rtmixer
94+ permissions :
95+ id-token : write
96+ runs-on : ubuntu-latest
97+ steps :
98+ - uses : actions/download-artifact@v4
99+ with :
100+ pattern : cibw-*
101+ path : dist
102+ merge-multiple : true
103+ - run : ls -al dist/*
104+ - uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments