-
-
Notifications
You must be signed in to change notification settings - Fork 63
217 lines (191 loc) · 7.11 KB
/
wheels.yml
File metadata and controls
217 lines (191 loc) · 7.11 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
name: Python package build and publish
on:
release:
types: [published]
workflow_dispatch: {}
repository_dispatch: {}
pull_request:
push:
branches:
- main
concurrency:
group: wheels-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: ${{ matrix.image }} wheels
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- image: manylinux_2_28_x86_64
build: "*manylinux*"
- image: musllinux_1_2_x86_64
build: "*musllinux*"
steps:
- uses: actions/checkout@v5
if: ${{ github.event_name != 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
- uses: actions/checkout@v5
if: ${{ github.event_name == 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
ref: ${{ github.event.client_payload.ref }}
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.image }}
verbose: 2
# Used to host cibuildwheel
- uses: actions/setup-python@v6
with:
python-version: "3.11 - 3.13"
update-environment: false
- name: install cibuildwheel
run: |
python -m pip install -r cibw-requirements.txt
- name: Build wheels
run: python -m cibuildwheel . --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.image }}
CIBW_MUSLLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.image }}
# configure cibuildwheel to build native 64-bit archs ('auto64'), and some
# emulated ones
# Linux arm64 wheels are built on circleci
CIBW_ARCHS_LINUX: auto64 # ppc64le s390x
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/bin:/usr/lib/ccache:/usr/lib/ccache/bin:/usr/lib64/ccache:$PATH CCACHE_DIR=/host${{ github.workspace }}/.ccache CCACHE_CONFIGPATH=/host/home/runner/.config/ccache/ccache.conf SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.image }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
if: ${{ github.event_name != 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
- uses: actions/checkout@v5
if: ${{ github.event_name == 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
ref: ${{ github.event.client_payload.ref }}
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*.tar.gz
build_wheels_macos:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14+ is apple silicon
os: [macos-13, macos-latest]
steps:
- uses: actions/checkout@v5
if: ${{ github.event_name != 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
- uses: actions/checkout@v5
if: ${{ github.event_name == 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
ref: ${{ github.event.client_payload.ref }}
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}
verbose: 2
# Used to host cibuildwheel
- uses: actions/setup-python@v6
with:
python-version: "3.11 - 3.13"
update-environment: false
- name: install cibuildwheel
run: |
python -m pip install -r cibw-requirements.txt
- name: Build wheels
run: python -m cibuildwheel . --output-dir wheelhouse
env:
CIBW_ENVIRONMENT_MACOS: PATH=/usr/local/opt/ccache/libexec:/opt/homebrew/opt/ccache/libexec:$PATH SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_wheels_riscv64:
name: riscv64 ${{ matrix.target }} wheels
runs-on: ubuntu-latest
strategy:
matrix:
target: [ 'many', 'musl' ]
steps:
- uses: actions/checkout@v5
if: ${{ github.event_name != 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
- uses: actions/checkout@v5
if: ${{ github.event_name == 'repository_dispatch' }}
with:
fetch-depth: 0 # slow, but gets all the tags
ref: ${{ github.event.client_payload.ref }}
- name: musllinux target
if: ${{ matrix.target == 'musl' }}
run: |
echo "CIBW_BUILD=*musllinux*" >> "$GITHUB_ENV"
- name: manylinux target
if: ${{ matrix.target == 'many' }}
run: |
echo "CIBW_BUILD=*manylinux*" >> "$GITHUB_ENV"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.target }}
verbose: 2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
# This should be temporary
# xref https://github.com/docker/setup-qemu-action/issues/188
# xref https://github.com/tonistiigi/binfmt/issues/215
image: tonistiigi/binfmt:qemu-v8.1.5
id: qemu
# Used to host cibuildwheel
- uses: actions/setup-python@v6
with:
python-version: "3.11 - 3.13"
update-environment: false
- name: install cibuildwheel
run: |
python -m pip install -r cibw-requirements.txt
- name: Build wheels
run: python -m cibuildwheel . --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: riscv64
CIBW_ENVIRONMENT_LINUX: PATH=/usr/local/bin:/usr/lib/ccache:/usr/lib/ccache/bin:/usr/lib64/ccache:$PATH CCACHE_DIR=/host${{ github.workspace }}/.ccache CCACHE_CONFIGPATH=/host/home/runner/.config/ccache/ccache.conf SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH="$(pwd)/mypy-stubs"
- uses: actions/upload-artifact@v4
with:
name: artifact-riscv64-${{ matrix.target }}
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_wheels, build_sdist, build_wheels_macos, build_wheels_riscv64]
runs-on: ubuntu-24.04
environment: pypi
permissions:
id-token: write
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'repository_dispatch' && github.event.client_payload.publish_wheel == true)
steps:
- uses: actions/download-artifact@v5
with:
# unpacks default artifact into dist/
pattern: artifact-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true