3030 FORCE_COLOR : 1
3131
3232jobs :
33- build :
33+ build-1-QEMU-emulated-wheels :
34+ name : aarch64 ${{ matrix.python-version }} ${{ matrix.spec }}
35+ runs-on : ubuntu-latest
36+ strategy :
37+ fail-fast : false
38+ matrix :
39+ python-version :
40+ - pp39
41+ - pp310
42+ - cp38
43+ - cp39
44+ - cp310
45+ - cp311
46+ - cp312
47+ spec :
48+ - manylinux2014
49+ - manylinux_2_28
50+ - musllinux
51+ exclude :
52+ - { python-version: pp39, spec: musllinux }
53+ - { python-version: pp310, spec: musllinux }
54+
55+ steps :
56+ - uses : actions/checkout@v4
57+ with :
58+ submodules : true
59+
60+ - uses : actions/setup-python@v5
61+ with :
62+ python-version : " 3.x"
63+
64+ # https://github.com/docker/setup-qemu-action
65+ - name : Set up QEMU
66+ uses : docker/setup-qemu-action@v3
67+
68+ - name : Install cibuildwheel
69+ run : |
70+ python3 -m pip install -r .ci/requirements-cibw.txt
71+
72+ - name : Build wheels
73+ run : |
74+ python3 -m cibuildwheel --output-dir wheelhouse
75+ env :
76+ # Build only the currently selected Linux architecture (so we can
77+ # parallelise for speed).
78+ CIBW_ARCHS : " aarch64"
79+ # Likewise, select only one Python version per job to speed this up.
80+ CIBW_BUILD : " ${{ matrix.python-version }}-${{ matrix.spec == 'musllinux' && 'musllinux' || 'manylinux' }}*"
81+ # Extra options for manylinux.
82+ CIBW_MANYLINUX_AARCH64_IMAGE : ${{ matrix.spec }}
83+ CIBW_MANYLINUX_PYPY_AARCH64_IMAGE : ${{ matrix.spec }}
84+
85+ - uses : actions/upload-artifact@v4
86+ with :
87+ name : dist-qemu-${{ matrix.python-version }}-${{ matrix.spec }}
88+ path : ./wheelhouse/*.whl
89+
90+ build-2-native-wheels :
3491 name : ${{ matrix.name }}
3592 runs-on : ${{ matrix.os }}
3693 strategy :
@@ -39,18 +96,18 @@ jobs:
3996 include :
4097 - name : " macOS x86_64"
4198 os : macos-latest
42- archs : x86_64
99+ cibw_arch : x86_64
43100 macosx_deployment_target : " 10.10"
44101 - name : " macOS arm64"
45102 os : macos-latest
46- archs : arm64
103+ cibw_arch : arm64
47104 macosx_deployment_target : " 11.0"
48105 - name : " manylinux2014 and musllinux x86_64"
49106 os : ubuntu-latest
50- archs : x86_64
107+ cibw_arch : x86_64
51108 - name : " manylinux_2_28 x86_64"
52109 os : ubuntu-latest
53- archs : x86_64
110+ cibw_arch : x86_64
54111 build : " *manylinux*"
55112 manylinux : " manylinux_2_28"
56113 steps :
@@ -62,12 +119,15 @@ jobs:
62119 with :
63120 python-version : " 3.x"
64121
65- - name : Build wheels
122+ - name : Install cibuildwheel
66123 run : |
67124 python3 -m pip install -r .ci/requirements-cibw.txt
125+
126+ - name : Build wheels
127+ run : |
68128 python3 -m cibuildwheel --output-dir wheelhouse
69129 env :
70- CIBW_ARCHS : ${{ matrix.archs }}
130+ CIBW_ARCHS : ${{ matrix.cibw_arch }}
71131 CIBW_BUILD : ${{ matrix.build }}
72132 CIBW_MANYLINUX_PYPY_X86_64_IMAGE : ${{ matrix.manylinux }}
73133 CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux }}
@@ -77,22 +137,19 @@ jobs:
77137
78138 - uses : actions/upload-artifact@v4
79139 with :
80- name : dist-${{ matrix.os }}-${{ matrix.archs }}${{ matrix.manylinux && format('-{0}', matrix.manylinux) }}
140+ name : dist-${{ matrix.os }}-${{ matrix.cibw_arch }}${{ matrix.manylinux && format('-{0}', matrix.manylinux) }}
81141 path : ./wheelhouse/*.whl
82142
83143 windows :
84- name : Windows ${{ matrix.arch }}
144+ name : Windows ${{ matrix.cibw_arch }}
85145 runs-on : windows-latest
86146 strategy :
87147 fail-fast : false
88148 matrix :
89149 include :
90- - arch : x86
91- cibw_arch : x86
92- - arch : x64
93- cibw_arch : AMD64
94- - arch : ARM64
95- cibw_arch : ARM64
150+ - cibw_arch : x86
151+ - cibw_arch : AMD64
152+ - cibw_arch : ARM64
96153 steps :
97154 - uses : actions/checkout@v4
98155
@@ -106,6 +163,10 @@ jobs:
106163 with :
107164 python-version : " 3.x"
108165
166+ - name : Install cibuildwheel
167+ run : |
168+ python.exe -m pip install -r .ci/requirements-cibw.txt
169+
109170 - name : Prepare for build
110171 run : |
111172 choco install nasm --no-progress
@@ -114,9 +175,7 @@ jobs:
114175 # Install extra test images
115176 xcopy /S /Y Tests\test-images\* Tests\images
116177
117- & python.exe -m pip install -r .ci/requirements-cibw.txt
118-
119- & python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.arch }}
178+ & python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.cibw_arch }}
120179 shell : pwsh
121180
122181 - name : Build wheels
@@ -143,6 +202,7 @@ jobs:
143202 CIBW_ARCHS : ${{ matrix.cibw_arch }}
144203 CIBW_BEFORE_ALL : " {package}\\ winbuild\\ build\\ build_dep_all.cmd"
145204 CIBW_CACHE_PATH : " C:\\ cibw"
205+ CIBW_SKIP : pp38-*
146206 CIBW_TEST_SKIP : " *-win_arm64"
147207 CIBW_TEST_COMMAND : ' docker run --rm
148208 -v {project}:C:\pillow
@@ -156,13 +216,13 @@ jobs:
156216 - name : Upload wheels
157217 uses : actions/upload-artifact@v4
158218 with :
159- name : dist-windows-${{ matrix.arch }}
219+ name : dist-windows-${{ matrix.cibw_arch }}
160220 path : ./wheelhouse/*.whl
161221
162222 - name : Upload fribidi.dll
163223 uses : actions/upload-artifact@v4
164224 with :
165- name : fribidi-windows-${{ matrix.arch }}
225+ name : fribidi-windows-${{ matrix.cibw_arch }}
166226 path : winbuild\build\bin\fribidi*
167227
168228 sdist :
@@ -186,7 +246,7 @@ jobs:
186246
187247 pypi-publish :
188248 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
189- needs : [build, windows, sdist]
249+ needs : [build-1-QEMU-emulated-wheels, build-2-native-wheels , windows, sdist]
190250 runs-on : ubuntu-latest
191251 name : Upload release to PyPI
192252 environment :
0 commit comments