1919 description : " target os to build for: linux,macos,windows"
2020 type : string
2121 required : false
22- default : " linux,macos, windows"
22+ default : " linux,macos-x86,macos-arm, windows,linux-aarch64 "
2323
2424jobs :
2525 prepare-matrix :
@@ -33,19 +33,27 @@ jobs:
3333 run : |
3434 echo -n "[" > /tmp/matrix.json
3535 was_added=""
36- for os in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
36+ for target in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
3737 do
38- if [[ "${os }" == "linux" ]]; then
38+ if [[ "${target }" == "linux" ]]; then
3939 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
40- echo -n '{"os":"ubuntu-20.04","platform":"x86_64"},{"os":"ubuntu-20.04","platform":"PyPy"},{"os":"ubuntu-24.04","platform":"aarch64 "}' >> /tmp/matrix.json
40+ echo -n '{"os":"ubuntu-20.04", "target": "linux "}' >> /tmp/matrix.json
4141 was_added=1
42- elif [[ "${os }" == "windows " ]]; then
42+ elif [[ "${target }" == "linux-aarch64 " ]]; then
4343 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
44- echo -n '{"os":"windows-2022","platform":"win64"},{"os":"windows-2022","platform":"PyPy "}' >> /tmp/matrix.json
44+ echo -n '{"os":"ubuntu-20.04", "target": "linux-aarch64 "}' >> /tmp/matrix.json
4545 was_added=1
46- elif [[ "${os }" == "macos " ]]; then
46+ elif [[ "${target }" == "windows " ]]; then
4747 [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
48- echo -n '{"os":"macos-14","platform":"all"},{"os":"macos-13","platform":"all"},{"os":"macos-14","platform":"PyPy"}' >> /tmp/matrix.json
48+ echo -n '{"os":"windows-2022", "target": "windows"}' >> /tmp/matrix.json
49+ was_added=1
50+ elif [[ "${target}" == "macos-x86" ]]; then
51+ [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
52+ echo -n '{"os":"macos-13", "target": "macos-x86"}' >> /tmp/matrix.json
53+ was_added=1
54+ elif [[ "${target}" == "macos-arm" ]]; then
55+ [ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
56+ echo -n '{"os":"macos-14", "target": "macos-arm"}' >> /tmp/matrix.json
4957 was_added=1
5058 fi
5159 done
5462 echo "matrix=$(cat /tmp/matrix.json)" >> $GITHUB_OUTPUT
5563
5664 build-wheels :
57- name : Build wheels ${{ matrix.os }} ( ${{ matrix.platform }})
65+ name : Build wheels for ${{ matrix.target }} on ${{ matrix.os }}
5866 runs-on : ${{ matrix.os }}
5967 needs : prepare-matrix
6068 strategy :
8694 choco install openssl --version=3.4.1 -f -y --no-progress
8795
8896 - name : Set up QEMU
89- if : runner.os == 'Linux' && matrix.platform == 'aarch64'
97+ if : matrix.target == 'linux- aarch64'
9098 uses : docker/setup-qemu-action@v3
9199 with :
92100 platforms : all
@@ -119,28 +127,19 @@ jobs:
119127 echo "Enforcing target deployment for 14.0"
120128 fi
121129
122- - name : Set build target
123- shell : bash
124- run : |
125- if [[ "${{ matrix.platform }}" == "PyPy" ]]; then
126- echo "CIBW_BUILD=pp*" >> $GITHUB_ENV;
127- else
128- echo "CIBW_BUILD=cp*" >> $GITHUB_ENV;
129- fi
130-
131130 - name : Build wheels
132- if : runner.os != 'Linux' || matrix.platform != 'aarch64'
131+ if : matrix.target != 'linux- aarch64'
133132 run : |
134133 python3 -m cibuildwheel --output-dir wheelhouse
135134
136- - name : Build wheels
137- if : runner.os == 'Linux' && matrix.platform == 'aarch64'
135+ - name : Build wheels for linux aarch64
136+ if : matrix.target == 'linux- aarch64'
138137 run : |
139- python -m cibuildwheel --archs aarch64 --output-dir wheelhouse
138+ CIBW_BUILD='cp3*' python -m cibuildwheel --archs aarch64 --output-dir wheelhouse
140139
141140 - uses : actions/upload-artifact@v4
142141 with :
143- name : wheels-${{ runner.os }}-${{ matrix.platform }}
142+ name : wheels-${{ matrix.target }}-${{ matrix.os }}
144143 path : ./wheelhouse/*.whl
145144
146145 build-sdist :
0 commit comments