1
1
name : Build
2
2
3
3
on :
4
- # Run on pushes to master and pushed tags, and on pull requests against master , but ignore the docs folder
4
+ # Run on pushes to main and pushed tags, and on pull requests against main , but ignore the docs folder
5
5
push :
6
- branches : [ master ]
6
+ branches : [ main ]
7
7
tags :
8
8
- ' v*'
9
- paths :
10
- - ' **'
11
- - ' !docs/**'
12
- - ' .github/**'
13
9
pull_request :
14
- branches : [ master ]
15
- paths :
16
- - ' **'
17
- - ' !docs/**'
18
- - ' .github/**'
10
+ branches : [ main ]
11
+ merge_group :
12
+
13
+ concurrency :
14
+ group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15
+ cancel-in-progress : true
19
16
20
17
jobs :
21
18
build-client :
39
36
name : built-client
40
37
path : photon-client/dist/
41
38
build-examples :
42
- name : " Build Examples"
43
- runs-on : ubuntu-22.04
39
+
40
+ strategy :
41
+ fail-fast : false
42
+ matrix :
43
+ include :
44
+ - os : windows-2022
45
+ architecture : x64
46
+ - os : macos-14
47
+ architecture : aarch64
48
+ - os : ubuntu-22.04
49
+
50
+ name : " Photonlib - Build Examples - ${{ matrix.os }}"
51
+ runs-on : ${{ matrix.os }}
52
+
44
53
steps :
45
54
- name : Checkout code
46
55
uses : actions/checkout@v4
@@ -56,23 +65,14 @@ jobs:
56
65
- name : Install RoboRIO Toolchain
57
66
run : ./gradlew installRoboRioToolchain
58
67
# Need to publish to maven local first, so that C++ sim can pick it up
59
- # Still haven't figured out how to make the vendordep file be copied before trying to build examples
60
68
- name : Publish photonlib to maven local
61
- run : |
62
- chmod +x gradlew
63
- ./gradlew publishtomavenlocal -x check
69
+ run : ./gradlew photon-targeting:publishtomavenlocal photon-lib:publishtomavenlocal -x check
64
70
- name : Build Java examples
65
71
working-directory : photonlib-java-examples
66
- run : |
67
- chmod +x gradlew
68
- ./gradlew copyPhotonlib -x check
69
- ./gradlew build -x check
72
+ run : ./gradlew build
70
73
- name : Build C++ examples
71
74
working-directory : photonlib-cpp-examples
72
- run : |
73
- chmod +x gradlew
74
- ./gradlew copyPhotonlib -x check
75
- ./gradlew build -x check
75
+ run : ./gradlew build
76
76
build-gradle :
77
77
name : " Gradle Build"
78
78
runs-on : ubuntu-22.04
@@ -92,19 +92,17 @@ jobs:
92
92
- name : Install mrcal deps
93
93
run : sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5
94
94
- name : Gradle Build
95
- run : |
96
- chmod +x gradlew
97
- ./gradlew photon-targeting:build photon-core:build photon-server:build -x check
95
+ run : ./gradlew photon-targeting:build photon-core:build photon-server:build -x check
98
96
- name : Gradle Tests
99
97
run : ./gradlew testHeadless -i --stacktrace
100
98
- name : Gradle Coverage
101
99
run : ./gradlew jacocoTestReport
102
100
- name : Publish Coverage Report
103
- uses : codecov/codecov-action@v3
101
+ uses : codecov/codecov-action@v4
104
102
with :
105
103
file : ./photon-server/build/reports/jacoco/test/jacocoTestReport.xml
106
104
- name : Publish Core Coverage Report
107
- uses : codecov/codecov-action@v3
105
+ uses : codecov/codecov-action@v4
108
106
with :
109
107
file : ./photon-core/build/reports/jacoco/test/jacocoTestReport.xml
110
108
build-offline-docs :
@@ -133,6 +131,36 @@ jobs:
133
131
with :
134
132
name : built-docs
135
133
path : docs/build/html
134
+
135
+ build-photonlib-vendorjson :
136
+ name : " Build Vendor JSON"
137
+ runs-on : ubuntu-22.04
138
+ steps :
139
+ - uses : actions/checkout@v4
140
+ with :
141
+ fetch-depth : 0
142
+
143
+ - name : Install Java 17
144
+ uses : actions/setup-java@v4
145
+ with :
146
+ java-version : 17
147
+ distribution : temurin
148
+
149
+ # grab all tags
150
+ - run : git fetch --tags --force
151
+
152
+ # Generate the JSON and give it the ""standard""" name maven gives it
153
+ - run : |
154
+ ./gradlew photon-lib:generateVendorJson
155
+ export VERSION=$(git describe --tags --match=v*)
156
+ mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-$(git describe --tags --match=v*).json
157
+
158
+ # Upload it here so it shows up in releases
159
+ - uses : actions/upload-artifact@v4
160
+ with :
161
+ name : photonlib-vendor-json
162
+ path : photon-lib/build/generated/vendordeps/photonlib-*.json
163
+
136
164
build-photonlib-host :
137
165
env :
138
166
MACOSX_DEPLOYMENT_TARGET : 13
@@ -162,9 +190,7 @@ jobs:
162
190
distribution : temurin
163
191
architecture : ${{ matrix.architecture }}
164
192
- run : git fetch --tags --force
165
- - run : |
166
- chmod +x gradlew
167
- ./gradlew photon-targeting:build photon-lib:build -i
193
+ - run : ./gradlew photon-targeting:build photon-lib:build -i
168
194
name : Build with Gradle
169
195
- run : ./gradlew photon-lib:publish photon-targeting:publish
170
196
name : Publish
@@ -183,7 +209,7 @@ jobs:
183
209
fail-fast : false
184
210
matrix :
185
211
include :
186
- - container : wpilib/roborio-cross-ubuntu:2024-22 .04
212
+ - container : wpilib/roborio-cross-ubuntu:2025-24 .04
187
213
artifact-name : Athena
188
214
build-options : " -Ponlylinuxathena"
189
215
- container : wpilib/raspbian-cross-ubuntu:bullseye-22.04
@@ -205,13 +231,9 @@ jobs:
205
231
git config --global --add safe.directory /__w/photonvision/photonvision
206
232
- name : Build PhotonLib
207
233
# We don't need to run tests, since we specify only non-native platforms
208
- run : |
209
- chmod +x gradlew
210
- ./gradlew photon-targeting:build photon-lib:build ${{ matrix.build-options }} -i -x test
234
+ run : ./gradlew photon-targeting:build photon-lib:build ${{ matrix.build-options }} -i -x test
211
235
- name : Publish
212
- run : |
213
- chmod +x gradlew
214
- ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }}
236
+ run : ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }}
215
237
env :
216
238
ARTIFACTORY_API_KEY : ${{ secrets.ARTIFACTORY_API_KEY }}
217
239
if : github.event_name == 'push' && github.repository_owner == 'photonvision'
@@ -307,13 +329,9 @@ jobs:
307
329
with :
308
330
name : built-docs
309
331
path : photon-server/src/main/resources/web/docs
310
- - run : |
311
- chmod +x gradlew
312
- ./gradlew photon-targeting:jar photon-server:shadowJar -PArchOverride=${{ matrix.arch-override }}
332
+ - run : ./gradlew photon-targeting:jar photon-server:shadowJar -PArchOverride=${{ matrix.arch-override }}
313
333
if : ${{ (matrix.arch-override != 'none') }}
314
- - run : |
315
- chmod +x gradlew
316
- ./gradlew photon-server:shadowJar
334
+ - run : ./gradlew photon-server:shadowJar
317
335
if : ${{ (matrix.arch-override == 'none') }}
318
336
- uses : actions/upload-artifact@v4
319
337
with :
@@ -373,7 +391,7 @@ jobs:
373
391
- os : ubuntu-22.04
374
392
artifact-name : LinuxArm64
375
393
image_suffix : RaspberryPi
376
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-4 /photonvision_raspi.img.xz
394
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_raspi.img.xz
377
395
cpu : cortex-a7
378
396
image_additional_mb : 0
379
397
extraOpts : -Djdk.lang.Process.launchMechanism=vfork
@@ -412,49 +430,61 @@ jobs:
412
430
- os : ubuntu-22.04
413
431
artifact-name : LinuxArm64
414
432
image_suffix : RaspberryPi
415
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_raspi.img.xz
433
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_raspi.img.xz
416
434
cpu : cortex-a7
417
435
image_additional_mb : 0
418
436
- os : ubuntu-22.04
419
437
artifact-name : LinuxArm64
420
438
image_suffix : limelight2
421
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_limelight.img.xz
439
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_limelight.img.xz
422
440
cpu : cortex-a7
423
441
image_additional_mb : 0
424
442
- os : ubuntu-22.04
425
443
artifact-name : LinuxArm64
426
444
image_suffix : limelight3
427
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6/photonvision_limelight3.img.xz
445
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3/photonvision_limelight3.img.xz
446
+ cpu : cortex-a7
447
+ image_additional_mb : 0
448
+ - os : ubuntu-22.04
449
+ artifact-name : LinuxArm64
450
+ image_suffix : limelight3G
451
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3/photonvision_limelight3g.img.xz
428
452
cpu : cortex-a7
429
453
image_additional_mb : 0
430
454
- os : ubuntu-22.04
431
455
artifact-name : LinuxArm64
432
456
image_suffix : orangepi5
433
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_opi5.img.xz
457
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_opi5.img.xz
434
458
cpu : cortex-a8
435
459
image_additional_mb : 1024
436
460
- os : ubuntu-22.04
437
461
artifact-name : LinuxArm64
438
462
image_suffix : orangepi5b
439
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_opi5b.img.xz
463
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_opi5b.img.xz
440
464
cpu : cortex-a8
441
465
image_additional_mb : 1024
442
466
- os : ubuntu-22.04
443
467
artifact-name : LinuxArm64
444
468
image_suffix : orangepi5plus
445
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_opi5plus.img.xz
469
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_opi5plus.img.xz
446
470
cpu : cortex-a8
447
471
image_additional_mb : 1024
448
472
- os : ubuntu-22.04
449
473
artifact-name : LinuxArm64
450
474
image_suffix : orangepi5pro
451
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6 /photonvision_opi5pro.img.xz
475
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3 /photonvision_opi5pro.img.xz
452
476
cpu : cortex-a8
453
477
image_additional_mb : 1024
454
478
- os : ubuntu-22.04
455
479
artifact-name : LinuxArm64
456
480
image_suffix : orangepi5max
457
- image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.0-beta-6/photonvision_opi5max.img.xz
481
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3/photonvision_opi5max.img.xz
482
+ cpu : cortex-a8
483
+ image_additional_mb : 1024
484
+ - os : ubuntu-22.04
485
+ artifact-name : LinuxArm64
486
+ image_suffix : rock5c
487
+ image_url : https://github.com/PhotonVision/photon-image-modifier/releases/download/v2025.0.3/photonvision_rock5c.img.xz
458
488
cpu : cortex-a8
459
489
image_additional_mb : 1024
460
490
@@ -507,6 +537,11 @@ jobs:
507
537
with :
508
538
merge-multiple : true
509
539
pattern : photonlib-offline
540
+ # Download vendor json
541
+ - uses : actions/download-artifact@v4
542
+ with :
543
+ merge-multiple : true
544
+ pattern : photonlib-vendor-json
510
545
# Download all images
511
546
- uses : actions/download-artifact@v4
512
547
with :
@@ -529,20 +564,35 @@ jobs:
529
564
# Upload all jars and xz archives
530
565
# Split into two uploads to work around max size limits in action-gh-releases
531
566
# https://github.com/softprops/action-gh-release/issues/353
532
- -
uses :
softprops/[email protected] .8
567
+ -
uses :
softprops/[email protected] .9
533
568
with :
534
569
files : |
535
- **/*orangepi5*.xz
570
+ **/@( *orangepi5*|*rock5*) .xz
536
571
if : startsWith(github.ref, 'refs/tags/v')
537
572
env :
538
573
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
539
- -
uses :
softprops/[email protected] .8
574
+ -
uses :
softprops/[email protected] .9
540
575
with :
541
576
files : |
542
- **/!(*orangepi5*).xz
577
+ **/!(*orangepi5*|*rock5* ).xz
543
578
**/*.jar
544
579
**/photonlib*.json
545
580
**/photonlib*.zip
546
581
if : startsWith(github.ref, 'refs/tags/v')
547
582
env :
548
583
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
584
+
585
+ dispatch :
586
+ name : dispatch
587
+ needs : [build-photonlib-vendorjson, release]
588
+ runs-on : ubuntu-22.04
589
+ steps :
590
+ - uses : peter-evans/repository-dispatch@v3
591
+ if : |
592
+ github.repository == 'PhotonVision/photonvision' &&
593
+ startsWith(github.ref, 'refs/tags/v')
594
+ with :
595
+ token : ${{ secrets.VENDOR_JSON_REPO_PUSH_TOKEN }}
596
+ repository : PhotonVision/vendor-json-repo
597
+ event-type : tag
598
+ client-payload : ' {"run_id": "${{ github.run_id }}", "package_version": "${{ github.ref_name }}"}'
0 commit comments