Repository navigation
998 lines (914 loc) · 44.7 KB
/
Copy pathdesktop-release.yml
File metadata and controls
998 lines (914 loc) · 44.7 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
name: desktop-release
run-name: desktop-release ${{ inputs.release_tag }} dispatch=${{ inputs.dispatch_id }}
on:
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to upload assets to, e.g. v0.8.61-desktop-beta.1"
required: true
type: string
release_target:
description: "Immutable commit SHA recorded by the hidden Draft; optional only for APT recovery from an existing public tag"
required: false
type: string
release_notes_url:
description: "Optional user-facing release notes URL for update manifests"
required: false
type: string
node_version:
description: "Pinned Node version from the release protocol"
required: true
type: string
dispatch_id:
description: "Unique release CLI dispatch identity used for exact run correlation"
required: false
type: string
publish_linux_apt_only:
description: "Recover the stable Linux APT repository from an existing desktop release"
required: false
default: false
type: boolean
permissions:
contents: write
concurrency:
group: desktop-release-${{ contains(inputs.release_tag, 'desktop-beta') && 'beta' || 'stable' }}
cancel-in-progress: false
jobs:
require-draft-release:
if: ${{ !inputs.publish_linux_apt_only }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require a hidden Draft before building
shell: bash
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
DESKTOP_RELEASE_TARGET: ${{ inputs.release_target }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
release_json="$(gh release view "$DESKTOP_RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --json isDraft,targetCommitish)"
if [ "$(jq -r .isDraft <<<"$release_json")" != "true" ]; then
echo "Desktop builds require a hidden Draft release: $DESKTOP_RELEASE_TAG"
exit 1
fi
if [ -z "$DESKTOP_RELEASE_TARGET" ] || [ "$(jq -r .targetCommitish <<<"$release_json")" != "$DESKTOP_RELEASE_TARGET" ]; then
echo "Draft target must equal immutable release_target: expected=$DESKTOP_RELEASE_TARGET actual=$(jq -r .targetCommitish <<<"$release_json")"
exit 1
fi
build-desktop:
if: ${{ !inputs.publish_linux_apt_only }}
needs: [require-draft-release]
name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
DESKTOP_UPDATE_CHANNEL: ${{ contains(inputs.release_tag, 'desktop-beta') && 'beta' || 'stable' }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
platform: darwin
arch: arm64
- os: macos-15-intel
platform: darwin
arch: x64
- os: ubuntu-latest
platform: linux
arch: x64
- os: windows-latest
platform: win32
arch: x64
- os: windows-latest
platform: win32
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.release_target || inputs.release_tag }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.1
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile --force
- name: Prepare Electron headers (macOS)
if: matrix.platform == 'darwin'
shell: bash
run: |
set -euo pipefail
electron_version="$(node -p "require('./apps/desktop/node_modules/electron/package.json').version")"
headers_root="$HOME/.electron-gyp/$electron_version"
if [ ! -f "$headers_root/include/node/node_api.h" ]; then
temp_root="$(mktemp -d)"
headers_archive="$temp_root/node-headers.tar.gz"
checksum_file="$temp_root/SHASUMS256.txt"
curl --fail --location --retry 3 --retry-all-errors "https://www.electronjs.org/headers/v${electron_version}/node-v${electron_version}-headers.tar.gz" --output "$headers_archive"
curl --fail --location --retry 3 --retry-all-errors "https://www.electronjs.org/headers/v${electron_version}/SHASUMS256.txt" --output "$checksum_file"
expected_checksum="$(awk -v filename="node-v${electron_version}-headers.tar.gz" '$2 == filename { print $1 }' "$checksum_file")"
actual_checksum="$(shasum -a 256 "$headers_archive" | awk '{ print $1 }')"
test -n "$expected_checksum" && test "$actual_checksum" = "$expected_checksum"
mkdir -p "$headers_root"
tar -xzf "$headers_archive" --strip-components=1 -C "$headers_root"
fi
test -f "$headers_root/include/node/node_api.h"
- name: Write bundled update public key
env:
NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY: ${{ secrets.NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY }}
run: pnpm -C apps/desktop bundle:public-key -- --output build/update-bundle-public.pem
- name: Write desktop release metadata
run: pnpm -C apps/desktop bundle:release-metadata -- --channel ${{ env.DESKTOP_UPDATE_CHANNEL }} --release-tag ${{ env.DESKTOP_RELEASE_TAG }} --output build/update-release-metadata.json
- name: Build Desktop (macOS)
if: matrix.platform == 'darwin'
shell: bash
run: |
set -euo pipefail
pnpm -r --filter @nextclaw/desktop... build
pnpm -C apps/desktop bundle:seed -- --channel "$DESKTOP_UPDATE_CHANNEL" --platform ${{ matrix.platform }} --arch ${{ matrix.arch }}
CSC_IDENTITY_AUTO_DISCOVERY=false pnpm -C apps/desktop build:main
CSC_IDENTITY_AUTO_DISCOVERY=false pnpm -C apps/desktop exec electron-builder --mac dmg zip --${{ matrix.arch }} --publish never
- name: Normalize latest-mac metadata filename
if: matrix.platform == 'darwin'
shell: bash
run: |
set -euo pipefail
if [ -f "apps/desktop/release/latest-mac.yml" ]; then
cp "apps/desktop/release/latest-mac.yml" "apps/desktop/release/latest-mac-${{ matrix.arch }}.yml"
fi
- name: Normalize macOS artifact filenames
if: matrix.platform == 'darwin'
shell: bash
run: |
set -euo pipefail
if [ "${{ matrix.arch }}" = "x64" ]; then
DMG_PATH="$(find apps/desktop/release -maxdepth 1 -type f -name "*.dmg" ! -name "*-arm64.dmg" ! -name "*-x64.dmg" | head -n 1)"
if [ -n "${DMG_PATH}" ]; then
TARGET_DMG="${DMG_PATH%.dmg}-x64.dmg"
mv "${DMG_PATH}" "${TARGET_DMG}"
if [ -f "${DMG_PATH}.blockmap" ]; then
mv "${DMG_PATH}.blockmap" "${TARGET_DMG}.blockmap"
fi
fi
ZIP_PATH="$(find apps/desktop/release -maxdepth 1 -type f -name "*-mac.zip" ! -name "*-arm64-mac.zip" ! -name "*-x64-mac.zip" | head -n 1)"
if [ -n "${ZIP_PATH}" ]; then
TARGET_ZIP="${ZIP_PATH%-mac.zip}-x64-mac.zip"
mv "${ZIP_PATH}" "${TARGET_ZIP}"
if [ -f "${ZIP_PATH}.blockmap" ]; then
mv "${ZIP_PATH}.blockmap" "${TARGET_ZIP}.blockmap"
fi
fi
fi
- name: Smoke Desktop Install (macOS DMG)
if: matrix.platform == 'darwin'
shell: bash
run: |
set -euo pipefail
DMG_PATH="$(find apps/desktop/release -maxdepth 1 -type f -name "*-${{ matrix.arch }}.dmg" | head -n 1)"
if [ -z "${DMG_PATH}" ]; then
echo "macOS dmg for arch ${{ matrix.arch }} not found in apps/desktop/release"
exit 1
fi
apps/desktop/scripts/smoke-macos-dmg.sh "${DMG_PATH}" 240
- name: Build Desktop (Windows)
if: matrix.platform == 'win32'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$env:CSC_IDENTITY_AUTO_DISCOVERY = "false"
pnpm -r --filter @nextclaw/desktop... build
pnpm -C apps/desktop bundle:seed -- --channel $env:DESKTOP_UPDATE_CHANNEL --platform ${{ matrix.platform }} --arch ${{ matrix.arch }}
pnpm -C apps/desktop build:main
pnpm -C apps/desktop exec electron-builder --win dir --${{ matrix.arch }} --publish never
- name: Build Desktop (Linux)
if: matrix.platform == 'linux'
shell: bash
run: |
set -euo pipefail
export CSC_IDENTITY_AUTO_DISCOVERY=false
pnpm -r --filter @nextclaw/desktop... build
pnpm -C apps/desktop bundle:seed -- --channel "$DESKTOP_UPDATE_CHANNEL" --platform ${{ matrix.platform }} --arch ${{ matrix.arch }}
pnpm -C apps/desktop build:main
pnpm -C apps/desktop exec electron-builder --linux AppImage deb --x64 --publish never
- name: Normalize Linux artifact filenames
if: matrix.platform == 'linux'
shell: bash
run: |
set -euo pipefail
bash apps/desktop/scripts/normalize-linux-release-artifacts.sh apps/desktop/release
- name: Smoke Desktop (Windows)
if: matrix.platform == 'win32' && matrix.arch == 'x64'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
if (-not (Test-Path "apps/desktop/release/win-unpacked/NextClaw Desktop.exe")) {
throw "Windows desktop executable not found in apps/desktop/release/win-unpacked"
}
$desktopExe = (Resolve-Path "apps/desktop/release/win-unpacked/NextClaw Desktop.exe").Path
& "apps/desktop/scripts/smoke-windows-desktop.ps1" -DesktopExePath $desktopExe -StartupTimeoutSec 180 -MaxReadySec 20 -SeedStaleSameVersionBundle -AllowRendererOnlyTitlebarProbe
- name: Build Windows Portable archive
if: matrix.platform == 'win32'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
pnpm -C apps/desktop package:windows-portable -- --arch ${{ matrix.arch }}
- name: Smoke Windows Portable archive
if: matrix.platform == 'win32' && matrix.arch == 'x64'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
pnpm desktop:portable:verify -- --allow-renderer-only-titlebar-probe
- name: Inspect Windows Portable archive
if: matrix.platform == 'win32'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$desktopVersion = (Get-Content "apps/desktop/package.json" | ConvertFrom-Json).version
$zipPath = "apps/desktop/release/NextClaw-Portable-$desktopVersion-win-${{ matrix.arch }}.zip"
if (-not (Test-Path $zipPath)) {
throw "Windows Portable archive not found: $zipPath"
}
$inspectRoot = Join-Path $env:RUNNER_TEMP "nextclaw-portable-${{ matrix.arch }}-inspect"
if (Test-Path $inspectRoot) {
Remove-Item -Recurse -Force $inspectRoot
}
New-Item -ItemType Directory -Path $inspectRoot | Out-Null
Expand-Archive -Path $zipPath -DestinationPath $inspectRoot -Force
$portableRoot = Join-Path $inspectRoot "NextClaw-Portable"
if (-not (Test-Path (Join-Path $portableRoot "NextClaw Desktop.exe"))) {
throw "Portable executable missing from $zipPath"
}
$marker = Get-Content (Join-Path $portableRoot "nextclaw-portable.json") | ConvertFrom-Json
if ($marker.kind -ne "nextclaw-portable" -or $marker.version -ne 1) {
throw "Invalid portable marker in $zipPath"
}
- name: Smoke Desktop (Linux AppImage)
if: matrix.platform == 'linux'
shell: bash
run: |
set -euo pipefail
APPIMAGE_PATH="$(find apps/desktop/release -maxdepth 1 -type f -name 'NextClaw.Desktop-*-linux-x64.AppImage' | head -n 1)"
if [ -z "${APPIMAGE_PATH}" ]; then
echo "Linux AppImage not found in apps/desktop/release"
exit 1
fi
apps/desktop/scripts/smoke-linux-appimage.sh "${APPIMAGE_PATH}" 240
- name: Smoke Desktop (Linux deb)
if: matrix.platform == 'linux'
shell: bash
run: |
set -euo pipefail
DEB_PATH="$(find apps/desktop/release -maxdepth 1 -type f -name 'nextclaw-desktop_*.deb' | head -n 1)"
if [ -z "${DEB_PATH}" ]; then
echo "Linux deb not found in apps/desktop/release"
exit 1
fi
bash apps/desktop/scripts/smoke-linux-deb.sh "${DEB_PATH}"
- name: Build signed product bundle + manifest (Unix)
if: matrix.platform != 'win32'
shell: bash
env:
NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY: ${{ secrets.NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY }}
run: |
set -euo pipefail
BUNDLE_VERSION="$(node -p "require('./packages/nextclaw/package.json').version")"
MINIMUM_LAUNCHER_VERSION="$(node apps/desktop/scripts/update/services/print-minimum-launcher-version.service.mjs --channel "$DESKTOP_UPDATE_CHANNEL")"
RELEASE_NOTES_URL="${{ github.event.inputs.release_notes_url || '' }}"
if [ -z "$RELEASE_NOTES_URL" ] && [ -f "apps/docs/public/release-notes/nextclaw-v${BUNDLE_VERSION}.json" ]; then
RELEASE_NOTES_URL="$(node -e "const data=require('./apps/docs/public/release-notes/nextclaw-v${BUNDLE_VERSION}.json'); process.stdout.write(data.links?.html?.['en-US'] || data.links?.html?.['zh-CN'] || '')")"
fi
if [ -z "$RELEASE_NOTES_URL" ]; then
if [ "$DESKTOP_UPDATE_CHANNEL" = "stable" ]; then
echo "::error::Stable desktop releases require apps/docs/public/release-notes/nextclaw-v${BUNDLE_VERSION}.json or workflow release_notes_url input."
exit 1
fi
RELEASE_NOTES_URL="https://github.com/${{ github.repository }}/releases/tag/${DESKTOP_RELEASE_TAG}"
fi
pnpm -C apps/desktop bundle:build -- \
--channel "$DESKTOP_UPDATE_CHANNEL" \
--platform ${{ matrix.platform }} \
--arch ${{ matrix.arch }} \
--version "$BUNDLE_VERSION" \
--minimum-launcher-version "$MINIMUM_LAUNCHER_VERSION" \
--output-dir dist-bundles
BUNDLE_PATH="dist-bundles/nextclaw-bundle-${{ matrix.platform }}-${{ matrix.arch }}-${BUNDLE_VERSION}.zip"
MANIFEST_PATH="release-manifests/manifest-${DESKTOP_UPDATE_CHANNEL}-${{ matrix.platform }}-${{ matrix.arch }}.json"
pnpm -C apps/desktop bundle:manifest -- \
--bundle "$BUNDLE_PATH" \
--channel "$DESKTOP_UPDATE_CHANNEL" \
--platform ${{ matrix.platform }} \
--arch ${{ matrix.arch }} \
--version "$BUNDLE_VERSION" \
--minimum-launcher-version "$MINIMUM_LAUNCHER_VERSION" \
--bundle-url "https://github.com/${{ github.repository }}/releases/download/${DESKTOP_RELEASE_TAG}/$(basename "$BUNDLE_PATH")" \
--release-notes-url "$RELEASE_NOTES_URL" \
--output "$MANIFEST_PATH"
test -f "apps/desktop/$BUNDLE_PATH"
test -f "apps/desktop/$MANIFEST_PATH"
- name: Build signed product bundle + manifest (Windows)
if: matrix.platform == 'win32'
shell: pwsh
env:
NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY: ${{ secrets.NEXTCLAW_DESKTOP_BUNDLE_PRIVATE_KEY }}
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$bundleVersion = node -p "require('./packages/nextclaw/package.json').version"
$minimumLauncherVersion = node apps/desktop/scripts/update/services/print-minimum-launcher-version.service.mjs --channel $env:DESKTOP_UPDATE_CHANNEL
$releaseNotesUrl = "${{ github.event.inputs.release_notes_url || '' }}"
$releaseNotesJsonPath = "apps/docs/public/release-notes/nextclaw-v$bundleVersion.json"
if (-not $releaseNotesUrl -and (Test-Path $releaseNotesJsonPath)) {
$releaseNotesUrl = node -e "const data=require('./$releaseNotesJsonPath'); process.stdout.write(data.links?.html?.['en-US'] || data.links?.html?.['zh-CN'] || '')"
}
if (-not $releaseNotesUrl) {
if ($env:DESKTOP_UPDATE_CHANNEL -eq "stable") {
throw "Stable desktop releases require apps/docs/public/release-notes/nextclaw-v$bundleVersion.json or workflow release_notes_url input."
}
$releaseNotesUrl = "https://github.com/${{ github.repository }}/releases/tag/$env:DESKTOP_RELEASE_TAG"
}
pnpm -C apps/desktop bundle:build -- `
--channel $env:DESKTOP_UPDATE_CHANNEL `
--platform ${{ matrix.platform }} `
--arch ${{ matrix.arch }} `
--version $bundleVersion `
--minimum-launcher-version $minimumLauncherVersion `
--output-dir dist-bundles
$bundlePath = "dist-bundles/nextclaw-bundle-${{ matrix.platform }}-${{ matrix.arch }}-$bundleVersion.zip"
$manifestPath = "release-manifests/manifest-$env:DESKTOP_UPDATE_CHANNEL-${{ matrix.platform }}-${{ matrix.arch }}.json"
$bundleFileName = Split-Path $bundlePath -Leaf
pnpm -C apps/desktop bundle:manifest -- `
--bundle $bundlePath `
--channel $env:DESKTOP_UPDATE_CHANNEL `
--platform ${{ matrix.platform }} `
--arch ${{ matrix.arch }} `
--version $bundleVersion `
--minimum-launcher-version $minimumLauncherVersion `
--bundle-url "https://github.com/${{ github.repository }}/releases/download/$env:DESKTOP_RELEASE_TAG/$bundleFileName" `
--release-notes-url $releaseNotesUrl `
--output $manifestPath
if (-not (Test-Path (Join-Path "apps/desktop" $bundlePath))) {
throw "Signed product bundle was not written to apps/desktop/$bundlePath"
}
if (-not (Test-Path (Join-Path "apps/desktop" $manifestPath))) {
throw "Update manifest was not written to apps/desktop/$manifestPath"
}
- name: Archive desktop artifacts (Windows)
if: matrix.platform == 'win32'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$unpackedDirName = if ("${{ matrix.arch }}" -eq "arm64") { "win-arm64-unpacked" } else { "win-unpacked" }
$unpackedDir = Join-Path "apps/desktop/release" $unpackedDirName
if (-not (Test-Path $unpackedDir)) {
throw "Windows desktop unpacked directory not found: $unpackedDir"
}
$sourceDir = (Resolve-Path $unpackedDir).Path
$stagingDir = Join-Path "apps/desktop/release" "win-unpacked-staging"
if (Test-Path $stagingDir) {
Remove-Item -Recurse -Force $stagingDir
}
New-Item -ItemType Directory -Path $stagingDir | Out-Null
& robocopy $sourceDir $stagingDir /E /R:2 /W:1 /XF debug.log
if ($LASTEXITCODE -gt 7) {
throw "robocopy failed with exit code $LASTEXITCODE"
}
$global:LASTEXITCODE = 0
$desktopVersion = (Get-Content "apps/desktop/package.json" | ConvertFrom-Json).version
if ([string]::IsNullOrWhiteSpace($desktopVersion)) {
throw "Desktop package version is missing in apps/desktop/package.json"
}
$zipFileName = "NextClaw.Desktop-$desktopVersion-win32-${{ matrix.arch }}-unpacked.zip"
$zipPath = Join-Path "apps/desktop/release" $zipFileName
if (Test-Path $zipPath) {
Remove-Item -Force $zipPath
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory(
(Resolve-Path $stagingDir).Path,
(Join-Path (Resolve-Path "apps/desktop/release").Path $zipFileName)
)
Remove-Item -Recurse -Force $stagingDir
- name: Build Desktop Installer (Windows)
if: matrix.platform == 'win32' && matrix.arch == 'x64'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$env:CSC_IDENTITY_AUTO_DISCOVERY = "false"
pnpm -C apps/desktop exec electron-builder --win nsis --x64 --prepackaged release/win-unpacked --publish never
- name: Smoke Desktop Installer (Windows)
if: matrix.platform == 'win32' && matrix.arch == 'x64'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$installerPath = Get-ChildItem "apps/desktop/release" -Filter "*Setup*.exe" | Select-Object -First 1
if ($null -eq $installerPath) {
throw "Windows desktop installer not found in apps/desktop/release"
}
& "apps/desktop/scripts/smoke-windows-installer.ps1" -InstallerPath $installerPath.FullName -StartupTimeoutSec 180 -MaxReadySec 20 -SeedStaleSameVersionBundle -AllowRendererOnlyTitlebarProbe
- name: Stage Smoke Logs (Windows)
if: matrix.platform == 'win32' && always()
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$stagingRoot = "apps/desktop/release/windows-smoke-logs"
if (Test-Path $stagingRoot) {
Remove-Item -Recurse -Force $stagingRoot
}
New-Item -ItemType Directory -Path $stagingRoot | Out-Null
$homeLogs = Join-Path $env:RUNNER_TEMP "nextclaw-desktop-smoke-home/logs"
if (Test-Path $homeLogs) {
Copy-Item -Recurse -Force $homeLogs (Join-Path $stagingRoot "home-logs")
}
$appLogs = Join-Path $env:APPDATA "NextClaw Desktop/logs"
if (Test-Path $appLogs) {
Copy-Item -Recurse -Force $appLogs (Join-Path $stagingRoot "app-logs")
}
- name: Upload Smoke Logs (macOS)
if: matrix.platform == 'darwin' && always()
uses: actions/upload-artifact@v4
with:
name: desktop-smoke-logs-darwin-${{ matrix.arch }}
if-no-files-found: warn
path: |
${{ runner.temp }}/nextclaw-desktop-smoke-home/logs/**
${{ runner.temp }}/nextclaw-desktop-smoke-logs/**
~/Library/Logs/NextClaw Desktop/**
- name: Upload Smoke Logs (Windows)
if: matrix.platform == 'win32' && always()
uses: actions/upload-artifact@v4
with:
name: desktop-smoke-logs-win32-${{ matrix.arch }}
if-no-files-found: warn
path: |
apps/desktop/release/windows-smoke-logs/**
${{ runner.temp }}/nextclaw-desktop-smoke-logs/**
- name: Upload Smoke Logs (Linux)
if: matrix.platform == 'linux' && always()
uses: actions/upload-artifact@v4
with:
name: desktop-smoke-logs-linux-x64
if-no-files-found: warn
path: |
${{ runner.temp }}/nextclaw-desktop-smoke-home/logs/**
${{ runner.temp }}/nextclaw-desktop-smoke-logs/**
- name: Upload desktop artifacts (macOS)
if: matrix.platform == 'darwin'
uses: actions/upload-artifact@v4
with:
name: desktop-release-${{ matrix.platform }}-${{ matrix.arch }}
if-no-files-found: warn
path: |
apps/desktop/release/*.dmg
apps/desktop/release/*-mac.zip
apps/desktop/release/latest-mac-${{ matrix.arch }}.yml
apps/desktop/release/*.blockmap
apps/desktop/dist-bundles/nextclaw-bundle-${{ matrix.platform }}-${{ matrix.arch }}-*.zip
apps/desktop/release-manifests/manifest-${{ env.DESKTOP_UPDATE_CHANNEL }}-${{ matrix.platform }}-${{ matrix.arch }}.json
- name: Upload desktop artifacts (Windows)
if: matrix.platform == 'win32'
uses: actions/upload-artifact@v4
with:
if-no-files-found: warn
name: desktop-release-${{ matrix.platform }}-${{ matrix.arch }}
path: |
apps/desktop/release/NextClaw.Desktop-*-win32-${{ matrix.arch }}-unpacked.zip
apps/desktop/release/NextClaw-Portable-*-win-${{ matrix.arch }}.zip
apps/desktop/release/*Setup*.exe
apps/desktop/release/latest.yml
apps/desktop/release/*.exe.blockmap
apps/desktop/dist-bundles/nextclaw-bundle-${{ matrix.platform }}-${{ matrix.arch }}-*.zip
apps/desktop/release-manifests/manifest-${{ env.DESKTOP_UPDATE_CHANNEL }}-${{ matrix.platform }}-${{ matrix.arch }}.json
- name: Upload desktop artifacts (Linux)
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: desktop-release-${{ matrix.platform }}-${{ matrix.arch }}
if-no-files-found: warn
path: |
apps/desktop/release/NextClaw.Desktop-*-linux-x64.AppImage
apps/desktop/release/NextClaw.Desktop-*-linux-x64.AppImage.blockmap
apps/desktop/release/nextclaw-desktop_*.deb
apps/desktop/dist-bundles/nextclaw-bundle-${{ matrix.platform }}-${{ matrix.arch }}-*.zip
apps/desktop/release-manifests/manifest-${{ env.DESKTOP_UPDATE_CHANNEL }}-${{ matrix.platform }}-${{ matrix.arch }}.json
- name: Upload bundle update public key
if: matrix.platform == 'linux' && matrix.arch == 'x64'
uses: actions/upload-artifact@v4
with:
name: desktop-release-update-public-key
path: |
apps/desktop/build/update-bundle-public.pem
publish-release-assets:
if: ${{ !inputs.publish_linux_apt_only }}
needs: [require-draft-release, build-desktop]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout release contract
uses: actions/checkout@v4
with:
ref: ${{ inputs.release_target || inputs.release_tag }}
- name: Download desktop artifacts
uses: actions/download-artifact@v4
with:
pattern: desktop-release-*
path: dist/desktop-release
merge-multiple: true
- name: Upload desktop assets to release
shell: bash
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
if [ "$(gh release view "$DESKTOP_RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft)" != "true" ]; then
echo "Refusing to upload assets because $DESKTOP_RELEASE_TAG is already public."
exit 1
fi
mapfile -d '' asset_files < <(find dist/desktop-release -type f -print0)
if [ "${#asset_files[@]}" -eq 0 ]; then
echo "No desktop assets were downloaded."
exit 1
fi
gh release upload "$DESKTOP_RELEASE_TAG" "${asset_files[@]}" \
--repo "$GITHUB_REPOSITORY" \
--clobber
- name: Verify complete Draft asset set
shell: bash
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
DESKTOP_UPDATE_CHANNEL: ${{ contains(inputs.release_tag, 'desktop-beta') && 'beta' || 'stable' }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
node --input-type=module <<'NODE'
import { readFileSync } from 'node:fs';
import { verifyReleaseAssets } from './scripts/release/desktop-release-closure.mjs';
await verifyReleaseAssets({
channel: process.env.DESKTOP_UPDATE_CHANNEL,
desktopVersion: JSON.parse(readFileSync('apps/desktop/package.json', 'utf8')).version,
expectedDraft: true,
repo: process.env.GITHUB_REPOSITORY,
runtimeVersion: JSON.parse(readFileSync('packages/nextclaw/package.json', 'utf8')).version,
tag: process.env.DESKTOP_RELEASE_TAG
});
NODE
publish-github-release:
if: ${{ !inputs.publish_linux_apt_only }}
needs: [publish-release-assets]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout release contract
uses: actions/checkout@v4
with:
ref: ${{ inputs.release_target || inputs.release_tag }}
- name: Publish only the verified Draft
shell: bash
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
DESKTOP_UPDATE_CHANNEL: ${{ contains(inputs.release_tag, 'desktop-beta') && 'beta' || 'stable' }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
node --input-type=module <<'NODE'
import { readFileSync } from 'node:fs';
import { verifyReleaseAssets } from './scripts/release/desktop-release-closure.mjs';
const options = {
channel: process.env.DESKTOP_UPDATE_CHANNEL,
desktopVersion: JSON.parse(readFileSync('apps/desktop/package.json', 'utf8')).version,
repo: process.env.GITHUB_REPOSITORY,
runtimeVersion: JSON.parse(readFileSync('packages/nextclaw/package.json', 'utf8')).version,
tag: process.env.DESKTOP_RELEASE_TAG
};
await verifyReleaseAssets({ ...options, expectedDraft: true });
NODE
gh release edit "$DESKTOP_RELEASE_TAG" \
--repo "$GITHUB_REPOSITORY" \
--draft=false
node --input-type=module <<'NODE'
import { readFileSync } from 'node:fs';
import { verifyReleaseAssets } from './scripts/release/desktop-release-closure.mjs';
await verifyReleaseAssets({
channel: process.env.DESKTOP_UPDATE_CHANNEL,
desktopVersion: JSON.parse(readFileSync('apps/desktop/package.json', 'utf8')).version,
expectedDraft: false,
repo: process.env.GITHUB_REPOSITORY,
runtimeVersion: JSON.parse(readFileSync('packages/nextclaw/package.json', 'utf8')).version,
tag: process.env.DESKTOP_RELEASE_TAG
});
NODE
publish-desktop-update-channels:
if: ${{ !inputs.publish_linux_apt_only }}
needs: [build-desktop, publish-release-assets, publish-github-release]
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: nextclaw-github-pages-state
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.release_target || inputs.release_tag }}
fetch-depth: 1
- name: Checkout publisher control plane
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 1
path: .tmp/publisher
- name: Download desktop artifacts
uses: actions/download-artifact@v4
with:
pattern: desktop-release-*
path: dist/desktop-release
merge-multiple: true
- name: Prepare gh-pages worktree
shell: bash
env:
GH_PAGES_PUSH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
rm -rf .tmp/gh-pages
GH_PAGES_AUTH_HEADER="$(printf 'x-access-token:%s' "${GH_PAGES_PUSH_TOKEN}" | base64 -w0)"
git remote set-url origin "https://github.com/${GITHUB_REPOSITORY}.git"
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${GH_PAGES_AUTH_HEADER}"
if git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
git fetch --depth=1 origin gh-pages
git worktree add .tmp/gh-pages origin/gh-pages
else
git worktree add --detach .tmp/gh-pages
git -C .tmp/gh-pages checkout --orphan gh-pages
git -C .tmp/gh-pages rm -rf . >/dev/null 2>&1 || true
find .tmp/gh-pages -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
fi
git -C .tmp/gh-pages config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${GH_PAGES_AUTH_HEADER}"
- name: Stage desktop update channel files
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
DESKTOP_UPDATE_CHANNEL: ${{ contains(inputs.release_tag, 'desktop-beta') && 'beta' || 'stable' }}
shell: bash
run: |
set -euo pipefail
mkdir -p .tmp/gh-pages/desktop-updates
if ! find dist/desktop-release -type f -name 'manifest-*.json' | grep -q .; then
echo "No desktop update manifests were downloaded."
exit 1
fi
find dist/desktop-release -type f -name 'manifest-*.json' | while read -r manifestPath; do
manifestFile="$(basename "$manifestPath")"
channel="$(printf '%s' "$manifestFile" | cut -d- -f2)"
targetDir=".tmp/gh-pages/desktop-updates/$channel"
mkdir -p "$targetDir"
cp "$manifestPath" "$targetDir/$manifestFile"
done
if [ -f "dist/desktop-release/update-bundle-public.pem" ]; then
cp "dist/desktop-release/update-bundle-public.pem" ".tmp/gh-pages/desktop-updates/update-bundle-public.pem"
fi
if [ "$DESKTOP_UPDATE_CHANNEL" = "stable" ]; then
node .tmp/publisher/scripts/release/desktop-download-metadata.mjs \
--tag "$DESKTOP_RELEASE_TAG" \
--desktop-package apps/desktop/package.json \
--output .tmp/gh-pages/desktop-downloads/stable.json
fi
touch .tmp/gh-pages/.nojekyll
- name: Publish desktop update channels to gh-pages
shell: bash
run: |
set -euo pipefail
node .tmp/publisher/scripts/release/github-pages-artifact.mjs verify-state --state-dir .tmp/gh-pages
git -C .tmp/gh-pages config user.name "github-actions[bot]"
git -C .tmp/gh-pages config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C .tmp/gh-pages add desktop-updates .nojekyll
if [ -f ".tmp/gh-pages/desktop-downloads/stable.json" ]; then
git -C .tmp/gh-pages add desktop-downloads/stable.json
fi
if git -C .tmp/gh-pages diff --cached --quiet; then
echo "No desktop update channel changes to publish."
exit 0
fi
git -C .tmp/gh-pages commit -m "chore: publish desktop update channels"
git -C .tmp/gh-pages push origin HEAD:gh-pages
publish-linux-apt-repo:
if: ${{ always() && !contains(inputs.release_tag, 'desktop-beta') && (inputs.publish_linux_apt_only || (needs.build-desktop.result == 'success' && needs.publish-release-assets.result == 'success' && needs.publish-github-release.result == 'success' && needs.publish-desktop-update-channels.result == 'success')) }}
needs:
[build-desktop, publish-release-assets, publish-github-release, publish-desktop-update-channels]
runs-on: ubuntu-latest
timeout-minutes: 25
concurrency:
group: nextclaw-github-pages-state
cancel-in-progress: false
env:
DESKTOP_RELEASE_TAG: ${{ inputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# An APT-only recovery republishes an already immutable release asset;
# it must use the current, explicitly dispatched publisher code rather
# than the historical product target that created that asset.
ref: ${{ inputs.publish_linux_apt_only && github.ref || inputs.release_target || inputs.release_tag }}
fetch-depth: 1
- name: Checkout publisher control plane
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 1
path: .tmp/publisher
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Ensure APT repository toolchain
shell: bash
run: |
set -euo pipefail
required_commands=(dpkg-deb dpkg-scanpackages apt-ftparchive gpg)
missing_commands=()
for required_command in "${required_commands[@]}"; do
if ! command -v "$required_command" >/dev/null 2>&1; then
missing_commands+=("$required_command")
fi
done
if [ "${#missing_commands[@]}" -eq 0 ]; then
echo "APT repository toolchain is already available."
exit 0
fi
printf 'Missing APT repository command(s): %s\n' "${missing_commands[*]}"
for attempt in 1 2 3; do
echo "Installing APT repository toolchain (attempt $attempt/3)."
if timeout 180s sudo apt-get update && timeout 180s sudo apt-get install -y apt-utils dpkg-dev gnupg; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "APT repository toolchain installation failed after 3 bounded attempts."
exit 1
fi
sleep "$((attempt * 5))"
done
for required_command in "${required_commands[@]}"; do
command -v "$required_command" >/dev/null 2>&1 || {
echo "APT repository toolchain command is still unavailable: $required_command"
exit 1
}
done
- name: Download Linux desktop artifacts
if: ${{ !inputs.publish_linux_apt_only }}
uses: actions/download-artifact@v4
with:
name: desktop-release-linux-x64
path: dist/desktop-release
- name: Download Linux package from existing release
if: ${{ inputs.publish_linux_apt_only }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
mkdir -p dist/desktop-release
gh release download "$DESKTOP_RELEASE_TAG" \
--repo "$GITHUB_REPOSITORY" \
--pattern 'nextclaw-desktop_*_amd64.deb' \
--dir dist/desktop-release
- name: Prepare gh-pages worktree
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GH_PAGES_PUSH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
rm -rf .tmp/gh-pages .tmp/current-pages-apt dist/linux-apt-input
mkdir -p dist/linux-apt-input
GH_PAGES_AUTH_HEADER="$(printf 'x-access-token:%s' "${GH_PAGES_PUSH_TOKEN}" | base64 -w0)"
git remote set-url origin "https://github.com/${GITHUB_REPOSITORY}.git"
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${GH_PAGES_AUTH_HEADER}"
if git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
git fetch --depth=1 origin gh-pages
git worktree add .tmp/gh-pages origin/gh-pages
if [ -d ".tmp/gh-pages/apt" ]; then
cp -R ".tmp/gh-pages/apt" ".tmp/current-pages-apt"
if ! find ".tmp/current-pages-apt/pool" -type f -name '*.deb' -print -quit 2>/dev/null | grep -q .; then
source_file=".tmp/current-pages-apt/package-source.json"
packages_file=".tmp/current-pages-apt/dists/stable/main/binary-amd64/Packages"
test -f "$source_file"
test -f "$packages_file"
old_release_tag="$(jq -r '.releaseTag' "$source_file")"
old_asset_name="$(jq -r '.assetName' "$source_file")"
old_relative_path="$(awk -F': ' '$1 == "Filename" { print $2; exit }' "$packages_file")"
case "$old_relative_path" in
""|/*|*".."*) echo "Unsafe previous APT package path: $old_relative_path"; exit 1 ;;
esac
old_package_dir=".tmp/current-pages-apt/$(dirname "$old_relative_path")"
old_asset_dir=".tmp/previous-apt-release-asset"
mkdir -p "$old_package_dir"
rm -rf "$old_asset_dir"
mkdir -p "$old_asset_dir"
gh release download "$old_release_tag" \
--repo "$GITHUB_REPOSITORY" \
--pattern "$old_asset_name" \
--dir "$old_asset_dir"
cp "$old_asset_dir/$old_asset_name" ".tmp/current-pages-apt/$old_relative_path"
test -f ".tmp/current-pages-apt/$old_relative_path"
fi
if [ -d ".tmp/current-pages-apt/pool" ]; then
find ".tmp/current-pages-apt/pool" -type f -name '*.deb' -exec cp {} dist/linux-apt-input/ \;
fi
fi
else
git worktree add --detach .tmp/gh-pages
git -C .tmp/gh-pages checkout --orphan gh-pages
git -C .tmp/gh-pages rm -rf . >/dev/null 2>&1 || true
find .tmp/gh-pages -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
fi
git -C .tmp/gh-pages config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${GH_PAGES_AUTH_HEADER}"
git -C .tmp/gh-pages config --local http.postBuffer 157286400
git -C .tmp/gh-pages config --local http.version HTTP/1.1
- name: Stage Linux desktop packages for APT
shell: bash
run: |
set -euo pipefail
find dist/desktop-release -type f -name '*.deb' -exec cp {} dist/linux-apt-input/ \;
if ! find dist/linux-apt-input -maxdepth 1 -type f -name '*.deb' | grep -q .; then
echo "No Linux deb artifacts available for APT repo build"
exit 1
fi
mapfile -t deb_files < <(find dist/linux-apt-input -maxdepth 1 -type f -name 'nextclaw-desktop_*_amd64.deb' | sort -V)
retain_count=1
if [ "${#deb_files[@]}" -gt "$retain_count" ]; then
prune_count=$(("${#deb_files[@]}" - retain_count))
printf '[desktop-release] pruning %s old APT deb package(s), retaining latest %s\n' "$prune_count" "$retain_count"
for deb_file in "${deb_files[@]:0:$prune_count}"; do
rm -f "$deb_file"
done
fi
- name: Build signed Linux APT repo
shell: bash
env:
NEXTCLAW_APT_GPG_PRIVATE_KEY: ${{ secrets.NEXTCLAW_APT_GPG_PRIVATE_KEY }}
NEXTCLAW_APT_GPG_PASSPHRASE: ${{ secrets.NEXTCLAW_APT_GPG_PASSPHRASE }}
NEXTCLAW_APT_GPG_KEY_ID: ${{ secrets.NEXTCLAW_APT_GPG_KEY_ID }}
run: |
set -euo pipefail
node scripts/desktop/build-linux-apt-repo.mjs --input-dir dist/linux-apt-input --output-dir dist/linux-apt-repo --signing-mode env
- name: Smoke Linux APT fresh install
shell: bash
run: |
set -euo pipefail
bash apps/desktop/scripts/smoke-linux-apt-repo.sh dist/linux-apt-repo/apt
- name: Smoke Linux APT upgrade
if: hashFiles('.tmp/current-pages-apt/dists/stable/main/binary-amd64/Packages') != ''
shell: bash
run: |
set -euo pipefail
bash apps/desktop/scripts/smoke-linux-apt-repo.sh dist/linux-apt-repo/apt --old-repo-dir .tmp/current-pages-apt
- name: Publish Linux APT repo to gh-pages
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
mkdir -p .tmp/gh-pages
rm -rf .tmp/gh-pages/apt
cp -R dist/linux-apt-repo/apt .tmp/gh-pages/apt
apt_package="$(find .tmp/gh-pages/apt/pool -type f -name 'nextclaw-desktop_*_amd64.deb' -print -quit)"
test -n "$apt_package"
apt_release_asset_name="$(basename "$apt_package")"
node .tmp/publisher/scripts/release/github-pages-artifact.mjs create-apt-source \
--packages .tmp/gh-pages/apt/dists/stable/main/binary-amd64/Packages \
--apt-package "$apt_package" \
--release-asset-name "$apt_release_asset_name" \
--release-tag "$DESKTOP_RELEASE_TAG" \
--output .tmp/gh-pages/apt/package-source.json
find .tmp/gh-pages/apt/pool -type f -name '*.deb' -delete
cp apps/desktop/scripts/install-linux-apt.sh .tmp/gh-pages/install-apt.sh
chmod 0755 .tmp/gh-pages/install-apt.sh
touch .tmp/gh-pages/.nojekyll
node .tmp/publisher/scripts/release/github-pages-artifact.mjs verify-state --state-dir .tmp/gh-pages
git -C .tmp/gh-pages config user.name "github-actions[bot]"
git -C .tmp/gh-pages config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git -C .tmp/gh-pages add apt install-apt.sh .nojekyll
if git -C .tmp/gh-pages diff --cached --quiet; then
echo "No Linux APT repo changes to publish."
exit 0
fi
git -C .tmp/gh-pages commit -m "chore: publish linux apt repo"
git -C .tmp/gh-pages push origin HEAD:gh-pages
deploy-public-pages:
needs: [publish-desktop-update-channels, publish-linux-apt-repo]
if: ${{ always() && ((contains(inputs.release_tag, 'desktop-beta') && needs.publish-desktop-update-channels.result == 'success') || (!contains(inputs.release_tag, 'desktop-beta') && needs.publish-linux-apt-repo.result == 'success')) }}
permissions:
contents: read
pages: write
id-token: write
uses: ./.github/workflows/github-pages-deploy.yml