-
Notifications
You must be signed in to change notification settings - Fork 3
273 lines (236 loc) · 9.19 KB
/
wheels.yml
File metadata and controls
273 lines (236 loc) · 9.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Wheel build
on:
release:
types: [created]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: "42 3 * * 4"
push:
paths:
- .github/workflows/wheels.yml
- requirements.txt
- pyproject.toml
- MANIFEST.in
- Makefile
- setup.py
pull_request:
types: [opened, synchronize, reopened]
paths:
- .github/workflows/wheels.yml
- requirements.txt
- pyproject.toml
- MANIFEST.in
- Makefile
- setup.py
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
sdist:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.x"
- name: Install Python dependencies
run: python -m pip install -U pip setuptools wheel && python -m pip install -U -r requirements.txt
- name: Build sdist
run: make sdist
- name: Upload sdist
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sdist
path: dist/*.tar.gz
generate-wheels-matrix:
# Create a matrix of all architectures & versions to build.
# This enables the next step to run cibuildwheel in parallel.
# From https://iscinumpy.dev/post/cibuildwheel-2-10-0/#only-210
name: Generate wheels matrix
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- name: Check out project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==3.4.1
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux --archs x86_64 \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
| sed -e '/aarch64\|armv7l/s|ubuntu-latest|ubuntu-24.04-arm|' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 \
| jq -nRc '{"only": inputs, "os": "windows-2022"}' \
&& cibuildwheel --print-build-identifiers --platform windows --archs ARM64 \
| jq -nRc '{"only": inputs, "os": "windows-11-arm"}'
} | jq -sc
)
echo "include=$MATRIX"
echo "include=$MATRIX" >> $GITHUB_OUTPUT
env:
# Skip abi3 targets here:
CIBW_SKIP: "cp3{9,1?}-win_arm64 cp3{9,1?}-win32 cp3{9,1?}-macosx_x86_64 pp* *musllinux*"
build_wheels:
name: Build ${{ matrix.only }}
needs: generate-wheels-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
steps:
- name: Check out project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
only: ${{ matrix.only }}
- name: Build faster Linux wheels
# also build wheels with the most recent manylinux images and gcc
if: runner.os == 'Linux' && !contains(matrix.only, 'i686')
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_34 # manylinux_2_39 ?
CIBW_MANYLINUX_ARMV7L_IMAGE: manylinux_2_35
CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_34
CIBW_MANYLINUX_S390X_IMAGE: manylinux_2_34
CIBW_MANYLINUX_RISCV64_IMAGE: manylinux_2_39
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_34
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: manylinux_2_34
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2
CIBW_MUSLLINUX_PPC64LE_IMAGE: musllinux_1_2
CIBW_MUSLLINUX_S390X_IMAGE: musllinux_1_2
with:
only: ${{ matrix.only }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ./wheelhouse/*.whl
name: wheels-${{ matrix.only }}
build_limited_api_wheels:
name: Build ${{ matrix.target }} Stable ABI ${{ matrix.lapiversion }} wheels
if: >-
github.event_name == 'push' ||
github.event_name == 'release' ||
(github.event_name == 'schedule' && github.repository == 'cython/cython') ||
github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
target:
# Smaller set of platforms that we only provide Stable ABI wheels for:
- 'musllinux_x86_64'
- 'musllinux_aarch64'
- 'manylinux_i686'
- 'musllinux_i686'
- 'manylinux_ppc64le'
- 'musllinux_ppc64le'
- 'manylinux_riscv64'
- 'musllinux_riscv64'
- 'manylinux_armv7l'
- 'musllinux_armv7l'
- 'macosx_x86_64'
- 'win32'
- 'win_arm64'
lapiversion:
- "3.9"
- "3.12"
runs-on: ${{
contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' ||
contains(matrix.target, 'armv7l') && 'ubuntu-24.04-arm' ||
contains(matrix.target, 'win_arm64') && 'windows-11-arm' ||
contains(matrix.target, 'win32') && 'windows-latest' ||
contains(matrix.target, 'macosx') && 'macos-latest' ||
'ubuntu-latest'
}}
steps:
- name: Check out project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
with:
platforms: all
- name: Setup Visual Studio on Windows
if: startsWith(matrix.target, 'win')
uses: TheMrMilchmann/setup-msvc-dev@79dac248aac9d0059f86eae9d8b5bfab4e95e97c # v4.0.0
with:
arch: ${{ matrix.target == 'win32' && 'x86' || matrix.target == 'win_arm64' && 'arm64' || matrix.target == 'win_amd64' && 'amd64' || '' }}
- name: Build wheels
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
env:
CIBW_BUILD: "*${{ matrix.target }}"
CIBW_SKIP: "cp31*t-* pp3*"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ matrix.lapiversion }}"
QUICKTIONS_LIMITED_API: "${{ matrix.lapiversion }}"
- name: Check wheel
run: |
python -m pip install twine
python -m twine check ./wheelhouse/*.whl
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Stable-ABI-${{ matrix.target }}-${{ matrix.lapiversion }}
path: ./wheelhouse/*.whl
merge_wheels:
name: Merge wheel archives
needs: [build_wheels, build_limited_api_wheels]
runs-on: ubuntu-latest
steps:
- name: Merge wheels
uses: actions/upload-artifact/merge@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: all_wheels
pattern: wheels-*
delete-merged: true
compression-level: 9
upload_release_assets:
name: Upload packages
needs: [ sdist, merge_wheels ]
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
permissions:
contents: write
steps:
- name: Check out project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download files
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ./dist_downloads
merge-multiple: true
- name: List downloaded artifacts
run: ls -la ./dist_downloads
- name: Deduplicate wheels
run: python3 dedup_wheels.py -d ./dist_downloads
- name: Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
files: ./dist_downloads/*