Repository navigation
2822 lines (2751 loc) · 149 KB
/
Copy pathrelease.yml
File metadata and controls
2822 lines (2751 loc) · 149 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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: OpenCode (Rune) Release
# Builds, signs, notarizes, and publishes OpenCode (Rune) (apps/desktop) to
# https://anoma.ly/release (docs/releasing.md), split the way Hex's and OpenCode's releases are:
#
# - build and verify jobs run repository code with no environment, secrets, or id-token, and
# produce unsigned files.
# - sign and publish jobs run in the `release` environment (deployment branch: dev only), check
# out only /.github/release/ at github.sha, run only those scripts and SHA-pinned actions, and
# treat artifacts strictly as SHA-256-verified data. Their secrets come from AWS Secrets Manager
# through GitHub OIDC (role github/opencode-rune-release, anomalyco/secrets), step-scoped: the
# AWS session is only a step output of configure-aws-credentials, passed to the one step that
# reads secrets (.github/release/with-secrets.sh). The environment holds only non-secret
# variables (AZURE_*, APPLE_NOTARY_KEY_ID, APPLE_NOTARY_ISSUER_ID).
# - every artifact carries a SHA256SUMS whose digest the job that made it reports as an output;
# every job that downloads it checks that digest (.github/release/verify-artifacts.sh).
#
# This file and .github/release/ are the security boundary for releases; changing .github/ needs
# Dax (.github/CODEOWNERS and the `release boundary (.github needs Dax)` ruleset). The release
# service authorizes publish jobs by their OIDC token: anomalyco/opencode-rune, this file,
# refs/heads/dev, environment release (anomalyco/release registry/opencode.json for desktop and
# registry/opencode-rune.json for browser-engine).
#
# Scheduled dev checks follow the official desktop's six-hour cadence. Only plan runs when
# no app or engine files changed and the live browser-engine index already serves this commit's
# engines. Each desktop or engine publish replaces the whole channel in one request.
# - workflow_dispatch from dev builds now, whatever changed: check (build, sign, verify desktop
# and browser engines; publish nothing), dev, or engine (browser engines only; refuses if this
# commit's version is already complete in the live index).
# - dev is the only desktop channel; there is no stable. Every dev release, once it is on the
# release service, is tagged v0.0.0-dev-<n> and mirrored byte for byte to a GitHub release
# marked latest. Tags start nothing.
#
# A run always releases the commit it runs on (github.sha): there is no ref input, every job
# checks out github.sha, and the plan fails unless that is the commit it checked out on dev.
on:
schedule:
- cron: "17 */6 * * *"
workflow_dispatch:
inputs:
channel:
description: Run from dev. check (build and verify), dev (desktop), engine (browser engines), or office-engine (office engines)
type: choice
options: [check, dev, engine, office-engine]
default: check
run-name: >-
${{ (github.event_name == 'schedule' || inputs.channel == 'dev') && 'dev: full desktop matrix'
|| inputs.channel == 'engine' && 'browser engine release'
|| inputs.channel == 'office-engine' && 'office engine release'
|| 'check: full desktop matrix' }}
permissions:
contents: read
# Finish the active release; only the newest pending run per channel waits.
concurrency:
group: opencode-rune-${{ inputs.channel || 'dev' }}
cancel-in-progress: false
defaults:
run:
shell: bash
env:
SEER_TEAM_ID: 5NZ4Q7NXJ4
# A release build starts from the cache, not from an earlier build of its own: incremental
# state only makes CI's build slower and its cache larger.
CARGO_INCREMENTAL: "0"
jobs:
plan:
if: github.ref == 'refs/heads/dev'
runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
contents: read
actions: read
outputs:
channel: ${{ steps.plan.outputs.channel }}
service: ${{ steps.plan.outputs.service }}
tag: ${{ steps.plan.outputs.tag }}
notes-url: ${{ steps.plan.outputs.notes-url }}
release-channel: ${{ steps.plan.outputs.release-channel }}
release-version: ${{ steps.plan.outputs.release-version }}
build-desktop: ${{ steps.plan.outputs.build-desktop }}
cef-version: ${{ steps.plan.outputs.cef-version }}
engine-version: ${{ steps.plan.outputs.engine-version }}
engine-release-version: ${{ steps.plan.outputs.engine-release-version }}
build-cef: ${{ steps.plan.outputs.build-cef }}
build-wrapper: ${{ steps.plan.outputs.build-wrapper }}
build-engine: ${{ steps.plan.outputs.build-engine }}
linux-x64-sha256: ${{ steps.plan.outputs.linux-x64-sha256 }}
linux-arm64-sha256: ${{ steps.plan.outputs.linux-arm64-sha256 }}
cef-linux-x64-sha256: ${{ steps.plan.outputs.cef-linux-x64-sha256 }}
cef-linux-arm64-sha256: ${{ steps.plan.outputs.cef-linux-arm64-sha256 }}
office-version: ${{ steps.plan.outputs.office-version }}
office-release-version: ${{ steps.plan.outputs.office-release-version }}
build-office-engine: ${{ steps.plan.outputs.build-office-engine }}
office-linux-x64-sha256: ${{ steps.plan.outputs.office-linux-x64-sha256 }}
office-linux-arm64-sha256: ${{ steps.plan.outputs.office-linux-arm64-sha256 }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
sparse-checkout: |
/.github/release/
/apps/browser-engine/Cargo.lock
/crates/browser-pane/src/installer.rs
/apps/office-engine/Cargo.lock
/features/office/src/engine/installer.rs
sparse-checkout-cone-mode: false
persist-credentials: false
- id: plan
run: SHA=$(git rev-parse HEAD) bash .github/release/opencode-rune-plan.sh
env:
EVENT: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
CHANNEL: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'dev' }}
GH_TOKEN: ${{ github.token }}
# Which signing values the release environment holds, read on Linux, so a Windows or macOS
# runner is booked only to sign. Every desktop or engine channel requires both. The Apple
# certificate and notary key aren't here: they're read from AWS in the signing step itself,
# which fails if either is empty.
credentials:
needs: plan
if: ${{ needs.plan.outputs.build-desktop == 'true' || needs.plan.outputs.build-engine == 'true' || needs.plan.outputs.build-office-engine == 'true' }}
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 5
environment: release
steps:
- id: check
env:
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
APPLE_NOTARY_KEY_ID: ${{ vars.APPLE_NOTARY_KEY_ID }}
APPLE_NOTARY_ISSUER_ID: ${{ vars.APPLE_NOTARY_ISSUER_ID }}
run: |
missing() { for name in "$@"; do [ -n "$(printenv "$name")" ] || printf ' %s' "$name"; done; }
azure=$(missing AZURE_CLIENT_ID AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID AZURE_TRUSTED_SIGNING_ENDPOINT AZURE_TRUSTED_SIGNING_ACCOUNT_NAME AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE)
apple=$(missing APPLE_NOTARY_KEY_ID APPLE_NOTARY_ISSUER_ID)
if [ -n "$azure$apple" ]; then
echo "::error::Desktop releases need signed Windows and macOS builds; the release environment lacks:$azure$apple."
exit 1
fi
# ---- Build: repository code; no environment, secrets, or id-token ----------
build-macos:
needs: [plan, credentials]
if: ${{ needs.plan.outputs.build-desktop == 'true' }}
strategy: &mac-strategy
matrix:
include:
- { arch: arm64, host: blacksmith-6vcpu-macos-26 }
- { arch: x64, host: macos-26-intel }
# Cross-build x86_64-apple-darwin on fast Apple Silicon (like build-windows cross-builds arm64);
# verify-macos still runs on matrix.host (macos-26-intel for x64) for real native verification.
runs-on: blacksmith-6vcpu-macos-26
timeout-minutes: 120
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
OPENCODE_RUNE_TARGET: ${{ matrix.arch == 'x64' && 'x86_64-apple-darwin' || 'aarch64-apple-darwin' }}
OPENCODE_RUNE_PROFILE: release-thin
outputs: &arch-digests
digest-x64: ${{ steps.digest.outputs.digest-x64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
steps:
- &build-checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
# rust-toolchain.toml picks the toolchain; x64 cross-builds on the arm64 runner.
- name: Rust toolchain
run: |
rustup toolchain install
[ "${{ matrix.arch }}" = arm64 ] || rustup target add x86_64-apple-darwin
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: macos-${{ matrix.arch }}-${{ env.OPENCODE_RUNE_PROFILE }}
save-if: ${{ github.ref == 'refs/heads/dev' }}
# The terminal's libghostty-vt, and the Zig that builds it, live outside target/.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/seer/ghostty-vt
key: ghostty-vt-macos-${{ matrix.arch }}-${{ hashFiles('crates/terminal/build.rs', 'crates/terminal/build_support.rs') }}
- id: zig
name: Zig version
run: |
version=$(sed -n 's/^pub const ZIG_VERSION: &str = "\(.*\)";$/\1/p' crates/terminal/build_support.rs)
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::Could not read ZIG_VERSION from crates/terminal/build_support.rs." >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
# The Zig toolchain on its own, keyed on its version alone: ghostty-vt's key follows
# build.rs and build_support.rs, so without this every change there downloads Zig again.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/seer/ghostty-vt/zig-*-${{ steps.zig.outputs.version }}
key: zig-${{ runner.os }}-${{ runner.arch }}-${{ steps.zig.outputs.version }}
- name: Install NASM for the x86 video decoder
if: matrix.arch == 'x64'
run: brew install nasm
- name: Build OpenCode (Rune).app
run: |
apps/desktop/scripts/set-crate-version.sh "$PWD" "$OPENCODE_RUNE_VERSION"
mkdir -p "$RUNNER_TEMP/app" "$RUNNER_TEMP/macos"
apps/desktop/scripts/build-app.sh "$RUNNER_TEMP/app"
if [ "${{ matrix.arch }}" = arm64 ]; then
OPENCODE_RUNE_SMOKE_HEADLESS=1 apps/desktop/scripts/smoke-app.sh "$RUNNER_TEMP/app/OpenCode (Rune).app"
fi
/usr/bin/ditto -c -k --sequesterRsrc --keepParent "$RUNNER_TEMP/app/OpenCode (Rune).app" "$RUNNER_TEMP/macos/OpenCode-Rune.app.zip"
- id: upload
uses: ./.github/release/upload
with:
name: build-opencode-rune-macos-${{ matrix.arch }}
path: ${{ runner.temp }}/macos
retention-days: "7"
- &report-digest
id: digest
run: echo "digest-${{ matrix.arch }}=${{ steps.upload.outputs.digest }}" >> "$GITHUB_OUTPUT"
build-linux:
needs: [plan, credentials, build-cef-linux, build-engine-linux, build-office-linux]
if: >-
${{ !cancelled()
&& needs.plan.outputs.build-desktop == 'true'
&& needs.credentials.result == 'success'
&& (needs.plan.outputs.build-cef != 'true' || needs.build-cef-linux.result == 'success')
&& (needs.plan.outputs.build-wrapper != 'true' || needs.build-engine-linux.result == 'success')
&& (needs.plan.outputs.build-office-engine != 'true' || needs.build-office-linux.result == 'success') }}
strategy:
matrix:
include:
- { arch: x64, host: blacksmith-4vcpu-ubuntu-2404 }
- { arch: arm64, host: blacksmith-4vcpu-ubuntu-2404-arm }
runs-on: ${{ matrix.host }}
timeout-minutes: 120
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
outputs:
digest-x64: ${{ steps.digest.outputs.digest-x64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
linux-x64-engine-sha256: ${{ steps.engine-trust.outputs.linux-x64-engine-sha256 }}
linux-arm64-engine-sha256: ${{ steps.engine-trust.outputs.linux-arm64-engine-sha256 }}
linux-x64-cef-sha256: ${{ steps.engine-trust.outputs.linux-x64-cef-sha256 }}
linux-arm64-cef-sha256: ${{ steps.engine-trust.outputs.linux-arm64-cef-sha256 }}
linux-x64-office-sha256: ${{ steps.office-trust.outputs.linux-x64-office-sha256 }}
linux-arm64-office-sha256: ${{ steps.office-trust.outputs.linux-arm64-office-sha256 }}
steps:
- *build-checkout
- name: Install native build and packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang cmake pkg-config nasm libfontconfig1-dev libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libdbus-1-dev libudev-dev libssl-dev rpm squashfs-tools
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: linux-${{ matrix.arch }}
save-if: ${{ github.ref == 'refs/heads/dev' }}
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/seer/ghostty-vt
key: ghostty-vt-linux-${{ matrix.arch }}-${{ hashFiles('crates/terminal/build.rs', 'crates/terminal/build_support.rs') }}
- id: zig
name: Zig version
run: |
version=$(sed -n 's/^pub const ZIG_VERSION: &str = "\(.*\)";$/\1/p' crates/terminal/build_support.rs)
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::Could not read ZIG_VERSION from crates/terminal/build_support.rs." >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
# The Zig toolchain on its own, keyed on its version alone: ghostty-vt's key follows
# build.rs and build_support.rs, so without this every change there downloads Zig again.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/seer/ghostty-vt/zig-*-${{ steps.zig.outputs.version }}
key: zig-${{ runner.os }}-${{ runner.arch }}-${{ steps.zig.outputs.version }}
- id: engine-trust
name: Resolve Linux ${{ matrix.arch }} browser engine and CEF sha256 pins
env:
PINNED_SHA256: ${{ needs.plan.outputs.build-wrapper == 'true' && needs.build-engine-linux.outputs[format('sha256-{0}', matrix.arch)] || needs.plan.outputs[format('linux-{0}-sha256', matrix.arch)] }}
PINNED_CEF_SHA256: ${{ needs.plan.outputs.build-cef == 'true' && needs.build-cef-linux.outputs[format('sha256-{0}', matrix.arch)] || needs.plan.outputs[format('cef-linux-{0}-sha256', matrix.arch)] }}
run: |
[[ "$PINNED_SHA256" =~ ^[0-9a-f]{64}$ ]] || { echo "::error::Invalid Linux ${{ matrix.arch }} browser engine sha256 '$PINNED_SHA256'." >&2; exit 1; }
if [ -n "$PINNED_CEF_SHA256" ]; then
[[ "$PINNED_CEF_SHA256" =~ ^[0-9a-f]{64}$ ]] || { echo "::error::Invalid Linux ${{ matrix.arch }} CEF sha256 '$PINNED_CEF_SHA256'." >&2; exit 1; }
fi
echo "linux-${{ matrix.arch }}-engine-sha256=$PINNED_SHA256" >> "$GITHUB_OUTPUT"
echo "linux-${{ matrix.arch }}-cef-sha256=$PINNED_CEF_SHA256" >> "$GITHUB_OUTPUT"
- id: office-trust
name: Resolve Linux ${{ matrix.arch }} office engine sha256 pin
env:
PINNED_SHA256: ${{ needs.plan.outputs.build-office-engine == 'true' && needs.build-office-linux.outputs[format('sha256-{0}', matrix.arch)] || needs.plan.outputs[format('office-linux-{0}-sha256', matrix.arch)] }}
run: |
[[ "$PINNED_SHA256" =~ ^[0-9a-f]{64}$ ]] || { echo "::error::Invalid Linux ${{ matrix.arch }} office engine sha256 '$PINNED_SHA256'." >&2; exit 1; }
echo "linux-${{ matrix.arch }}-office-sha256=$PINNED_SHA256" >> "$GITHUB_OUTPUT"
- name: Build and package desktop
env:
LINUX_ENGINE_SHA256: ${{ steps.engine-trust.outputs[format('linux-{0}-engine-sha256', matrix.arch)] }}
LINUX_CEF_SHA256: ${{ steps.engine-trust.outputs[format('linux-{0}-cef-sha256', matrix.arch)] }}
LINUX_OFFICE_SHA256: ${{ steps.office-trust.outputs[format('linux-{0}-office-sha256', matrix.arch)] }}
run: |
export OPENCODE_BROWSER_ENGINE_TRUST="sha256:$LINUX_ENGINE_SHA256"
if [ -n "$LINUX_CEF_SHA256" ]; then
export OPENCODE_BROWSER_CEF_TRUST="sha256:$LINUX_CEF_SHA256"
fi
export OPENCODE_OFFICE_ENGINE_TRUST="sha256:$LINUX_OFFICE_SHA256"
apps/desktop/scripts/set-crate-version.sh "$PWD" "$OPENCODE_RUNE_VERSION"
cargo build --locked -p opencode-desktop --profile release-quick
bash apps/desktop/scripts/package-linux.sh target/release-quick/opencode-desktop "$RUNNER_TEMP/linux"
- id: upload
uses: ./.github/release/upload
with:
name: build-opencode-rune-linux-${{ matrix.arch }}
path: ${{ runner.temp }}/linux
retention-days: "7"
- *report-digest
build-windows:
needs: [plan, credentials]
if: ${{ needs.plan.outputs.build-desktop == 'true' }}
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
runs-on: blacksmith-16vcpu-windows-2025
timeout-minutes: 120
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
# One output per arch: a matrix job's outputs are shared by its legs.
outputs:
digest-x64: ${{ steps.digest.outputs.digest-x64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
# rust-toolchain.toml picks the toolchain; arm64 cross-builds on the x64 runner.
- name: Rust toolchain
run: |
rustup toolchain install
[ "${{ matrix.arch }}" = x64 ] || rustup target add aarch64-pc-windows-msvc
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: windows-${{ matrix.arch }}
save-if: ${{ github.ref == 'refs/heads/dev' }}
# The terminal's libghostty-vt, and the Zig that builds it, live outside target/.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/AppData/Local/seer/ghostty-vt
key: ghostty-vt-windows-${{ matrix.arch }}-${{ hashFiles('crates/terminal/build.rs', 'crates/terminal/build_support.rs') }}
- id: zig
name: Zig version
run: |
version=$(sed -n 's/^pub const ZIG_VERSION: &str = "\(.*\)";$/\1/p' crates/terminal/build_support.rs)
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::Could not read ZIG_VERSION from crates/terminal/build_support.rs." >&2; exit 1; }
echo "version=$version" >> "$GITHUB_OUTPUT"
# The Zig toolchain on its own, keyed on its version alone: ghostty-vt's key follows
# build.rs and build_support.rs, so without this every change there downloads Zig again.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/AppData/Local/seer/ghostty-vt/zig-*-${{ steps.zig.outputs.version }}
key: zig-${{ runner.os }}-${{ runner.arch }}-${{ steps.zig.outputs.version }}
- name: Build the setup and the update archives
shell: pwsh
run: apps/installer/scripts/package.ps1 -Out "$env:RUNNER_TEMP/windows" -Arch ${{ matrix.arch }}
- id: upload
uses: ./.github/release/upload
with:
name: build-opencode-rune-windows-${{ matrix.arch }}
path: ${{ runner.temp }}/windows
retention-days: "7"
- id: digest
run: echo "digest-${{ matrix.arch }}=${{ steps.upload.outputs.digest }}" >> "$GITHUB_OUTPUT"
# The setup around the install folder sign-windows signed, so it installs the same signed files
# the updater downloads. Repository code: a build, after the signing job (as OpenCode's
# build-desktop-windows-installer); sign-windows-setup signs the setup next.
package-windows:
needs: [plan, sign-windows]
if: ${{ !cancelled() && needs.sign-windows.result == 'success' }}
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
runs-on: blacksmith-8vcpu-windows-2025
timeout-minutes: 60
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
outputs:
digest-x64: ${{ steps.digest.outputs.digest-x64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
- name: Rust toolchain
run: |
rustup toolchain install
[ "${{ matrix.arch }}" = x64 ] || rustup target add aarch64-pc-windows-msvc
# No cache: the setup and its few dependencies build in less time than a cache takes to
# restore and save, and the app's caches keep the repository's 10 GB.
- uses: ./.github/release/download
with:
pattern: sign-opencode-rune-windows-app
digests: sign-opencode-rune-windows-app=${{ needs.sign-windows.outputs.digest }}
- name: Build the setup around the signed tar.zst
shell: pwsh
run: |
$archive = "$env:RUNNER_TEMP/in/sign-opencode-rune-windows-app/OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-${{ matrix.arch }}.tar.zst"
apps/installer/scripts/package.ps1 -Out "$env:RUNNER_TEMP/setup" -Arch ${{ matrix.arch }} -Payload $archive
# Not build-opencode-rune-windows-*: that pattern names the unsigned builds.
- id: upload
uses: ./.github/release/upload
with:
name: setup-opencode-rune-windows-${{ matrix.arch }}
path: ${{ runner.temp }}/setup
retention-days: "7"
- id: digest
run: echo "digest-${{ matrix.arch }}=${{ steps.upload.outputs.digest }}" >> "$GITHUB_OUTPUT"
# ---- Sign: release environment; only .github/release/ is checked out -------
# Authenticode-signs opencode-desktop.exe and every program and library of the install folders
# through Azure Artifact Signing, as OpenCode's and Hex's
# release workflows do (GitHub OIDC into the release environment's AZURE_* values), then zips the
# signed folders: the updater's windows-<arch> targets, which it checks against
# updater::windows::EXPECTED_PUBLISHER. package-windows builds the setups around those zips and
# sign-windows-setup signs them.
sign-windows:
needs: [plan, build-windows]
runs-on: blacksmith-4vcpu-windows-2025
timeout-minutes: 30
environment: release
permissions:
contents: read
id-token: write
env: &windows-sign-env
CHANNEL: ${{ needs.plan.outputs.channel }}
VERSION: ${{ needs.plan.outputs.release-version }}
ARCHES: x64 arm64
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
outputs:
digest: ${{ steps.upload.outputs.digest }}
steps:
- &checkout-release
name: Check out the release scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
sparse-checkout: /.github/release/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Download the unsigned builds
uses: ./.github/release/download
with:
pattern: build-opencode-rune-windows-*
digests: >-
build-opencode-rune-windows-x64=${{ needs.build-windows.outputs.digest-x64 }}
build-opencode-rune-windows-arm64=${{ needs.build-windows.outputs.digest-arm64 }}
- name: Unpack the install folders
shell: pwsh
run: |
foreach ($arch in $env:ARCHES -split ' ') {
Expand-Archive -LiteralPath "$env:RUNNER_TEMP/in/build-opencode-rune-windows-$arch/OpenCode-Rune-$env:VERSION-windows-$arch.zip" -DestinationPath "$env:RUNNER_TEMP/work/windows-$arch"
}
- &azure-login
name: Sign in to Azure
uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
- &azure-sign
name: Sign
uses: azure/artifact-signing-action@c7ab2a863ab5f9a846ddb8265964877ef296ee82 # v2
with:
endpoint: ${{ env.AZURE_TRUSTED_SIGNING_ENDPOINT }}
signing-account-name: ${{ env.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ env.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
files-folder: ${{ runner.temp }}\work
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
description: OpenCode (Rune)
description-url: https://github.com/anomalyco/opencode-rune
exclude-environment-credential: true
exclude-workload-identity-credential: true
exclude-managed-identity-credential: true
exclude-shared-token-cache-credential: true
exclude-visual-studio-credential: true
exclude-visual-studio-code-credential: true
exclude-azure-cli-credential: false
exclude-azure-powershell-credential: true
exclude-azure-developer-cli-credential: true
exclude-interactive-browser-credential: true
# Fetch the signing tools fresh: the Actions cache is shared with build jobs that run
# repository code, so a restored entry could be a poisoned module run here.
cache-dependencies: false
- &azure-verify
name: Check the signatures
shell: pwsh
run: .github/release/opencode-rune-verify-windows.ps1 -Folders "$env:RUNNER_TEMP/work"
- name: Archive the signed install folders (.zip and .tar.zst)
shell: pwsh
run: |
$tarExe = Join-Path $env:SystemRoot 'System32\tar.exe'
New-Item -ItemType Directory -Force "$env:RUNNER_TEMP/out" | Out-Null
foreach ($arch in $env:ARCHES -split ' ') {
$dir = "$env:RUNNER_TEMP/work/windows-$arch"
$stem = "$env:RUNNER_TEMP/out/OpenCode-Rune-$env:VERSION-windows-$arch"
Compress-Archive -Path "$dir/*" -DestinationPath "$stem.zip"
$entries = @(Get-ChildItem -LiteralPath $dir | Sort-Object Name | ForEach-Object Name)
& $tarExe --format paxr --zstd --options 'zstd:compression-level=19,zstd:threads=0' -cf "$stem.tar.zst" -C $dir -- @entries
if ($LASTEXITCODE -ne 0) { throw "Failed to create $stem.tar.zst." }
}
- id: upload
uses: ./.github/release/upload
with:
name: sign-opencode-rune-windows-app
path: ${{ runner.temp }}/out
sign-windows-setup:
needs: [plan, sign-windows, package-windows]
if: ${{ !cancelled() && needs.sign-windows.result == 'success' && needs.package-windows.result == 'success' }}
runs-on: blacksmith-4vcpu-windows-2025
timeout-minutes: 30
environment: release
permissions:
contents: read
id-token: write
env: *windows-sign-env
outputs:
digest: ${{ steps.upload.outputs.digest }}
steps:
- *checkout-release
- name: Download the setups
uses: ./.github/release/download
with:
pattern: setup-opencode-rune-windows-*
digests: >-
setup-opencode-rune-windows-x64=${{ needs.package-windows.outputs.digest-x64 }}
setup-opencode-rune-windows-arm64=${{ needs.package-windows.outputs.digest-arm64 }}
- name: Download the signed archives
uses: ./.github/release/download
with:
pattern: sign-opencode-rune-windows-app
digests: sign-opencode-rune-windows-app=${{ needs.sign-windows.outputs.digest }}
folder: app
- name: Gather the setups
run: |
temp=$(cygpath -u "$RUNNER_TEMP")
mkdir -p "$temp/work" && cp "$temp"/in/setup-opencode-rune-windows-*/*.exe "$temp/work/"
- *azure-login
- *azure-sign
- *azure-verify
- name: Gather the release files
run: |
temp=$(cygpath -u "$RUNNER_TEMP")
mkdir -p "$temp/out" && cp "$temp"/work/*.exe "$temp"/app/sign-opencode-rune-windows-app/*.zip "$temp"/app/sign-opencode-rune-windows-app/*.tar.zst "$temp/out/"
- id: upload
uses: ./.github/release/upload
with:
name: sign-opencode-rune-windows
path: ${{ runner.temp }}/out
# Developer ID signing and notarization, whenever this run built macOS; booked only when the
# release environment holds the notary IDs (`credentials`).
sign-macos:
needs: [plan, build-macos]
strategy: *mac-strategy
runs-on: blacksmith-6vcpu-macos-26
timeout-minutes: 90
environment: release
permissions:
contents: read
id-token: write
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
CHANNEL: ${{ needs.plan.outputs.channel }}
outputs: *arch-digests
steps:
- *checkout-release
- name: Download unsigned app
uses: ./.github/release/download
with:
pattern: build-opencode-rune-macos-${{ matrix.arch }}
digests: build-opencode-rune-macos-${{ matrix.arch }}=${{ needs.build-macos.outputs[format('digest-{0}', matrix.arch)] }}
# AWS credentials only as this action's step outputs (never in the job's environment), for
# the one step below that reads the secrets.
- id: aws
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
with:
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-rune-release
role-session-name: opencode-rune-${{ github.run_id }}
role-duration-seconds: 900
aws-region: us-east-1
output-env-credentials: false
output-credentials: true
- name: Import the certificate and notary key
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
run: |
bash .github/release/with-secrets.sh \
APPLE_SIGNING_CERTIFICATE=shared/APPLE_SIGNING_CERTIFICATE \
APPLE_NOTARY_KEY=shared/APPLE_NOTARY_KEY \
-- bash .github/release/macos-credentials.sh "$RUNNER_TEMP/credentials"
- name: Sign, notarize, and staple
run: bash .github/release/opencode-rune-sign-macos.sh "$RUNNER_TEMP/in/build-opencode-rune-macos-${{ matrix.arch }}/OpenCode-Rune.app.zip" "$RUNNER_TEMP/out" "${{ matrix.arch }}"
env:
SEER_NOTARY_KEY_ID: ${{ vars.APPLE_NOTARY_KEY_ID }}
SEER_NOTARY_ISSUER: ${{ vars.APPLE_NOTARY_ISSUER_ID }}
- name: Remove the credentials
if: always()
run: |
security delete-keychain "$RUNNER_TEMP/credentials/signing.keychain-db" 2>/dev/null || true
rm -rf "$RUNNER_TEMP/credentials"
- id: upload
uses: ./.github/release/upload
with:
name: sign-opencode-rune-macos-${{ matrix.arch }}
path: ${{ runner.temp }}/out
- *report-digest
# ---- Verify: repository code on the signed files; no secrets ---------------
verify-macos:
needs: [plan, sign-macos]
if: ${{ !cancelled() && needs.sign-macos.result == 'success' }}
strategy: *mac-strategy
runs-on: ${{ matrix.host }}
timeout-minutes: 30
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: ./.github/release/download
with:
pattern: sign-opencode-rune-macos-${{ matrix.arch }}
digests: sign-opencode-rune-macos-${{ matrix.arch }}=${{ needs.sign-macos.outputs[format('digest-{0}', matrix.arch)] }}
- name: Verify signed app, updater archives (.tar.zst and .zip), and DMG
run: |
stem="$RUNNER_TEMP/in/sign-opencode-rune-macos-${{ matrix.arch }}/OpenCode-Rune-$OPENCODE_RUNE_VERSION-macos-${{ matrix.arch }}"
dmg="$stem.dmg"
zip="$stem.zip"
tar_zst="$stem.tar.zst"
[ -f "$tar_zst" ] || { echo "::error::Missing $tar_zst." >&2; exit 1; }
xcrun stapler validate "$dmg"
spctl --assess --type open --context context:primary-signature --verbose=2 "$dmg"
check=$(mktemp -d)
hdiutil attach -quiet -nobrowse -readonly -mountpoint "$check/dmg" "$dmg"
/usr/bin/ditto -x -k "$zip" "$check/update"
tar_types=$(zstd -dc "$tar_zst" | /usr/bin/tar -tvf - | awk '{print substr($1,1,1)}' | sort -u)
if [ -z "$tar_types" ] || printf '%s\n' "$tar_types" | grep -qvE '^[-dl]$'; then
echo "::error::$tar_zst contains empty or disallowed tar entry types (only -, d, l are permitted): $tar_types" >&2
exit 1
fi
mkdir -p "$check/zst"
zstd -dc "$tar_zst" | /usr/bin/tar -xf - -C "$check/zst"
apps/desktop/scripts/validate-app.sh "$check/dmg/OpenCode (Rune).app" "$OPENCODE_RUNE_VERSION" "$OPENCODE_RUNE_BUILD_CHANNEL"
apps/desktop/scripts/validate-app.sh "$check/update/OpenCode (Rune).app" "$OPENCODE_RUNE_VERSION" "$OPENCODE_RUNE_BUILD_CHANNEL"
apps/desktop/scripts/validate-app.sh "$check/zst/OpenCode (Rune).app" "$OPENCODE_RUNE_VERSION" "$OPENCODE_RUNE_BUILD_CHANNEL"
xcrun stapler validate "$check/update/OpenCode (Rune).app"
xcrun stapler validate "$check/zst/OpenCode (Rune).app"
codesign --verify --deep --strict -R="$(cat apps/desktop/update-requirement.txt)" "$check/update/OpenCode (Rune).app"
codesign --verify --deep --strict -R="$(cat apps/desktop/update-requirement.txt)" "$check/zst/OpenCode (Rune).app"
spctl --assess --type execute --verbose=2 "$check/dmg/OpenCode (Rune).app"
spctl --assess --type execute --verbose=2 "$check/zst/OpenCode (Rune).app"
diff -qr "$check/dmg/OpenCode (Rune).app" "$check/update/OpenCode (Rune).app"
diff -qr "$check/dmg/OpenCode (Rune).app" "$check/zst/OpenCode (Rune).app"
OPENCODE_RUNE_SMOKE_HEADLESS=1 apps/desktop/scripts/smoke-app.sh "$check/dmg/OpenCode (Rune).app"
hdiutil detach -quiet "$check/dmg" || hdiutil detach -force -quiet "$check/dmg"
codesign -dv "$check/zst/OpenCode (Rune).app" 2>&1 | grep -E '^(Identifier|TeamIdentifier|Authority=Developer)' >> "$GITHUB_STEP_SUMMARY"
# The publisher every signed file carries must be the one the updater checks, read from the app.
verify-windows:
needs: [plan, sign-windows-setup]
if: ${{ !cancelled() && needs.sign-windows-setup.result == 'success' }}
runs-on: blacksmith-4vcpu-windows-2025
timeout-minutes: 20
env:
OPENCODE_RUNE_VERSION: ${{ needs.plan.outputs.release-version }}
OPENCODE_RUNE_BUILD_CHANNEL: ${{ needs.plan.outputs.release-channel }}
ARCHES: x64 arm64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
sparse-checkout: |
/.github/release/
/features/updater/src/windows.rs
sparse-checkout-cone-mode: false
persist-credentials: false
- uses: ./.github/release/download
with:
pattern: sign-opencode-rune-windows
digests: sign-opencode-rune-windows=${{ needs.sign-windows-setup.outputs.digest }}
- name: Verify the signed install folders and setups
shell: pwsh
run: |
$in = "$env:RUNNER_TEMP/in/sign-opencode-rune-windows"
$publisher = [regex]::Match((Get-Content -Raw features/updater/src/windows.rs), 'pub const EXPECTED_PUBLISHER: &str = "([^"]+)";').Groups[1].Value
if (-not $publisher) { throw 'Could not read EXPECTED_PUBLISHER from features/updater/src/windows.rs.' }
$tarExe = Join-Path $env:SystemRoot 'System32\tar.exe'
foreach ($arch in $env:ARCHES -split ' ') {
foreach ($name in "OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-$arch.zip", "OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-$arch.tar.zst", "OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-$arch-setup.exe") {
if (-not (Test-Path -LiteralPath "$in/$name")) { throw "The signed artifact has no $name." }
}
}
.github/release/opencode-rune-verify-windows.ps1 -Folders $in -Publisher $publisher
foreach ($arch in $env:ARCHES -split ' ') {
$zstPath = "$in/OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-$arch.tar.zst"
$tarList = @(& $tarExe -tvf $zstPath)
if ($LASTEXITCODE -ne 0 -or $tarList.Count -eq 0) { throw "Could not inspect windows-$arch tar.zst." }
foreach ($line in $tarList) {
$modeChar = if ($line.Length -gt 0) { $line.Substring(0, 1) } else { '' }
if ($modeChar -ne '-' -and $modeChar -ne 'd') {
throw "windows-$arch .tar.zst contains disallowed tar entry type '$modeChar': $line"
}
}
$zipDir = Join-Path $env:RUNNER_TEMP "verify-zip-$arch"
$zstDir = Join-Path $env:RUNNER_TEMP "verify-zst-$arch"
New-Item -ItemType Directory -Force -Path $zipDir, $zstDir | Out-Null
Expand-Archive -LiteralPath "$in/OpenCode-Rune-$env:OPENCODE_RUNE_VERSION-windows-$arch.zip" -DestinationPath $zipDir
& $tarExe -xf $zstPath -C $zstDir
if ($LASTEXITCODE -ne 0) { throw "Could not unpack windows-$arch tar.zst." }
$zipTree = @(Get-ChildItem -LiteralPath $zipDir -Recurse -File | ForEach-Object { "$($_.FullName.Substring($zipDir.Length + 1).Replace('\', '/')):$((Get-FileHash -Algorithm SHA256 -LiteralPath $_.FullName).Hash)" } | Sort-Object)
$zstTree = @(Get-ChildItem -LiteralPath $zstDir -Recurse -File | ForEach-Object { "$($_.FullName.Substring($zstDir.Length + 1).Replace('\', '/')):$((Get-FileHash -Algorithm SHA256 -LiteralPath $_.FullName).Hash)" } | Sort-Object)
if (($zipTree -join "`n") -ne ($zstTree -join "`n")) {
throw "windows-$arch .tar.zst contents differ from .zip."
}
}
$app = Join-Path $env:RUNNER_TEMP 'verify-zst-x64'
$reported = (& "$app/opencode-desktop.exe" --version | Out-String).Trim()
if ($reported -ne "opencode-rune $env:OPENCODE_RUNE_VERSION ($env:OPENCODE_RUNE_BUILD_CHANNEL)") { throw "opencode-desktop --version reported '$reported'." }
"Windows: every program and library in the tar.zst and zip, and the setup, is signed by $publisher ($reported)." >> $env:GITHUB_STEP_SUMMARY
# ---- Browser CEF runtime: build (only when CEF version in Cargo.lock changes) ----
# Produces unsigned CEF runtime bundles (no Rust build). Runs only when plan finds
# browser-engine/stable.json lacks this commit's *-cef targets for <cef> (or on check).
build-cef-windows:
needs: [plan, credentials]
if: ${{ needs.plan.outputs.build-cef == 'true' }}
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
runs-on: blacksmith-8vcpu-windows-2025
timeout-minutes: 45
outputs: *arch-digests
steps:
- *build-checkout
- name: Stage Windows CEF runtime (no Cargo build)
shell: pwsh
run: |
$stageOut = Join-Path $env:RUNNER_TEMP 'stage'
$tarOut = Join-Path $env:RUNNER_TEMP 'cef'
New-Item -ItemType Directory -Force -Path $stageOut, $tarOut | Out-Null
apps/browser-engine/scripts/package-windows.ps1 -Arch ${{ matrix.arch }} -Component Cef -Out $stageOut -StageOnly
& "$env:SystemRoot\System32\tar.exe" -cf "$tarOut/cef-windows-${{ matrix.arch }}.tar" -C "$stageOut/stage-cef-${{ matrix.arch }}" "OpenCode Browser Engine"
if ($LASTEXITCODE -ne 0) { throw 'Failed to pack Windows CEF runtime stage.' }
- id: upload
uses: ./.github/release/upload
with:
name: build-cef-windows-${{ matrix.arch }}
path: ${{ runner.temp }}/cef
retention-days: "7"
- *report-digest
build-cef-macos:
needs: [plan, credentials]
if: ${{ needs.plan.outputs.build-cef == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- { arch: arm64, host: blacksmith-6vcpu-macos-26 }
- { arch: x64, host: macos-26-intel }
runs-on: ${{ matrix.host }}
timeout-minutes: 45
outputs: *arch-digests
steps:
- *build-checkout
- name: Assemble unsigned macOS ${{ matrix.arch }} CEF framework (no Cargo build)
run: |
mkdir -p "$RUNNER_TEMP/macos"
bash apps/browser-engine/scripts/package-release.sh --arch "${{ matrix.arch }}" --component cef --assemble-only "$RUNNER_TEMP/macos/Chromium-Embedded-Framework.zip"
- id: upload
uses: ./.github/release/upload
with:
name: build-cef-macos-${{ matrix.arch }}
path: ${{ runner.temp }}/macos
retention-days: "7"
- *report-digest
build-cef-linux:
needs: [plan, credentials]
if: ${{ needs.plan.outputs.build-cef == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- { arch: x64, host: blacksmith-4vcpu-ubuntu-2404 }
- { arch: arm64, host: blacksmith-4vcpu-ubuntu-2404-arm }
runs-on: ${{ matrix.host }}
timeout-minutes: 45
env:
CEF_VERSION: ${{ needs.plan.outputs.cef-version }}
outputs:
digest-x64: ${{ steps.digest.outputs.digest-x64 }}
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
sha256-x64: ${{ steps.archive-hash.outputs.sha256-x64 }}
sha256-arm64: ${{ steps.archive-hash.outputs.sha256-arm64 }}
steps:
- *build-checkout
- name: Install Linux CEF packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends binutils bzip2 curl jq zstd
- id: package-cef-linux
name: Package Linux ${{ matrix.arch }} CEF runtime (no Cargo build)
run: bash apps/browser-engine/scripts/package-linux.sh --arch "${{ matrix.arch }}" --component cef "$RUNNER_TEMP/cef"
- id: upload
uses: ./.github/release/upload
with:
name: build-cef-linux-${{ matrix.arch }}
path: ${{ runner.temp }}/cef
retention-days: "7"
- *report-digest
- id: archive-hash
name: Report Linux ${{ matrix.arch }} CEF archive sha256
run: |
archive="OpenCode-Browser-CEF-$CEF_VERSION-linux-${{ matrix.arch }}.tar.zst"
sha=$(awk -v f="$archive" 'substr($0, 67) == f { print $1 }' "$RUNNER_TEMP/cef/SHA256SUMS")
[[ "$sha" =~ ^[0-9a-f]{64}$ ]] || { echo "::error::Missing $archive in SHA256SUMS." >&2; exit 1; }
echo "sha256-${{ matrix.arch }}=$sha" >> "$GITHUB_OUTPUT"
# ---- Browser CEF runtime: sign (release environment; /.github/release/ only) ----
sign-cef-windows:
needs: [plan, build-cef-windows]
runs-on: blacksmith-4vcpu-windows-2025
timeout-minutes: 45
environment: release
permissions:
contents: read
id-token: write
env:
CEF_VERSION: ${{ needs.plan.outputs.cef-version }}
ARCHES: x64 arm64
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
outputs:
digest: ${{ steps.upload.outputs.digest }}
steps:
- *checkout-release
- name: Download unsigned Windows CEF runtimes
uses: ./.github/release/download
with:
pattern: build-cef-windows-*
digests: >-
build-cef-windows-x64=${{ needs.build-cef-windows.outputs.digest-x64 }}
build-cef-windows-arm64=${{ needs.build-cef-windows.outputs.digest-arm64 }}
- name: Unpack and verify Windows CEF PE allowlist
shell: pwsh
run: |
foreach ($arch in $env:ARCHES -split ' ') {
.github/release/opencode-rune-package-engine-windows.ps1 `
-Mode Unpack `
-Component Cef `
-Arch $arch `
-WorkDir "$env:RUNNER_TEMP/work" `
-InputTar "$env:RUNNER_TEMP/in/build-cef-windows-$arch/cef-windows-$arch.tar"
}
- *azure-login
- name: Sign Windows CEF runtimes
uses: azure/artifact-signing-action@c7ab2a863ab5f9a846ddb8265964877ef296ee82 # v2
with:
endpoint: ${{ env.AZURE_TRUSTED_SIGNING_ENDPOINT }}
signing-account-name: ${{ env.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ env.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
files-folder: ${{ runner.temp }}\work
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
description: OpenCode Browser CEF Runtime
description-url: https://github.com/anomalyco/opencode-rune
exclude-environment-credential: true
exclude-workload-identity-credential: true
exclude-managed-identity-credential: true
exclude-shared-token-cache-credential: true
exclude-visual-studio-credential: true
exclude-visual-studio-code-credential: true
exclude-azure-cli-credential: false
exclude-azure-powershell-credential: true
exclude-azure-developer-cli-credential: true
exclude-interactive-browser-credential: true
cache-dependencies: false
- name: Check Windows CEF signatures
shell: pwsh
run: .github/release/opencode-rune-verify-windows.ps1 -Folders "$env:RUNNER_TEMP/work" -Publisher "Anomaly Innovations, Inc https://anoma.ly/"
- name: Archive signed Windows CEF runtimes
shell: pwsh
run: |
foreach ($arch in $env:ARCHES -split ' ') {
.github/release/opencode-rune-package-engine-windows.ps1 `
-Mode Archive `
-Component Cef `
-Arch $arch `
-WorkDir "$env:RUNNER_TEMP/work" `
-OutDir "$env:RUNNER_TEMP/out" `
-Version $env:CEF_VERSION
}
- id: upload
uses: ./.github/release/upload
with:
name: sign-cef-windows
path: ${{ runner.temp }}/out
sign-cef-macos:
needs: [plan, build-cef-macos]
strategy:
fail-fast: false
matrix:
include:
- { arch: arm64, host: blacksmith-6vcpu-macos-26 }
- { arch: x64, host: macos-26-intel }
runs-on: blacksmith-6vcpu-macos-26
timeout-minutes: 60
environment: release
permissions:
contents: read
id-token: write
env:
CEF_VERSION: ${{ needs.plan.outputs.cef-version }}
outputs: *arch-digests
steps:
- *checkout-release
- name: Download unsigned macOS ${{ matrix.arch }} CEF framework
uses: ./.github/release/download
with:
pattern: build-cef-macos-${{ matrix.arch }}
digests: build-cef-macos-${{ matrix.arch }}=${{ needs.build-cef-macos.outputs[format('digest-{0}', matrix.arch)] }}
- id: aws
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
with:
role-to-assume: arn:aws:iam::604439173067:role/github/opencode-rune-release
role-session-name: opencode-rune-cef-${{ matrix.arch }}-${{ github.run_id }}
role-duration-seconds: 900
aws-region: us-east-1
output-env-credentials: false
output-credentials: true
- name: Import the certificate and notary key
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws.outputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ steps.aws.outputs.aws-secret-access-key }}
AWS_SESSION_TOKEN: ${{ steps.aws.outputs.aws-session-token }}
run: |
bash .github/release/with-secrets.sh \
APPLE_SIGNING_CERTIFICATE=shared/APPLE_SIGNING_CERTIFICATE \
APPLE_NOTARY_KEY=shared/APPLE_NOTARY_KEY \
-- bash .github/release/macos-credentials.sh "$RUNNER_TEMP/credentials"
- name: Sign and notarize macOS ${{ matrix.arch }} CEF framework
run: bash .github/release/opencode-rune-sign-engine-macos.sh --component cef "$RUNNER_TEMP/in/build-cef-macos-${{ matrix.arch }}/Chromium-Embedded-Framework.zip" "$RUNNER_TEMP/out" "${{ matrix.arch }}"
env:
SEER_NOTARY_KEY_ID: ${{ vars.APPLE_NOTARY_KEY_ID }}
SEER_NOTARY_ISSUER: ${{ vars.APPLE_NOTARY_ISSUER_ID }}
- name: Remove the credentials
if: always()
run: |