-
Notifications
You must be signed in to change notification settings - Fork 282
294 lines (262 loc) · 8.02 KB
/
build-wheels.yml
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
name: build - check - upload
on:
push:
branches:
- main
release:
types: [published]
pull_request:
branches:
- '**'
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
build-wheels:
name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- name: macOS
matrix: macos
runs-on:
arm: [macOS, ARM64]
intel: [macos-13]
cibw-archs-macos:
arm: arm64
intel: x86_64
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
- name: Windows
matrix: windows
runs-on:
intel: [windows-latest]
python:
- major-dot-minor: '3.8'
cibw-build: 'cp38-*'
manylinux: manylinux_2_28
matrix: '3.8'
- major-dot-minor: '3.9'
cibw-build: 'cp39-*'
manylinux: manylinux_2_28
matrix: '3.9'
- major-dot-minor: '3.10'
cibw-build: 'cp310-*'
manylinux: manylinux_2_28
matrix: '3.10'
- major-dot-minor: '3.11'
cibw-build: 'cp311-*'
manylinux: manylinux_2_28
matrix: '3.11'
- major-dot-minor: '3.12'
cibw-build: 'cp312-*'
manylinux: manylinux_2_28
matrix: '3.12'
arch:
- name: ARM
matrix: arm
- name: Intel
matrix: intel
exclude:
# Only partial entries are required here by GitHub Actions so generally I
# only specify the `matrix:` entry. The super linter complains so for now
# all entries are included to avoid that. Reported at
# https://github.com/github/super-linter/issues/3016
- os:
name: Windows
matrix: windows
runs-on:
intel: [windows-latest]
arch:
name: ARM
matrix: arm
- os:
name: macOS
matrix: macos
runs-on:
arm: [macOS, ARM64]
intel: [macos-13]
python:
major-dot-minor: '3.8'
cibw-build: 'cp38-*'
matrix: '3.8'
arch:
name: ARM
matrix: arm
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Env
if: env.RUNNER_ARCH != 'ARM64'
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- name: Install pipx
run: |
pip install pipx
- name: Get Windows Bladebit Harvester Artifact
if: runner.os == 'Windows'
shell: bash
run: |
set -eo pipefail
set -x
.github/actions/fetch_bladebit_harvester.sh windows x86-64
- name: Build and test
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python.cibw-build }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux }}
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
run:
pipx run --spec='cibuildwheel==2.19.2' cibuildwheel --output-dir dist 2>&1
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os.name }}-${{ matrix.python.major-dot-minor }}-${{ matrix.arch.name }}
path: ./dist
build-sdist:
name: sdist - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- name: Build source distribution
run: |
pip install build
python -m build --sdist --outdir dist .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages-sdist-${{ matrix.os.name }}-${{ matrix.python.major-dot-minor }}-${{ matrix.arch.name }}
path: ./dist
check:
name: Check - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- name: flake8
run: |
pip install flake8
flake8 tests setup.py
- name: mypy
run: |
pip install mypy
mypy --config-file mypi.ini setup.py tests
upload:
name: Upload to PyPI - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
needs:
- build-wheels
- build-sdist
- check
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: packages-*
path: ./dist
- name: Publish distribution to PyPI
if: env.RELEASE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
- name: Publish distribution to Test PyPI
if: env.PRE_RELEASE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
skip-existing: true