-
Notifications
You must be signed in to change notification settings - Fork 25
506 lines (425 loc) · 13.3 KB
/
dist.yml
File metadata and controls
506 lines (425 loc) · 13.3 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
---
name: dist
on:
pull_request:
push:
branches:
- main
- '2027'
tags:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake-local"
SCCACHE_WEBDAV_KEY_PREFIX: "sccache-robotpy"
jobs:
# This job limits concurrency on the default branch
# - we want it to run so it can populate ccache, but we typically
# don't care about when it completes, so limit its concurrency
# to stop eating up valuable + slow Windows/macOS runners
setup_concurrency:
runs-on: ubuntu-latest
outputs:
max-parallel: ${{ steps.max-parallel.outputs.p }}
steps:
- name: Setup concurrency
shell: bash
id: max-parallel
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "PARALLEL=1"
echo "p={\"v\": 1}" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref_name }}" == "2027" ]]; then
echo "PARALLEL=1"
echo "p={\"v\": 1}" >> $GITHUB_OUTPUT
else
echo "PARALLEL=10000"
echo "p={\"v\": 10000}" >> $GITHUB_OUTPUT
fi
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Check pyproject / rdev synchronization
shell: bash
run: |
./rdev.sh ci check-pyproject
- name: Check git tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
shell: bash
run: |
./rdev.sh ci check-tag
#
# Build pure wheels first
#
build-pure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Build + test wheels
shell: bash
run: |
./rdev.sh ci build-pure-wheels
- uses: actions/upload-artifact@v4
with:
name: "pypi-pure"
path: dist
#
# Build other wheels next (OS-specific, not python specific)
#
build-other:
runs-on: ${{ matrix.os }}
needs: [setup_concurrency]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
fail-fast: true
matrix:
os: ["ubuntu-22.04", "ubuntu-22.04-arm", "macos-14", "windows-2022"]
include:
- os: ubuntu-22.04-arm
container: python:3.13-bookworm
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
if: matrix.os != 'ubuntu-22.04-arm'
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install deps
shell: bash
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Build + test wheels
shell: bash
run: |
./rdev.sh ci build-other-wheels
- uses: actions/upload-artifact@v4
with:
name: "pypi-other-${{ runner.os }}-${{ runner.arch }}"
path: dist
#
# Build meson wheels
#
build-meson:
runs-on: ${{ matrix.os }}
needs: [setup_concurrency, build-other, build-pure]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
fail-fast: true
matrix:
os:
- "ubuntu-22.04"
- "macos-15-intel" # x86_64
- "macos-14" # arm64
- "windows-2022"
python_version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
include:
- os: ubuntu-22.04-arm
python_version: '3.11'
container: python:3.11-bookworm
- os: ubuntu-22.04-arm
python_version: '3.12'
container: python:3.12-bookworm
- os: ubuntu-22.04-arm
python_version: '3.13'
container: python:3.13-bookworm
- os: ubuntu-22.04-arm
python_version: '3.14'
container: python:3.14-bookworm
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
if: matrix.os != 'ubuntu-22.04-arm'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- uses: actions/download-artifact@v4
with:
pattern: "pypi-other-${{ runner.os }}-*"
path: dist-other
merge-multiple: true
- uses: actions/download-artifact@v4
with:
pattern: "pypi-pure"
path: dist-other
merge-multiple: true
#
# Platform specific setup
#
- name: Install libgl
run: apt-get update && apt-get install -y libgl1
if: matrix.os == 'ubuntu-22.04-arm'
- name: Setup MSVC
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
with:
architecture: x64
if: runner.os == 'Windows'
#
# Setup build caching
#
- name: Set ccache params
shell: bash
id: ccache
env:
OS: ${{ runner.os }}
run: |
if [[ "$OS" == "macOS" ]]; then
echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV
fi
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
# The sccache 0.13.0 release is missing intel mac builds
# see <https://github.com/mozilla/sccache/issues/2554>
with:
version: "v0.12.0"
- name: Install deps
run: |
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Install numpy (needed for stubgen but broken in raspbian CI)
run: |
python -m pip --disable-pip-version-check install numpy
- name: Build + test wheels
run: |
python -m devtools ci build-meson-wheels
env:
SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
# install + test pure wheels here because this covers all platforms and they need
# the meson wheels to run
- name: Install and test pure wheels
run: |
python -m devtools ci install-test-pure-wheels
- name: Ensure all headers are accounted for
run: |
python -m devtools ci scan-headers
- name: Ensure YAML files are up to date
run: |
python -m devtools ci update-yaml
- uses: actions/upload-artifact@v4
with:
name: "pypi-meson-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}"
path: dist
#
# Build roboRIO/raspbian wheels
#
cross-other:
runs-on: ubuntu-latest
needs: [setup_concurrency]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
matrix:
os:
- container: wpilib/roborio-cross-ubuntu:2026-22.04-py314
name: roborio
- container: wpilib/raspbian-cross-ubuntu:2026-bookworm-22.04-py314
name: raspbian
container:
image: "${{ matrix.os.container }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup cross environment for meson
uses: robotpy/build-actions/setup-cross-meson@semiwrap
- name: Install deps
shell: bash
run: |
/build/venv/bin/build-pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Build + test wheels
shell: bash
run: |
/build/venv/bin/cross-python -m devtools ci build-other-wheels --no-test
- uses: actions/upload-artifact@v4
with:
name: cross-other-${{ matrix.os.name }}
path: dist
cross-meson:
runs-on: ubuntu-latest
needs: [setup_concurrency, cross-other]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
matrix:
os:
- container: wpilib/roborio-cross-ubuntu:2026-22.04-py314
name: roborio
base: roborio
- container: wpilib/raspbian-cross-ubuntu:2026-bookworm-22.04-py311
name: raspbian-py311
base: raspbian
- container: wpilib/raspbian-cross-ubuntu:2026-bookworm-22.04-py312
name: raspbian-py312
base: raspbian
- container: wpilib/raspbian-cross-ubuntu:2026-bookworm-22.04-py313
name: raspbian-py313
base: raspbian
- container: wpilib/raspbian-cross-ubuntu:2026-bookworm-22.04-py314
name: raspbian-py314
base: raspbian
container:
image: "${{ matrix.os.container }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: "cross-other-${{ matrix.os.base }}"
path: dist-other
- name: Setup cross environment for meson
uses: robotpy/build-actions/setup-cross-meson@semiwrap
- run: apt-get update
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os.container }}
variant: ccache
- name: Install deps
shell: bash
run: |
/build/venv/bin/build-pip --disable-pip-version-check install -r rdev_requirements.txt
- name: Build wheels
shell: bash
run: |
/build/venv/bin/cross-python -m devtools ci build-meson-wheels --no-test --cross=cross.txt
- uses: actions/upload-artifact@v4
with:
name: cross-meson-${{ matrix.os.name }}
path: dist
#
# Publish wheels to wpilib artifactory, pypi
#
publish-rpyrepo:
runs-on: ubuntu-latest
needs: [check, build-meson, cross-meson]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
pattern: cross-meson-*
path: dist/
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
user: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2026-local
publish-rpyrepo-other:
runs-on: ubuntu-latest
needs: [check, build-meson, cross-meson]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
pattern: cross-other-*
path: dist/
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
skip-existing: true # native packages can be uploaded multiple times
user: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2026-local
publish-pypi:
runs-on: ubuntu-latest
needs: [check, build-meson, cross-meson]
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: pypi-meson-*
path: dist/
merge-multiple: true
- uses: actions/download-artifact@v4
with:
pattern: pypi-pure
path: dist/
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
publish-pypi-other:
runs-on: ubuntu-latest
needs: [check, build-meson, cross-meson]
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: pypi-other-*
path: dist/
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
skip-existing: true # native packages can be uploaded multiple times
ping-rtd:
runs-on: ubuntu-latest
needs: [check, build-meson, cross-meson]
if: |
github.event_name == 'push' &&
(startsWith(github.event.ref, 'refs/tags') || github.event.ref == 'refs/heads/main')
steps:
- name: Sleep 1 minute to allow artifact upload
shell: bash
run: sleep 60
- name: Ping readthedocs
uses: robotpy/build-actions/ping-rtd@v2024
with:
token: ${{ secrets.RTD_TOKEN }}
webhook: ${{ secrets.RTD_WEBHOOK }}
ping-meta:
runs-on: ubuntu-latest
needs: [publish-rpyrepo, publish-rpyrepo-other, publish-pypi, publish-pypi-other]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.META_REPO_ACCESS_TOKEN }}
repository: robotpy/robotpy-meta
event-type: tag
client-payload: '{"package_name": "mostrobotpy", "package_version": "${{ github.ref_name }}"}'