Repository navigation
1112 lines (1005 loc) · 51.9 KB
/
Copy pathpublish.yml
File metadata and controls
1112 lines (1005 loc) · 51.9 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: publish
run-name: "${{ format('release {0}', inputs.bump) }}"
on:
push:
branches:
- main
# Pushing (or moving) a vX.Y.Z tag releases that version.
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
bump:
description: "Bump major, minor, or patch"
required: false
type: choice
options:
- major
- minor
- patch
version:
description: "Override version (optional)"
required: false
type: string
qualification_run_id:
description: "Completed candidate-SHA qualification run carrying release-qualification-v2 (required for release GO)"
required: false
type: string
# main, tag and manual runs share the same release draft and refs.
concurrency:
group: publish-${{ github.repository }}
cancel-in-progress: false
permissions:
actions: read
id-token: write
contents: write
packages: write
jobs:
version:
runs-on: ubuntu-24.04
if: github.repository == 'deepagent-ltd/deepagent-code'
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- uses: ./.github/actions/setup-bun
- name: Resolve the committed release version
id: version-input
run: bun script/resolve-publish-version.ts
env:
DAC_PUBLISH_REF: ${{ github.ref }}
DAC_PUBLISH_VERSION: ${{ inputs.version }}
DAC_PUBLISH_BUMP: ${{ inputs.bump }}
- name: Setup git committer
id: committer
# Use the job token here: generated candidate/tag refs must not start another publish run.
uses: ./.github/actions/setup-git-committer
- id: version
run: |
./script/version.ts
env:
GH_TOKEN: ${{ steps.committer.outputs.token }}
DEEPAGENT_CODE_BUMP: ${{ steps.version-input.outputs.bump }}
DEEPAGENT_CODE_VERSION: ${{ steps.version-input.outputs.version }}
DEEPAGENT_CODE_CHANNEL: ${{ steps.version-input.outputs.channel }}
DEEPAGENT_CODE_API_KEY: ${{ secrets.DEEPAGENT_CODE_API_KEY }}
GH_REPO: ${{ (github.ref_name == 'beta' && 'deepagent-ltd/deepagent-code-beta') || github.repository }}
outputs:
version: ${{ steps.version.outputs.version }}
release: ${{ steps.version.outputs.release }}
tag: ${{ steps.version.outputs.tag }}
repo: ${{ steps.version.outputs.repo }}
candidate_commit: ${{ steps.version.outputs.candidate_commit }}
candidate_tree: ${{ steps.version.outputs.candidate_tree }}
channel: ${{ steps.version.outputs.channel }}
build-cli:
needs: version
runs-on: ubuntu-24.04
if: github.repository == 'deepagent-ltd/deepagent-code'
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
fetch-tags: true
- uses: ./.github/actions/setup-bun
- name: Setup git committer
id: committer
uses: ./.github/actions/setup-git-committer
with:
deepagent-code-app-id: ${{ vars.DEEPAGENT_CODE_APP_ID }}
deepagent-code-app-secret: ${{ secrets.DEEPAGENT_CODE_APP_SECRET }}
# Owner authorization (2026-09-11 ruling): mint with a ONE-TIME Ed25519 pair BEFORE the
# binaries build — the public half is pinned into this exact build via the
# DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY define and the private half dies with the mint
# process. No signing secret exists anywhere. The row never expires (no forced updates).
- name: Mint V2 owner authorization (ephemeral per-release)
id: mint-owner
working-directory: packages/deepagent-code
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
run: |
bun install
bun script/mint-owner-campaign.ts --ephemeral \
--build-identity "$DEEPAGENT_CODE_VERSION" \
--db "$RUNNER_TEMP/mint.db" \
--export "$RUNNER_TEMP/owner-authorization.json" \
| tee "$RUNNER_TEMP/mint-result.json"
jq -r '.public_key_pem' "$RUNNER_TEMP/mint-result.json" > "$RUNNER_TEMP/release-owner-public-key.pem"
test -s "$RUNNER_TEMP/release-owner-public-key.pem"
- name: Prepare Linux CLI Rust targets and musl linker
run: |
rustup target add x86_64-unknown-linux-gnu x86_64-unknown-linux-musl
sudo apt-get update
sudo apt-get install -y --no-install-recommends musl-tools
test -x /usr/bin/musl-gcc
rustup target list --installed
- name: Build (release identity pinned)
id: build
run: |
./packages/deepagent-code/script/build.ts --exclude-win32 --exclude-darwin ${{ (needs.version.outputs.channel == 'beta' && '--sourcemaps') || '' }}
./packages/cli/script/build.ts ${{ (needs.version.outputs.channel == 'beta' && '--sourcemaps') || '' }}
# Ship the authorization row at every binary's appRoot (dirname of the executable —
# V2OwnerSeed.defaultOwnerAuthorizationAppRoot) so default installs self-qualify.
for dir in packages/deepagent-code/dist/deepagent-code-*/bin packages/cli/dist/*/bin; do
[ -d "$dir" ] && cp "$RUNNER_TEMP/owner-authorization.json" "$dir/owner-authorization.json"
done
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_CHANNEL: ${{ needs.version.outputs.channel }}
DEEPAGENT_CODE_RELEASE: ${{ needs.version.outputs.release }}
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: /usr/bin/musl-gcc
DEEPAGENT_CODE_RELEASE_OWNER_AUTHORIZATION_FILE: ${{ runner.temp }}/owner-authorization.json
DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY: ${{ runner.temp }}/release-owner-public-key.pem
GH_REPO: ${{ needs.version.outputs.repo }}
GH_TOKEN: ${{ steps.committer.outputs.token }}
- name: Verify frozen CLI release candidate
if: needs.version.outputs.release
env:
GH_TOKEN: ${{ steps.committer.outputs.token }}
run: |
bun script/assert-release-candidate.ts \
--commit "${{ needs.version.outputs.candidate_commit }}" \
--tree "${{ needs.version.outputs.candidate_tree }}" \
--tag "v${{ needs.version.outputs.version }}" \
--release-id "${{ needs.version.outputs.release }}" \
--release-repo "${{ needs.version.outputs.repo }}" \
--package-dir packages/deepagent-code/dist/deepagent-code-linux-x64
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: owner-authorization
path: ${{ runner.temp }}/owner-authorization.json
if-no-files-found: warn
# Public half of the ephemeral release owner key: the native Windows build job pins the
# same key into its binaries via DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY, keeping one
# build identity across every platform artifact. Public material — safe as an artifact.
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release-owner-public-key
path: ${{ runner.temp }}/release-owner-public-key.pem
if-no-files-found: warn
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-cli
path: |
packages/deepagent-code/dist/deepagent-code-linux*
packages/deepagent-code/dist/deepagent-code-linux*.tar.gz
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-preview-cli
path: packages/cli/dist/cli-*
outputs:
version: ${{ needs.version.outputs.version }}
build-cli-macos:
needs:
- version
- build-cli
if: github.repository == 'deepagent-ltd/deepagent-code'
strategy:
fail-fast: false
matrix:
include:
- host: macos-15-intel
arch: x64
rust_target: x86_64-apple-darwin
- host: macos-26
arch: arm64
rust_target: aarch64-apple-darwin
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
fetch-tags: true
- name: Validate macOS release signing credentials
if: needs.version.outputs.release != ''
shell: bash
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_CSC_NAME: ${{ secrets.APPLE_CSC_NAME }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
for name in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_CSC_NAME APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID; do
if [[ -z "${!name}" ]]; then
echo "::error::Missing macOS release signing credential: $name"
exit 1
fi
done
- uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
if: needs.version.outputs.release != ''
with:
keychain: build
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- uses: ./.github/actions/setup-bun
with:
install-flags: --os=darwin --cpu=${{ matrix.arch }}
- name: Prepare matching Apple Rust target
env:
DAC_CLI_ARCH: ${{ matrix.arch }}
DAC_CLI_RUST_TARGET: ${{ matrix.rust_target }}
run: |
test "$(bun -p 'process.arch')" = "$DAC_CLI_ARCH"
xcrun --find clang
rustup target add "$DAC_CLI_RUST_TARGET"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: owner-authorization
path: ${{ runner.temp }}/owner-auth
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: release-owner-public-key
path: ${{ runner.temp }}/owner-key
- name: Prepare this job's Native CLI publisher
run: bun packages/desktop/scripts/native-publisher.ts prepare
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DAC_NATIVE_APPLE_SIGNED: ${{ needs.version.outputs.release != '' && '1' || '0' }}
CSC_NAME: ${{ secrets.APPLE_CSC_NAME }}
- name: Build native macOS CLI and sign final executable bytes
run: |
bun packages/deepagent-code/script/build.ts --single --baseline ${{ (needs.version.outputs.channel == 'beta' && '--sourcemaps') || '' }}
if [[ -n "$DEEPAGENT_CODE_NATIVE_ASSET_SIGN_IDENTITY" ]]; then
for file in packages/deepagent-code/dist/deepagent-code-darwin-*/bin/deepagent-code; do
/usr/bin/codesign --force --sign "$DEEPAGENT_CODE_NATIVE_ASSET_SIGN_IDENTITY" --options runtime \
--entitlements packages/deepagent-code/script/native-command-entitlements.plist --timestamp "$file"
/usr/bin/codesign --verify --strict "$file"
done
fi
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_CHANNEL: ${{ needs.version.outputs.channel }}
DEEPAGENT_CODE_RELEASE: ${{ needs.version.outputs.release }}
DEEPAGENT_CODE_RELEASE_OWNER_AUTHORIZATION_FILE: ${{ runner.temp }}/owner-auth/owner-authorization.json
DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY: ${{ runner.temp }}/owner-key/release-owner-public-key.pem
- name: Seal and verify final macOS CLI Native receipts
run: |
bun packages/desktop/scripts/native-publisher.ts seal-cli
for file in packages/deepagent-code/dist/deepagent-code-darwin-*/bin/deepagent-code; do
"$file" --version
dir="${file%/bin/deepagent-code}"
if [[ -n "$DEEPAGENT_CODE_RELEASE" ]]; then
(cd "$dir/bin" && zip -r -FS "../../$(basename "$dir").zip" .)
fi
done
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_RELEASE: ${{ needs.version.outputs.release }}
DEEPAGENT_CODE_CANDIDATE_COMMIT: ${{ needs.version.outputs.candidate_commit }}
DEEPAGENT_CODE_CANDIDATE_TREE: ${{ needs.version.outputs.candidate_tree }}
- name: Destroy this job's private Native CLI publisher
if: always()
run: bun packages/desktop/scripts/native-publisher.ts cleanup
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-cli-darwin-${{ matrix.arch }}
path: packages/deepagent-code/dist/deepagent-code-darwin*
if-no-files-found: error
# Windows binaries build NATIVELY on a Windows runner: bun cross-compilation with the large
# embedded web UI produced non-starting Windows PEs when the build host was macOS (verified on
# the acceptance box), and native builds have been validated end-to-end there dozens of times.
# The build script's own smoke test actually executes the exe here, so a broken build fails CI.
build-cli-windows:
needs:
- version
- build-cli
runs-on: windows-2025
if: github.repository == 'deepagent-ltd/deepagent-code'
env:
HAS_TRUSTED_SIGNING: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT != '' && secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME != '' && secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE != '' && secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_TENANT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID != '' }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
fetch-tags: true
- uses: ./.github/actions/setup-bun
- name: Setup git committer
id: committer
uses: ./.github/actions/setup-git-committer
with:
deepagent-code-app-id: ${{ vars.DEEPAGENT_CODE_APP_ID }}
deepagent-code-app-secret: ${{ secrets.DEEPAGENT_CODE_APP_SECRET }}
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: owner-authorization
path: ${{ runner.temp }}/owner-auth
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: release-owner-public-key
path: ${{ runner.temp }}/owner-key
- name: Prepare this job's Native CLI publisher
run: bun packages/desktop/scripts/native-publisher.ts prepare
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
- name: Build (release identity pinned, native)
shell: bash
run: |
cd packages/deepagent-code
bun script/build.ts --single --baseline ${{ (needs.version.outputs.channel == 'beta' && '--sourcemaps') || '' }}
for dir in dist/deepagent-code-*/bin; do
[ -d "$dir" ] && cp "$RUNNER_TEMP/owner-auth/owner-authorization.json" "$dir/owner-authorization.json"
done
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_CHANNEL: ${{ needs.version.outputs.channel }}
DEEPAGENT_CODE_RELEASE: ${{ needs.version.outputs.release }}
DEEPAGENT_CODE_RELEASE_OWNER_AUTHORIZATION_FILE: ${{ runner.temp }}/owner-auth/owner-authorization.json
DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY: ${{ runner.temp }}/owner-key/release-owner-public-key.pem
GH_REPO: ${{ needs.version.outputs.repo }}
GH_TOKEN: ${{ steps.committer.outputs.token }}
- name: Azure login
if: env.HAS_TRUSTED_SIGNING == 'true'
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
- uses: azure/artifact-signing-action@b443cf8ea4124818d2ea9f043cba29fc3ec47b16 # v1.2.0
if: env.HAS_TRUSTED_SIGNING == 'true'
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: |
${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64\bin\deepagent-code.exe
${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64-baseline\bin\deepagent-code.exe
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
- name: Verify Windows CLI signatures
if: env.HAS_TRUSTED_SIGNING == 'true'
shell: pwsh
run: |
$files = @(
"${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64\bin\deepagent-code.exe",
"${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64-baseline\bin\deepagent-code.exe"
)
foreach ($file in $files) {
$sig = Get-AuthenticodeSignature $file
if ($sig.Status -ne "Valid") {
throw "Invalid signature for ${file}: $($sig.Status)"
}
}
- name: Report unsigned Windows artifacts
if: env.HAS_TRUSTED_SIGNING != 'true'
shell: pwsh
run: Write-Host "Azure Trusted Signing is not configured; using unsigned Windows artifacts"
- name: Seal and verify final Windows CLI Native receipts
shell: pwsh
run: |
bun packages/desktop/scripts/native-publisher.ts seal-cli
if ($LASTEXITCODE -ne 0) { throw "Native CLI issuance failed" }
foreach ($file in Get-ChildItem packages/deepagent-code/dist/deepagent-code-windows-*/bin/deepagent-code.exe) {
& $file.FullName --version
if ($LASTEXITCODE -ne 0) { throw "Final Windows CLI startup failed" }
}
env:
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_CANDIDATE_COMMIT: ${{ needs.version.outputs.candidate_commit }}
DEEPAGENT_CODE_CANDIDATE_TREE: ${{ needs.version.outputs.candidate_tree }}
- name: Destroy this job's private Native CLI publisher
if: always()
run: bun packages/desktop/scripts/native-publisher.ts cleanup
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-cli-windows
path: packages/deepagent-code/dist/deepagent-code-windows*
sign-cli-windows:
needs:
- build-cli-windows
- version
runs-on: windows-2025
if: github.repository == 'deepagent-ltd/deepagent-code'
env:
HAS_TRUSTED_SIGNING: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT != '' && secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME != '' && secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE != '' && secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_TENANT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID != '' }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: deepagent-code-cli-windows
path: packages/deepagent-code/dist
- name: Setup git committer
id: committer
uses: ./.github/actions/setup-git-committer
with:
deepagent-code-app-id: ${{ vars.DEEPAGENT_CODE_APP_ID }}
deepagent-code-app-secret: ${{ secrets.DEEPAGENT_CODE_APP_SECRET }}
- name: Verify Windows CLI signatures
if: env.HAS_TRUSTED_SIGNING == 'true'
shell: pwsh
run: |
$files = @(
"${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64\bin\deepagent-code.exe",
"${{ github.workspace }}\packages\deepagent-code\dist\deepagent-code-windows-x64-baseline\bin\deepagent-code.exe"
)
foreach ($file in $files) {
$sig = Get-AuthenticodeSignature $file
if ($sig.Status -ne "Valid") {
throw "Invalid signature for ${file}: $($sig.Status)"
}
}
- name: Report unsigned Windows artifacts
if: env.HAS_TRUSTED_SIGNING != 'true'
shell: pwsh
run: Write-Host "Azure Trusted Signing is not configured; using unsigned Windows artifacts"
- name: Repack Windows CLI archives
working-directory: packages/deepagent-code/dist
shell: pwsh
run: |
Compress-Archive -Path "deepagent-code-windows-x64\bin\*" -DestinationPath "deepagent-code-windows-x64.zip" -Force
Compress-Archive -Path "deepagent-code-windows-x64-baseline\bin\*" -DestinationPath "deepagent-code-windows-x64-baseline.zip" -Force
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-cli-signed-windows
path: |
packages/deepagent-code/dist/deepagent-code-windows-x64
packages/deepagent-code/dist/deepagent-code-windows-x64-baseline
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: needs.version.outputs.release
with:
name: deepagent-code-cli-signed-windows-archives
path: packages/deepagent-code/dist/deepagent-code-windows*.zip
build-electron:
needs:
- build-cli
- build-cli-windows
- version
if: github.repository == 'deepagent-ltd/deepagent-code'
continue-on-error: false
env:
HAS_TRUSTED_SIGNING: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT != '' && secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME != '' && secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE != '' && secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_TENANT_ID != '' && secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID != '' }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_TRUSTED_SIGNING_SUBSCRIPTION_ID }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
strategy:
fail-fast: false
matrix:
settings:
- host: macos-15-intel
target: x86_64-apple-darwin
platform_flag: --mac --x64
bun_install_flags: --os=darwin --cpu=x64
- host: macos-26
target: aarch64-apple-darwin
platform_flag: --mac --arm64
bun_install_flags: --os=darwin --cpu=arm64
- host: "windows-2025"
target: x86_64-pc-windows-msvc
platform_flag: --win
- host: "ubuntu-24.04"
target: x86_64-unknown-linux-gnu
platform_flag: --linux
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
- name: Validate macOS release signing credentials
if: runner.os == 'macOS' && needs.version.outputs.release != ''
shell: bash
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_CSC_NAME: ${{ secrets.APPLE_CSC_NAME }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
for name in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_CSC_NAME APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID; do
if [[ -z "${!name}" ]]; then
echo "::error::Missing macOS release signing credential: $name"
exit 1
fi
done
- uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
if: runner.os == 'macOS' && needs.version.outputs.release != ''
with:
keychain: build
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- uses: ./.github/actions/setup-bun
with:
install-flags: ${{ matrix.settings.bun_install_flags }}
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: ${{ matrix.settings.target == 'aarch64-apple-darwin' && '1' || '' }}
- name: Azure login
if: runner.os == 'Windows' && env.HAS_TRUSTED_SIGNING == 'true'
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Download Electron runtime for macOS arm64
if: matrix.settings.target == 'aarch64-apple-darwin'
working-directory: packages/desktop
shell: bash
run: |
for attempt in 1 2 3; do
echo "Electron download attempt $attempt/3"
if node node_modules/electron/install.js &&
node -e 'require("node:fs").accessSync(require("electron"))'; then
exit 0
fi
if [ "$attempt" -eq 3 ]; then
echo "::error::Electron runtime download failed after 3 attempts; check access to Electron release assets"
exit 1
fi
sleep $((attempt * 15))
done
- name: Cache apt packages
if: contains(matrix.settings.host, 'ubuntu')
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/apt-cache
key: ${{ runner.os }}-${{ matrix.settings.target }}-apt-electron-${{ hashFiles('.github/workflows/publish.yml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.settings.target }}-apt-electron-
- name: Install dependencies (ubuntu only)
if: contains(matrix.settings.host, 'ubuntu')
run: |
mkdir -p ~/apt-cache && chmod -R a+rw ~/apt-cache
sudo apt-get update
sudo apt-get install -y --no-install-recommends -o dir::cache::archives="$HOME/apt-cache" rpm
sudo chmod -R a+rw ~/apt-cache
- name: Setup git committer
id: committer
uses: ./.github/actions/setup-git-committer
with:
deepagent-code-app-id: ${{ vars.DEEPAGENT_CODE_APP_ID }}
deepagent-code-app-secret: ${{ secrets.DEEPAGENT_CODE_APP_SECRET }}
- name: Verify Windows browser file stages
if: runner.os == 'Windows'
shell: pwsh
timeout-minutes: 5
run: ./.github/scripts/test-windows-browser-file-stages.ps1
# Reuse the release's single owner issuance pair across every Desktop target.
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: owner-authorization
path: ${{ runner.temp }}/owner-auth
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: release-owner-public-key
path: ${{ runner.temp }}/owner-key
- name: Build, package and verify Desktop Native assets
uses: ./.github/actions/package-desktop
timeout-minutes: 90
with:
version: ${{ needs.version.outputs.version }}
channel: ${{ (needs.version.outputs.channel == 'beta' && 'beta') || 'prod' }}
platform-flags: ${{ matrix.settings.platform_flag }}
prepare: "true"
macos-signed: ${{ runner.os == 'macOS' && needs.version.outputs.release != '' }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}
SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }}
VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }}
VITE_SENTRY_ENVIRONMENT: ${{ (github.ref_name == 'beta' && 'beta') || 'production' }}
VITE_SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }}
DEEPAGENT_CODE_CLI_ARTIFACT: ${{ (runner.os == 'Windows' && 'deepagent-code-cli-windows') || 'deepagent-code-cli' }}
DEEPAGENT_CODE_RELEASE_OWNER_AUTHORIZATION_FILE: ${{ runner.temp }}/owner-auth/owner-authorization.json
DEEPAGENT_CODE_RELEASE_OWNER_PUBLIC_KEY: ${{ runner.temp }}/owner-key/release-owner-public-key.pem
RUST_TARGET: ${{ matrix.settings.target }}
GH_TOKEN: ${{ steps.committer.outputs.token }}
DEEPAGENT_CODE_ALLOW_UNSIGNED: ${{ runner.os == 'Windows' && env.HAS_TRUSTED_SIGNING != 'true' && '1' || '0' }}
# Match desktop-build: use the imported Developer ID and the existing
# Apple ID notarization secrets, without creating an empty API-key file.
CSC_NAME: ${{ runner.os == 'macOS' && needs.version.outputs.release != '' && secrets.APPLE_CSC_NAME || '' }}
APPLE_ID: ${{ runner.os == 'macOS' && needs.version.outputs.release != '' && secrets.APPLE_ID || '' }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ runner.os == 'macOS' && needs.version.outputs.release != '' && secrets.APPLE_APP_SPECIFIC_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ runner.os == 'macOS' && needs.version.outputs.release != '' && secrets.APPLE_TEAM_ID || '' }}
# Keep these functional gates identical to desktop-build: the shared action
# has already verified this job's packaged Native cohort, and no package is
# uploaded unless its existing platform smoke also succeeds.
- name: Smoke test packaged macOS app
if: runner.os == 'macOS'
working-directory: packages/desktop
shell: bash
run: |
executable=$(find dist -maxdepth 5 -type f -path '*/Contents/MacOS/DeepAgent Code*' -perm +111 -print -quit)
test -n "$executable"
DEEPAGENT_CODE_DESKTOP_EXECUTABLE="$executable" bun run test:subagents-cold-start
- name: Smoke test packaged Windows sidecar health
if: runner.os == 'Windows'
working-directory: packages/desktop
shell: pwsh
run: |
# win-unpacked holds the x64 app. Wildcard matches both prod ("DeepAgent Code.exe")
# and beta ("DeepAgent Code Beta.exe") artifact names so the beta build
# cannot silently fail this smoke because of an exact name filter.
$exe = Get-ChildItem -Path "dist/win-unpacked" -Filter "*DeepAgent Code*.exe" -Recurse -File | Select-Object -First 1
if (-not $exe) {
Write-Error "Packaged executable not found under dist/win-unpacked"
exit 1
}
$env:DEEPAGENT_CODE_DESKTOP_EXECUTABLE = $exe.FullName
$env:DEEPAGENT_CODE_SMOKE_PORT = "3188"
bun run test:sidecar-health-smoke
- name: Create macOS .app.tar.gz
if: runner.os == 'macOS' && needs.version.outputs.release
working-directory: packages/desktop/dist
run: |
if [[ "${{ matrix.settings.target }}" == "x86_64-apple-darwin" ]]; then
APP_DIR="mac"
OUT_NAME="deepagent-code-desktop-mac-x64.app.tar.gz"
elif [[ "${{ matrix.settings.target }}" == "aarch64-apple-darwin" ]]; then
APP_DIR="mac-arm64"
OUT_NAME="deepagent-code-desktop-mac-arm64.app.tar.gz"
else
echo "Unknown macOS target: ${{ matrix.settings.target }}"
exit 1
fi
APP_PATH=$(find "$APP_DIR" -maxdepth 1 -name "*.app" -type d | head -1)
if [ -z "$APP_PATH" ]; then
echo "No .app bundle found in $APP_DIR"
exit 1
fi
tar -czf "$OUT_NAME" -C "$(dirname "$APP_PATH")" "$(basename "$APP_PATH")"
- name: Verify signed Windows Electron artifacts
if: runner.os == 'Windows' && env.HAS_TRUSTED_SIGNING == 'true'
shell: pwsh
run: |
$files = @()
$files += Get-ChildItem "${{ github.workspace }}\packages\desktop\dist\*.exe" | Select-Object -ExpandProperty FullName
$files += Get-ChildItem "${{ github.workspace }}\packages\desktop\dist\*unpacked\*.exe" | Select-Object -ExpandProperty FullName
$files += Get-ChildItem "${{ github.workspace }}\packages\desktop\dist\*unpacked\resources\deepagent-code-cli.exe" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
foreach ($file in $files | Select-Object -Unique) {
$sig = Get-AuthenticodeSignature $file
if ($sig.Status -ne "Valid") {
throw "Invalid signature for ${file}: $($sig.Status)"
}
}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: deepagent-code-desktop-${{ matrix.settings.target }}
path: packages/desktop/dist/*
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: needs.version.outputs.release
with:
name: latest-yml-${{ matrix.settings.target }}
path: packages/desktop/dist/latest*.yml
publish:
needs:
- version
- build-cli
- build-cli-windows
- build-cli-macos
- sign-cli-windows
- build-electron
if: always() && !failure() && !cancelled() && needs.version.outputs.channel != 'beta'
runs-on: ubuntu-24.04
env:
GH_REPO: ${{ needs.version.outputs.repo }}
DEEPAGENT_CODE_VERSION: ${{ needs.version.outputs.version }}
DEEPAGENT_CODE_RELEASE: ${{ needs.version.outputs.release }}
DEEPAGENT_CODE_CANDIDATE_COMMIT: ${{ needs.version.outputs.candidate_commit }}
DEEPAGENT_CODE_CANDIDATE_TREE: ${{ needs.version.outputs.candidate_tree }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.version.outputs.candidate_commit }}
- uses: ./.github/actions/setup-bun
- name: Login to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: deepagent-code-cli
path: packages/deepagent-code/dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: deepagent-code-cli-darwin-*
path: packages/deepagent-code/dist
merge-multiple: true
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: deepagent-code-cli-windows
path: packages/deepagent-code/dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: deepagent-code-cli-signed-windows
path: packages/deepagent-code/dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
if: needs.version.outputs.release
with:
name: deepagent-code-cli-signed-windows-archives
path: /tmp/signed-cli-windows
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: deepagent-code-preview-cli
path: packages/cli/dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
continue-on-error: true
with:
name: owner-authorization
path: /tmp/owner-authorization
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
if: needs.version.outputs.release
with:
pattern: latest-yml-*
path: /tmp/latest-yml
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
if: needs.version.outputs.release
with:
pattern: deepagent-code-desktop-*
path: /tmp/desktop
merge-multiple: true
- name: Setup git committer
id: committer
uses: ./.github/actions/setup-git-committer
with:
deepagent-code-app-id: ${{ vars.DEEPAGENT_CODE_APP_ID }}
deepagent-code-app-secret: ${{ secrets.DEEPAGENT_CODE_APP_SECRET }}
- name: Build SDK from frozen release candidate
if: needs.version.outputs.release
env:
GH_TOKEN: ${{ steps.committer.outputs.token }}
run: |
./packages/sdk/js/script/build.ts
bun packages/sdk/js/script/verify-build.ts
bun script/assert-release-candidate.ts \
--commit "${{ needs.version.outputs.candidate_commit }}" \
--tree "${{ needs.version.outputs.candidate_tree }}" \
--tag "v${{ needs.version.outputs.version }}" \
--release-id "${{ needs.version.outputs.release }}" \
--release-repo "${{ needs.version.outputs.repo }}" \
--package-dir packages/deepagent-code/dist/deepagent-code-linux-x64
- name: Probe frozen packaged runtime
if: needs.version.outputs.release
run: |
mkdir -p "$RUNNER_TEMP/ri51-probe"
DEEPAGENT_CODE_OWNER_AUTHORIZATION="$PWD/packages/deepagent-code/dist/deepagent-code-linux-x64/bin/owner-authorization.json" \
bun packages/core/script/evidence-ledger/probe-packaged-runs.ts \
"$PWD/packages/deepagent-code/dist/deepagent-code-linux-x64/bin/deepagent-code" \
"$RUNNER_TEMP/ri51-probe/runs.json" \
"$RUNNER_TEMP/ri51-probe/home" \
"$RUNNER_TEMP/ri51-probe/evidence.json"
- name: Download reviewed G0-G8 qualification
if: needs.version.outputs.release && inputs.qualification_run_id != ''
env:
GH_TOKEN: ${{ github.token }}
QUALIFICATION_RUN_ID: ${{ inputs.qualification_run_id }}
GH_REPO: ${{ needs.version.outputs.repo }}
CANDIDATE_COMMIT: ${{ needs.version.outputs.candidate_commit }}
CANDIDATE_TREE: ${{ needs.version.outputs.candidate_tree }}
run: |
[[ "$QUALIFICATION_RUN_ID" =~ ^[0-9]+$ ]]
mkdir -p "$RUNNER_TEMP/ri51-qualification"
gh run download "$QUALIFICATION_RUN_ID" --repo "$GH_REPO" \
--name release-qualification-v2 --dir "$RUNNER_TEMP/ri51-qualification"
gh api "repos/$GH_REPO/actions/runs/$QUALIFICATION_RUN_ID" \
> "$RUNNER_TEMP/ri51-qualification/source-run.json"
bun packages/core/script/evidence-ledger/verify-qualification-bundle.ts \
--dir "$RUNNER_TEMP/ri51-qualification" \
--commit "$CANDIDATE_COMMIT" --tree "$CANDIDATE_TREE" \
--run-id "$QUALIFICATION_RUN_ID" --repo "$GH_REPO"
- name: Verify existing checks for this exact main source
if: needs.version.outputs.release && github.ref == 'refs/heads/main' && inputs.qualification_run_id == ''
timeout-minutes: 35
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ needs.version.outputs.repo }}
RELEASE_SOURCE_COMMIT: ${{ github.sha }}
RELEASE_CANDIDATE_COMMIT: ${{ needs.version.outputs.candidate_commit }}
RELEASE_CANDIDATE_TREE: ${{ needs.version.outputs.candidate_tree }}
RELEASE_CHECKS_RECEIPT: ${{ runner.temp }}/ri51-source-checks.json
run: bun script/verify-release-checks.ts
- name: Stage and verify final release archives
if: needs.version.outputs.release
run: |
bun script/release-assets.ts \
--commit "${{ needs.version.outputs.candidate_commit }}" \
--tree "${{ needs.version.outputs.candidate_tree }}" \
--version "${{ needs.version.outputs.version }}" \
--cli-dist "$PWD/packages/deepagent-code/dist" \
--windows-archives /tmp/signed-cli-windows \
--desktop-dir /tmp/desktop \
--assets-dir "$RUNNER_TEMP/release-assets" \
--manifest "$RUNNER_TEMP/ri51-probe/release-assets.json"
- name: Cache apt packages (AUR)
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-aur-${{ hashFiles('.github/workflows/publish.yml') }}
restore-keys: |
${{ runner.os }}-apt-aur-
- name: Setup SSH for AUR
run: |
sudo apt-get update
sudo apt-get install -y pacman-package-manager
mkdir -p ~/.ssh
echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git config --global user.email "deepagent-ai@deepagent.ltd"
git config --global user.name "deepagent-ai"
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
# Standard main distribution binds successful existing source checks, actual packaged
# runtime and final assets. An explicitly supplied RI-51 review remains strictly required
# to claim complete G0-G8 qualification; standard distribution keeps those gates pending.
- name: Verify distribution integrity and archive qualification status
if: needs.version.outputs.release
env:
QUALIFICATION_RUN_ID: ${{ inputs.qualification_run_id }}
RELEASE_REF: ${{ github.ref }}
GH_REPO: ${{ needs.version.outputs.repo }}
GH_TOKEN: ${{ steps.committer.outputs.token }}
run: |
bun script/assert-release-candidate.ts \
--commit "${{ needs.version.outputs.candidate_commit }}" \
--tree "${{ needs.version.outputs.candidate_tree }}" \
--tag "v${{ needs.version.outputs.version }}" \
--release-id "${{ needs.version.outputs.release }}" \
--release-repo "${{ needs.version.outputs.repo }}" \
--package-dir packages/deepagent-code/dist/deepagent-code-linux-x64
mkdir -p /tmp/authoritative-ledger
args=(--out /tmp/authoritative-ledger/ledger.json \
--package-dir "$PWD/packages/deepagent-code/dist/deepagent-code-linux-x64" \
--runs "$RUNNER_TEMP/ri51-probe/runs.json" \
--evidence "$RUNNER_TEMP/ri51-probe/evidence.json" \
--asset-manifest "$RUNNER_TEMP/ri51-probe/release-assets.json" \
--assets-dir "$RUNNER_TEMP/release-assets")
if [[ -n "$QUALIFICATION_RUN_ID" ]]; then
args+=(--qualification-dir "$RUNNER_TEMP/ri51-qualification" \
--qualification-run-id "$QUALIFICATION_RUN_ID" --qualification-repo "$GH_REPO")
elif [[ "$RELEASE_REF" == 'refs/heads/main' ]]; then
args+=(--standard-distribution --source-checks "$RUNNER_TEMP/ri51-source-checks.json")
else
echo "Non-main release requires an explicit reviewed qualification run" >&2
exit 1
fi
(cd packages/core && bun run script/evidence-ledger/release-gate.ts "${args[@]}")
if [[ -z "$QUALIFICATION_RUN_ID" ]]; then
echo "Standard main distribution: existing source checks and package integrity passed; RI-51 G0-G8 not reviewed." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload authoritative ledger release asset
if: needs.version.outputs.release && success()
env: