@@ -3,56 +3,73 @@ name: samplerate
33on : [push, pull_request]
44
55jobs :
6- build :
6+ build_wheels :
7+ name : Build wheels on ${{ matrix.os }}
78 runs-on : ${{ matrix.os }}
89 strategy :
910 fail-fast : false
10- max-parallel : 12
1111 matrix :
12- os : [ubuntu-latest, macos-latest, windows-latest]
13- python-version : [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
12+ include :
13+ # Linux x86_64
14+ - os : ubuntu-latest
15+ arch : x86_64
16+ cibw_archs : " x86_64"
17+ # Linux ARM64 (native, no QEMU)
18+ - os : ubuntu-24.04-arm
19+ arch : aarch64
20+ cibw_archs : " aarch64"
21+ # Windows AMD64
22+ - os : windows-latest
23+ arch : AMD64
24+ cibw_archs : " AMD64"
25+ # macOS x86_64 (Intel)
26+ - os : macos-15-intel
27+ macoosx_deployment_target : " 10.15"
28+ arch : x86_64
29+ cibw_archs : " x86_64"
30+ # macOS ARM64 (Apple Silicon)
31+ - os : macos-latest
32+ macoosx_deployment_target : " 11.0"
33+ arch : arm64
34+ cibw_archs : " arm64"
1435 steps :
15- - uses : actions/checkout@v5
16- with :
17- submodules : recursive
18- # - name: Checkout submodules
19- # shell: bash
20- # run: |
21- # auth_header="$(git config --local --get http.https://github.com/.extraheader)"
22- # git submodule sync --recursive
23- # git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
24- - name : Install uv
25- uses : astral-sh/setup-uv@v7
26- - name : Sync dependencies with uv
27- run : |
28- uv sync --locked --all-groups --python ${{ matrix.python-version }}
29- - name : Build sdist
30- if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
31- run : |
32- uv build --sdist
33- - name : Upload sdist
34- if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
35- uses : actions/upload-artifact@v5
36- with :
37- name : dist-python-samplerate-ledfx
38- path : dist/*.tar.gz
39- if-no-files-found : error
40- - name : Build wheel for ${{ matrix.os }} Python ${{ matrix.python-version }}
41- run : |
42- uv build --wheel
43- - name : Test with pytest
44- run : |
45- uv run pytest
36+ - uses : actions/checkout@v5
37+ with :
38+ submodules : recursive
4639
47- - name : Upload wheel
48- uses : actions/upload-artifact@v5
49- with :
50- name : dist-python-samplerate-ledfx-${{ matrix.os }}-py${{ matrix.python-version }}
51- path : dist/*.whl
52- if-no-files-found : error
40+ - name : Build wheels
41+ uses : pypa/cibuildwheel@v3.3.0
42+ env :
43+ CIBW_BUILD : cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*
44+ CIBW_SKIP : " *-musllinux_*"
45+
46+ - uses : actions/upload-artifact@v5
47+ with :
48+ name : cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}
49+ path : ./wheelhouse/*.whl
50+
51+ build_sdist :
52+ name : Build source distribution
53+ runs-on : ubuntu-latest
54+ steps :
55+ - uses : actions/checkout@v5
56+ with :
57+ submodules : recursive
58+
59+ - name : Install uv
60+ uses : astral-sh/setup-uv@v7
61+
62+ - name : Build sdist
63+ run : uv build --sdist
64+
65+ - uses : actions/upload-artifact@v5
66+ with :
67+ name : cibw-sdist
68+ path : dist/*.tar.gz
69+ if-no-files-found : error
5370
5471 publish :
55- needs : build
72+ needs : [build_wheels, build_sdist]
5673 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
5774 runs-on : ubuntu-latest
5875 environment :
@@ -61,16 +78,18 @@ jobs:
6178 permissions :
6279 id-token : write # Required for trusted publishing
6380 steps :
64- - name : Install uv
65- uses : astral-sh/setup-uv@v7
66- - name : Download all artifacts
67- uses : actions/download-artifact@v5
68- with :
69- path : dist
70- pattern : dist-*
71- merge-multiple : true
72- - name : Display structure of downloaded files
73- run : ls -R dist
74- - name : Publish to PyPI
75- run : |
76- uv publish --trusted-publishing always
81+ - name : Install uv
82+ uses : astral-sh/setup-uv@v7
83+
84+ - name : Download all artifacts
85+ uses : actions/download-artifact@v5
86+ with :
87+ path : dist
88+ pattern : cibw-*
89+ merge-multiple : true
90+
91+ - name : Display structure of downloaded files
92+ run : ls -R dist
93+
94+ - name : Publish to PyPI
95+ run : uv publish --trusted-publishing always
0 commit comments