@@ -15,71 +15,80 @@ jobs:
1515 CIBW_ARCHS_LINUX : ${{ matrix.arch }}
1616 CIBW_ARCHS_MACOS : " x86_64 arm64"
1717 CIBW_ENABLE : cpython-freethreading
18+
1819 strategy :
1920 fail-fast : false
2021 matrix :
2122 include :
22- # Linux x86_64 builds
23+ # Linux x86_64 (build wheels)
2324 - os : ubuntu-latest
2425 arch : x86_64
2526 artifact_name : " linux-x86_64"
27+ python-version : " 3.x"
2628
27- # Linux x86_64 with numpy 1.23
29+ # Linux x86_64 (test numpy 1.26)
2830 - os : ubuntu-latest
2931 arch : x86_64
30- artifact_name : " linux-x86_64_numpy1_23"
32+ artifact_name : " linux-x86_64_numpy1_26"
33+ python-version : " 3.12"
3134 numpy-version : " 1.26"
3235
33- # Linux ARM64 builds (native runners )
36+ # Linux ARM64 (build wheels )
3437 - os : ubuntu-24.04-arm
3538 arch : aarch64
3639 artifact_name : " linux-aarch64"
40+ python-version : " 3.x"
3741
38- # Windows builds
42+ # Windows (build wheels)
3943 - os : windows-latest
4044 arch : x86_64
4145 artifact_name : " windows-x86_64"
46+ python-version : " 3.x"
4247
43- # macOS builds (universal2 )
48+ # macOS (build wheels )
4449 - os : macos-latest
4550 arch : x86_64
4651 artifact_name : " macos-universal2"
52+ python-version : " 3.x"
53+
4754 steps :
4855 - uses : actions/checkout@v3
4956
5057 - uses : actions/setup-python@v3
5158 name : Install Python
5259 with :
53- python-version : ' 3.12 '
60+ python-version : ${{ matrix.python-version }}
5461
55- - name : Install specific numpy version
62+ # Run tests with specific numpy version
63+ - name : Install and test with specific numpy version
5664 if : matrix.numpy-version
57- run : pip install "numpy==${{ matrix.numpy-version }}.*"
58-
59- - name : Local Build
60- run : pip install -e .
61-
62- - name : Test
6365 run : |
66+ pip install "numpy==${{ matrix.numpy-version }}.*"
67+ pip install -e .
6468 pip install pytest
6569 python -m pytest
6670
71+ # Build wheels only if:
72+ # - No numpy version is specified
73+ # - Python version is "3.x"
6774 - name : Build wheels
75+ if : ${{ !matrix.numpy-version }}
6876 uses : pypa/cibuildwheel@v3.1.3
6977
7078 - name : Make sdist
71- if : ${{ matrix.os == 'windows-latest' }}
79+ if : ${{ matrix.os == 'windows-latest' && !matrix.numpy-version }}
7280 run : |
7381 python -m pip install build
7482 python -m build --sdist --outdir wheelhouse .
7583
7684 - uses : actions/upload-artifact@v4
85+ if : ${{ !matrix.numpy-version }}
7786 with :
7887 name : ${{ matrix.artifact_name }}
7988 path : ./wheelhouse/*
8089
8190 - name : Upload to GitHub Release
91+ if : startsWith(github.ref, 'refs/tags/') && !matrix.numpy-version
8292 uses : softprops/action-gh-release@v1
83- if : startsWith(github.ref, 'refs/tags/')
8493 with :
8594 files : wheelhouse/*
0 commit comments