@@ -3,56 +3,75 @@ 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+ with :
46+ extras : uv
47+
48+ - uses : actions/upload-artifact@v5
49+ with :
50+ name : cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}
51+ path : ./wheelhouse/*.whl
52+
53+ build_sdist :
54+ name : Build source distribution
55+ runs-on : ubuntu-latest
56+ steps :
57+ - uses : actions/checkout@v5
58+ with :
59+ submodules : recursive
60+
61+ - name : Install uv
62+ uses : astral-sh/setup-uv@v7
63+
64+ - name : Build sdist
65+ run : uv build --sdist
66+
67+ - uses : actions/upload-artifact@v5
68+ with :
69+ name : cibw-sdist
70+ path : dist/*.tar.gz
71+ if-no-files-found : error
5372
5473 publish :
55- needs : build
74+ needs : [build_wheels, build_sdist]
5675 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
5776 runs-on : ubuntu-latest
5877 environment :
@@ -61,16 +80,18 @@ jobs:
6180 permissions :
6281 id-token : write # Required for trusted publishing
6382 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
83+ - name : Install uv
84+ uses : astral-sh/setup-uv@v7
85+
86+ - name : Download all artifacts
87+ uses : actions/download-artifact@v5
88+ with :
89+ path : dist
90+ pattern : cibw-*
91+ merge-multiple : true
92+
93+ - name : Display structure of downloaded files
94+ run : ls -R dist
95+
96+ - name : Publish to PyPI
97+ run : uv publish --trusted-publishing always
0 commit comments