Repository navigation
1770 lines (1687 loc) · 87.5 KB
/
Copy pathrelease-build.yml
File metadata and controls
1770 lines (1687 loc) · 87.5 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: Release build candidates
run-name: Release build ${{ inputs.tag }} ${{ inputs.request_id }}
on:
workflow_dispatch:
inputs:
tag:
description: Existing annotated release tag (v0.3.9) or verification tag (release-build-test-*)
required: true
type: string
request_id:
description: Durable operator correlation id (rb_<24 hex>) or manual
required: false
default: manual
type: string
include_runtime_installers:
description: Build Linux Runtime DEB/RPM installers (requires unified installers and a release tag)
required: false
default: false
type: boolean
include_unified_installers:
description: Build optional unified distro installers in addition to the core release
required: false
default: false
type: boolean
# This workflow only produces candidate bytes and one same-run assembled bundle.
# It has no release, package, deployment, or repository-write permission. A
# trusted publication control host owns collection, staging, and publication.
permissions:
contents: read
concurrency:
group: release-build-${{ inputs.tag }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
preflight:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
ref: refs/tags/${{ inputs.tag }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
# The static release gate runs test_inventory.sh self-tests, which require rg.
# Ubuntu runner images do not guarantee ripgrep; match ordinary CI setup.
- name: Ensure test inventory dependency
shell: bash
run: |
set -euo pipefail
if ! command -v rg >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y ripgrep
fi
- name: Fail fast on deterministic release contracts
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
INCLUDE_RUNTIME_INSTALLERS: ${{ inputs.include_runtime_installers }}
INCLUDE_UNIFIED_INSTALLERS: ${{ inputs.include_unified_installers }}
run: |
set -euo pipefail
if [ "${INCLUDE_RUNTIME_INSTALLERS:-false}" = true ]; then
test "$INCLUDE_UNIFIED_INSTALLERS" = true
[[ "$INPUT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
fi
test "$GITHUB_REF" = "refs/tags/$INPUT_TAG"
test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 "$INPUT_TAG")"
bash scripts/release_check.sh --static-only
prepare:
needs: preflight
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
version: ${{ steps.metadata.outputs.version }}
source_sha: ${{ steps.metadata.outputs.source_sha }}
built_at: ${{ steps.metadata.outputs.built_at }}
build_kind: ${{ steps.metadata.outputs.build_kind }}
archive_stem: ${{ steps.metadata.outputs.archive_stem }}
desktop_darwin_x64_supplemental: ${{ steps.metadata.outputs.desktop_darwin_x64_supplemental }}
steps:
- name: Require immutable tagged workflow source
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
INPUT_REQUEST_ID: ${{ inputs.request_id }}
run: |
set -euo pipefail
tag="$INPUT_TAG"
request_id="$INPUT_REQUEST_ID"
if [ "$request_id" != "manual" ] && [[ ! "$request_id" =~ ^rb_[0-9a-f]{24}$ ]]; then
echo "Invalid release-build request id: $request_id" >&2
exit 1
fi
if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
:
elif [[ "$tag" =~ ^release-build-test-[0-9A-Za-z][0-9A-Za-z._-]*$ ]] && [ "${#tag}" -le 80 ]; then
:
else
echo "Invalid release or verification tag: $tag" >&2
exit 1
fi
if [ "$GITHUB_REF" != "refs/tags/$tag" ]; then
echo "Release candidate builds must be dispatched from the exact immutable tag." >&2
exit 1
fi
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
ref: refs/tags/${{ inputs.tag }}
- name: Resolve immutable release metadata
id: metadata
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
tag="$INPUT_TAG"
if [[ "$tag" =~ ^v[0-9] ]]; then
build_kind=release
version="${tag#v}"
else
build_kind=verification
version=""
fi
if [ "$(git cat-file -t "$tag")" != "tag" ]; then
echo "$tag must be an annotated tag." >&2
exit 1
fi
source_sha="$(git rev-list -n 1 "$tag")"
if [ "$(git rev-parse HEAD)" != "$source_sha" ]; then
echo "Checked-out HEAD does not match $tag." >&2
exit 1
fi
if [ -n "$(git status --porcelain --untracked-files=all)" ]; then
echo "Release candidate checkout is not clean." >&2
exit 1
fi
package_version="$(
python3 - "$build_kind" "$version" <<'PY'
import sys
from pathlib import Path
from scripts import release_publication
build_kind, requested = sys.argv[1:]
versions = release_publication._package_versions(Path.cwd())
unique = set(versions.values())
if len(unique) != 1:
detail = " ".join(f"{name}={value}" for name, value in versions.items())
raise SystemExit(f"Canonical release versions disagree: {detail}")
current = versions["npm"]
if build_kind == "release" and current != requested:
raise SystemExit(f"Tag/source version mismatch: tag={requested} source={current}")
print(current)
PY
)"
if [ "$build_kind" = verification ]; then
version="$package_version"
fi
desktop_darwin_x64_supplemental="$(python3 - "$version" <<'PY'
import sys
version = sys.argv[1].split('+', 1)[0].split('-', 1)[0]
core = tuple(int(part) for part in version.split('.'))
print('true' if core >= (0, 4, 3) else 'false')
PY
)"
short_source="${source_sha:0:12}"
if [ "$build_kind" = release ]; then
archive_stem="webcodex-v$version"
else
archive_stem="webcodex-$tag-$short_source-v$version"
fi
# An annotated tag has a stable tagger timestamp. Reusing it makes a
# rerun of the same immutable tag produce one shared built_at value
# across every platform and every workflow attempt.
built_at="$(git for-each-ref --format='%(taggerdate:unix)' "refs/tags/$tag")"
if [[ ! "$built_at" =~ ^[0-9]+$ ]]; then
echo "Could not resolve an annotated tagger timestamp for $tag." >&2
exit 1
fi
{
echo "version=$version"
echo "source_sha=$source_sha"
echo "built_at=$built_at"
echo "build_kind=$build_kind"
echo "archive_stem=$archive_stem"
echo "desktop_darwin_x64_supplemental=$desktop_darwin_x64_supplemental"
} >> "$GITHUB_OUTPUT"
{
echo "### Release build source"
echo "- kind: \`$build_kind\`"
echo "- tag: \`$tag\`"
echo "- commit: \`$source_sha\`"
echo "- built_at: \`$built_at\`"
echo "- archive stem: \`$archive_stem\`"
echo "- macOS Intel Desktop supplemental: \`$desktop_darwin_x64_supplemental\`"
} >> "$GITHUB_STEP_SUMMARY"
linux:
needs: prepare
strategy:
fail-fast: false
matrix:
include:
- platform: linux-x64
runner: ubuntu-latest
image: quay.io/pypa/manylinux2014_x86_64
machine: x86_64
elf_machine: Advanced Micro Devices X86-64
- platform: linux-arm64
runner: ubuntu-24.04-arm
image: quay.io/pypa/manylinux2014_aarch64
machine: aarch64
elf_machine: AArch64
runs-on: ${{ matrix.runner }}
timeout-minutes: 75
env:
VERSION: ${{ needs.prepare.outputs.version }}
SOURCE_SHA: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_BUILT_AT: ${{ needs.prepare.outputs.built_at }}
WEBCODEX_RELEASE_VERSION: ${{ needs.prepare.outputs.version }}
BUILD_KIND: ${{ needs.prepare.outputs.build_kind }}
WEBCODEX_GIT_COMMIT: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_GIT_DIRTY: 'false'
ARCHIVE_STEM: ${{ needs.prepare.outputs.archive_stem }}
WEBCODEX_RELEASE_PLATFORM: ${{ matrix.platform }}
MANYLINUX_IMAGE: ${{ matrix.image }}
CARGO_CACHE_DIR: /tmp/webcodex-release-cargo-${{ matrix.platform }}
RUSTUP_CACHE_DIR: /tmp/webcodex-release-rustup-${{ matrix.platform }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
ref: refs/tags/${{ inputs.tag }}
- name: Restore Rust build cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
${{ env.CARGO_CACHE_DIR }}
${{ env.RUSTUP_CACHE_DIR }}
target
key: release-${{ matrix.platform }}-${{ hashFiles('Cargo.lock') }}-v1
restore-keys: |
release-${{ matrix.platform }}-
- name: Build and verify inside glibc 2.17 userspace
shell: bash
run: |
set -euo pipefail
mkdir -p "$CARGO_CACHE_DIR" "$RUSTUP_CACHE_DIR" dist
docker run --rm \
-v "$GITHUB_WORKSPACE:/work" \
-v "$CARGO_CACHE_DIR:/cargo" \
-v "$RUSTUP_CACHE_DIR:/rustup" \
-w /work \
-e CARGO_HOME=/cargo \
-e RUSTUP_HOME=/rustup \
-e VERSION \
-e SOURCE_SHA \
-e WEBCODEX_BUILT_AT \
-e WEBCODEX_RELEASE_VERSION \
-e WEBCODEX_GIT_COMMIT \
-e WEBCODEX_GIT_DIRTY \
-e BUILD_KIND \
-e ARCHIVE_STEM \
-e WEBCODEX_RELEASE_PLATFORM \
"$MANYLINUX_IMAGE" \
bash -lc '
set -euo pipefail
export PATH="/cargo/bin:$PATH"
git config --global --add safe.directory /work
if [ "$(uname -m)" != "${{ matrix.machine }}" ]; then
echo "Unexpected native architecture: $(uname -m)" >&2
exit 1
fi
if [ "$(git rev-parse HEAD)" != "$SOURCE_SHA" ]; then
echo "Build checkout does not match prepared release commit." >&2
exit 1
fi
if [ -n "$(git status --porcelain --untracked-files=all)" ]; then
echo "Build checkout is not clean before compilation." >&2
exit 1
fi
if ! command -v git >/dev/null 2>&1 || ! command -v curl >/dev/null 2>&1; then
yum install -y git curl
fi
if [ ! -x /cargo/bin/rustup ]; then
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal --default-toolchain stable
fi
rustup toolchain install stable --profile minimal
rustup default stable
rustc --version --verbose
cargo --version --verbose
cargo build --locked --release -p webcodex -p webcodex-cli -p webcodex-runner
for name in webcodex webcodex-server webcodex-runner; do
binary="target/release/$name"
output="$($binary --version)"
expected="$name $VERSION (commit $SOURCE_SHA, dirty=false, built_at=$WEBCODEX_BUILT_AT)"
if [ "$output" != "$expected" ]; then
echo "Unexpected $name release identity: $output" >&2
echo "Expected: $expected" >&2
exit 1
fi
if ! readelf -h "$binary" | grep -F "Machine:" | grep -Fq "${{ matrix.elf_machine }}"; then
echo "Unexpected ELF architecture for $binary" >&2
readelf -h "$binary" >&2
exit 1
fi
done
report="dist/${WEBCODEX_RELEASE_PLATFORM}-elf.txt"
: > "$report"
allowed_needed="libc.so.6 libm.so.6 libgcc_s.so.1 libpthread.so.0 libdl.so.2 librt.so.1 libresolv.so.2 ld-linux-x86-64.so.2 ld-linux-aarch64.so.1"
for name in webcodex webcodex-server webcodex-runner; do
binary="target/release/$name"
{
echo "== $name: ELF header =="
readelf -h "$binary"
echo "== $name: dynamic dependencies =="
readelf -d "$binary"
echo "== $name: version requirements =="
readelf --version-info "$binary"
echo
} >> "$report"
max_glibc="$(readelf --version-info "$binary" \
| grep -oE "GLIBC_[0-9]+(\.[0-9]+)*" \
| sed "s/^GLIBC_//" \
| sort -Vu \
| tail -n 1 || true)"
if [ -n "$max_glibc" ] && [ "$(printf "%s\n" 2.17 "$max_glibc" | sort -V | tail -n 1)" != "2.17" ]; then
echo "$binary requires GLIBC_$max_glibc, exceeding the 2.17 release floor." >&2
exit 1
fi
while IFS= read -r needed; do
case " $allowed_needed " in
*" $needed "*) ;;
*) echo "$binary has unexpected DT_NEEDED dependency: $needed" >&2; exit 1 ;;
esac
done < <(readelf -d "$binary" | sed -n "s/.*Shared library: \[\([^]]*\)\].*/\1/p")
done
scripts/package_release_artifact.sh dist
canonical_archive="dist/webcodex-v$VERSION-$WEBCODEX_RELEASE_PLATFORM.tar.gz"
archive="dist/$ARCHIVE_STEM-$WEBCODEX_RELEASE_PLATFORM.tar.gz"
if [ "$canonical_archive" != "$archive" ]; then
mv "$canonical_archive" "$archive"
fi
digest="$(sha256sum "$archive" | awk "{print \$1}")"
printf "%s %s\n" "$digest" "$(basename "$archive")" > "$archive.sha256"
'
- name: Upload Linux candidate
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}
path: |
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz.sha256
dist/${{ matrix.platform }}-elf.txt
if-no-files-found: error
retention-days: 7
compression-level: 0
macos:
needs: prepare
strategy:
fail-fast: false
matrix:
include:
- platform: darwin-arm64
runner: macos-15
host_arch: arm64
rust_host: aarch64-apple-darwin
file_arch: arm64
- platform: darwin-x64
runner: macos-15-intel
host_arch: x86_64
rust_host: x86_64-apple-darwin
file_arch: x86_64
runs-on: ${{ matrix.runner }}
timeout-minutes: 75
env:
WEBCODEX_MACOS_CERTIFICATE_SHA1: ${{ vars.MACOS_CERTIFICATE_SHA1 }}
VERSION: ${{ needs.prepare.outputs.version }}
SOURCE_SHA: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_BUILT_AT: ${{ needs.prepare.outputs.built_at }}
WEBCODEX_RELEASE_VERSION: ${{ needs.prepare.outputs.version }}
BUILD_KIND: ${{ needs.prepare.outputs.build_kind }}
WEBCODEX_GIT_COMMIT: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_GIT_DIRTY: 'false'
ARCHIVE_STEM: ${{ needs.prepare.outputs.archive_stem }}
WEBCODEX_RELEASE_PLATFORM: ${{ matrix.platform }}
EXPECTED_HOST_ARCH: ${{ matrix.host_arch }}
EXPECTED_RUST_HOST: ${{ matrix.rust_host }}
EXPECTED_FILE_ARCH: ${{ matrix.file_arch }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
ref: refs/tags/${{ inputs.tag }}
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: release-${{ matrix.platform }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
with:
node-version: 22
cache: npm
cache-dependency-path: |
frontend/package-lock.json
apps/desktop/package-lock.json
- name: Configure persistent macOS signing
shell: bash
env:
WEBCODEX_MACOS_SIGNING_MODE: ${{ vars.MACOS_SIGNING_MODE || 'self-signed' }}
WEBCODEX_MACOS_CERTIFICATE_SHA1: ${{ vars.MACOS_CERTIFICATE_SHA1 }}
APPLE_CERTIFICATE: ${{ secrets.MACOS_SIGNING_P12 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_SIGNING_P12_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ vars.MACOS_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
run: bash scripts/macos_ci_signing_setup.sh
- name: Probe native DMG services before compiling release binaries
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
run: bash scripts/macos_finalize_dmg.sh --preflight
- name: Build and verify native macOS candidate
shell: bash
run: |
set -euo pipefail
if [ "$(uname -m)" != "$EXPECTED_HOST_ARCH" ]; then
echo "Expected native macOS host $EXPECTED_HOST_ARCH, got $(uname -m)." >&2
exit 1
fi
rust_host="$(rustc -vV | sed -n 's/^host: //p')"
if [ "$rust_host" != "$EXPECTED_RUST_HOST" ]; then
echo "Expected native Rust host $EXPECTED_RUST_HOST, got $rust_host." >&2
rustc -vV >&2
exit 1
fi
if [ "$(git rev-parse HEAD)" != "$SOURCE_SHA" ]; then
echo "Build checkout does not match prepared release commit." >&2
exit 1
fi
if [ -n "$(git status --porcelain --untracked-files=all)" ]; then
echo "Build checkout is not clean before compilation." >&2
exit 1
fi
rustc --version --verbose
cargo build --locked --release -p webcodex -p webcodex-cli -p webcodex-runner
for name in webcodex webcodex-server webcodex-runner; do
binary="target/release/$name"
output="$($binary --version)"
expected="$name $VERSION (commit $SOURCE_SHA, dirty=false, built_at=$WEBCODEX_BUILT_AT)"
if [ "$output" != "$expected" ]; then
echo "Unexpected $name release identity: $output" >&2
exit 1
fi
file_output="$(file "$binary")"
if [[ "$file_output" != *"$EXPECTED_FILE_ARCH"* ]]; then
echo "Unexpected Mach-O architecture for $binary: $file_output" >&2
exit 1
fi
done
mkdir -p dist
bash scripts/macos_sign_runner.sh target/release/webcodex-runner "$APPLE_SIGNING_IDENTITY" "$WEBCODEX_MACOS_SIGNING_MODE"
scripts/package_release_artifact.sh dist
canonical_archive="dist/webcodex-v$VERSION-$WEBCODEX_RELEASE_PLATFORM.tar.gz"
archive="dist/$ARCHIVE_STEM-$WEBCODEX_RELEASE_PLATFORM.tar.gz"
if [ "$canonical_archive" != "$archive" ]; then
mv "$canonical_archive" "$archive"
fi
digest="$(shasum -a 256 "$archive" | awk '{print $1}')"
printf '%s %s\n' "$digest" "$(basename "$archive")" > "$archive.sha256"
- name: Install shared frontend dependencies
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
run: npm ci --prefix frontend
- name: Install macOS Desktop dependencies
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
run: npm ci --prefix apps/desktop
- name: Stage exact native runtime for macOS Desktop
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
id: desktop_bundle
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
stage="$RUNNER_TEMP/webcodex-desktop-$WEBCODEX_RELEASE_PLATFORM-bundle"
signing_mode="$WEBCODEX_MACOS_SIGNING_MODE"
if [ "$BUILD_KIND" = release ]; then
desktop_name="webcodex-desktop-v$VERSION-$WEBCODEX_RELEASE_PLATFORM.dmg"
else
desktop_name="webcodex-desktop-$INPUT_TAG-${SOURCE_SHA:0:12}-v$VERSION-$WEBCODEX_RELEASE_PLATFORM.dmg"
fi
python3 scripts/prepare_desktop_bundle_macos.py \
--bin-dir target/release \
--version "$VERSION" \
--source-sha "$SOURCE_SHA" \
--built-at "$WEBCODEX_BUILT_AT" \
--platform "$WEBCODEX_RELEASE_PLATFORM" \
--signing-mode "$signing_mode" \
--output-dir "$stage"
{
echo "config=$stage/tauri.bundle.conf.json"
echo "metadata=$stage/desktop-bundle.json"
echo "signing_mode=$signing_mode"
echo "desktop_name=$desktop_name"
} >> "$GITHUB_OUTPUT"
- name: Build native macOS Desktop DMG
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
id: desktop_dmg
working-directory: apps/desktop
shell: bash
env:
CI: "true"
WEBCODEX_MACOS_CERTIFICATE_SHA1: ${{ vars.MACOS_CERTIFICATE_SHA1 }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
run: |
set -euo pipefail
if [ "$WEBCODEX_MACOS_SIGNING_MODE" != developer-id ]; then
unset APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID
fi
export CARGO_TARGET_DIR="$RUNNER_TEMP/webcodex-desktop-$WEBCODEX_RELEASE_PLATFORM-tauri"
tauri_identity="$APPLE_SIGNING_IDENTITY"
if [ "$WEBCODEX_MACOS_SIGNING_MODE" = self-signed ]; then tauri_identity=-; fi
env -u APPLE_ID -u APPLE_PASSWORD -u APPLE_TEAM_ID APPLE_SIGNING_IDENTITY="$tauri_identity" npm exec tauri -- build \
--bundles dmg \
--config "${{ steps.desktop_bundle.outputs.config }}" \
--ci -- --locked
bundle_dir="$CARGO_TARGET_DIR/release/bundle/dmg"
shopt -s nullglob
candidates=("$bundle_dir"/*.dmg)
if [ "${#candidates[@]}" -ne 1 ]; then
echo "Expected exactly one native macOS DMG, found ${#candidates[@]}." >&2
exit 1
fi
desktop_dist="$GITHUB_WORKSPACE/dist"
mkdir -p "$desktop_dist"
desktop="$desktop_dist/${{ steps.desktop_bundle.outputs.desktop_name }}"
bash ../../scripts/macos_finalize_dmg.sh "${candidates[0]}" "$WEBCODEX_MACOS_SIGNING_MODE" "$APPLE_SIGNING_IDENTITY"
cp "${candidates[0]}" "$desktop"
digest="$(shasum -a 256 "$desktop" | awk '{print $1}')"
printf '%s %s\n' "$digest" "$(basename "$desktop")" > "$desktop.sha256"
echo "path=$desktop" >> "$GITHUB_OUTPUT"
- name: Preserve native DMG stage diagnostics
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: dmg-diagnostics-${{ matrix.platform }}-${{ github.run_attempt }}
path: target/dmg-diagnostics
if-no-files-found: ignore
retention-days: 7
- name: Smoke native macOS Desktop DMG and signing evidence
if: matrix.platform == 'darwin-arm64' || needs.prepare.outputs.desktop_darwin_x64_supplemental != 'true'
shell: bash
run: |
set -euo pipefail
bash scripts/desktop_install_macos_smoke.sh \
--dmg "${{ steps.desktop_dmg.outputs.path }}" \
--version "$VERSION" \
--source-sha "$SOURCE_SHA" \
--built-at "$WEBCODEX_BUILT_AT" \
--platform "$WEBCODEX_RELEASE_PLATFORM" \
--stage-metadata "${{ steps.desktop_bundle.outputs.metadata }}" \
--signing-mode "${{ steps.desktop_bundle.outputs.signing_mode }}" \
--evidence "$GITHUB_WORKSPACE/dist/${{ steps.desktop_bundle.outputs.desktop_name }}.evidence.json"
- name: Clean ephemeral signing material
if: always()
shell: bash
run: |
if [ -n "${WEBCODEX_SIGNING_KEYCHAIN:-}" ]; then
security delete-keychain "$WEBCODEX_SIGNING_KEYCHAIN"
fi
- name: Upload macOS candidate
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}
path: |
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz.sha256
dist/webcodex-desktop-*.dmg
dist/webcodex-desktop-*.dmg.sha256
dist/webcodex-desktop-*.dmg.evidence.json
if-no-files-found: error
retention-days: 7
compression-level: 0
windows:
needs: prepare
strategy:
fail-fast: false
matrix:
include:
- platform: win32-x64
runner: windows-latest
rust_target: x86_64-pc-windows-msvc
processor_architecture: AMD64
pe_machine: "8664"
node_architecture: x64
- platform: win32-arm64
runner: windows-11-arm
rust_target: aarch64-pc-windows-msvc
processor_architecture: ARM64
pe_machine: "AA64"
node_architecture: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
env:
VERSION: ${{ needs.prepare.outputs.version }}
SOURCE_SHA: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_BUILT_AT: ${{ needs.prepare.outputs.built_at }}
BUILD_KIND: ${{ needs.prepare.outputs.build_kind }}
ARCHIVE_STEM: ${{ needs.prepare.outputs.archive_stem }}
WEBCODEX_RELEASE_PLATFORM: ${{ matrix.platform }}
RUST_TARGET: ${{ matrix.rust_target }}
WEBCODEX_GIT_COMMIT: ${{ needs.prepare.outputs.source_sha }}
WEBCODEX_GIT_DIRTY: 'false'
INPUT_TAG: ${{ inputs.tag }}
EXPECTED_PROCESSOR_ARCHITECTURE: ${{ matrix.processor_architecture }}
EXPECTED_PE_MACHINE: ${{ matrix.pe_machine }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
ref: refs/tags/${{ inputs.tag }}
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
with:
targets: ${{ matrix.rust_target }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
architecture: ${{ matrix.node_architecture }}
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
with:
shared-key: release-${{ matrix.platform }}
- name: Build and verify native Windows candidate
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
if ($env:PROCESSOR_ARCHITECTURE -ne $env:EXPECTED_PROCESSOR_ARCHITECTURE) {
throw "Unexpected Windows host architecture: $env:PROCESSOR_ARCHITECTURE (expected $env:EXPECTED_PROCESSOR_ARCHITECTURE)"
}
$hostLine = rustc -vV | Select-String '^host: '
if ($hostLine.Line -ne "host: $env:RUST_TARGET") {
throw "Expected native Rust host $env:RUST_TARGET; got $($hostLine.Line)"
}
if ((git rev-parse HEAD).Trim() -ne $env:SOURCE_SHA) {
throw "Build checkout does not match prepared release commit."
}
if (@(git status --porcelain --untracked-files=all).Count -ne 0) {
throw "Build checkout is not clean before compilation."
}
rustc --version --verbose
cargo build --locked --release --target $env:RUST_TARGET -p webcodex -p webcodex-cli -p webcodex-runner
if ($LASTEXITCODE -ne 0) { throw "cargo build failed with exit code $LASTEXITCODE" }
$binDir = Join-Path "target" (Join-Path $env:RUST_TARGET "release")
$expectedMachine = [Convert]::ToUInt16($env:EXPECTED_PE_MACHINE, 16)
foreach ($name in @("webcodex", "webcodex-server", "webcodex-runner")) {
$binary = Join-Path $binDir "$name.exe"
$outputLines = @(& $binary --version)
$exitCode = $LASTEXITCODE
if ($exitCode -ne 0 -or $outputLines.Count -eq 0 -or -not $outputLines[0]) {
throw "$name --version failed with exit code $exitCode"
}
$output = $outputLines[0].TrimEnd()
$expected = "$name $env:VERSION (commit $env:SOURCE_SHA, dirty=false, built_at=$env:WEBCODEX_BUILT_AT)"
if ($output -ne $expected) {
throw "Unexpected $name release identity: $output (expected $expected)"
}
$bytes = [System.IO.File]::ReadAllBytes((Resolve-Path $binary))
if ($bytes.Length -lt 64) { throw "$binary is too small to be a PE image" }
$peOffset = [BitConverter]::ToInt32($bytes, 0x3c)
$machine = [BitConverter]::ToUInt16($bytes, $peOffset + 4)
if ($machine -ne $expectedMachine) {
throw ("Unexpected PE machine for {0}: 0x{1:x4}" -f $binary, $machine)
}
}
New-Item -ItemType Directory -Force -Path dist | Out-Null
$packArgs = @(
"-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "scripts\package_release_artifact.ps1",
"-BinDir", $binDir,
"-OutDir", "dist",
"-Version", $env:VERSION,
"-Platform", $env:WEBCODEX_RELEASE_PLATFORM
)
if ($env:BUILD_KIND -eq "verification") {
$packArgs += "-AllowDevelopmentBuild"
}
& powershell @packArgs
if ($LASTEXITCODE -ne 0) { throw "Windows release packaging failed with exit code $LASTEXITCODE" }
$canonicalArchive = Join-Path "dist" "webcodex-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM.tar.gz"
$archive = Join-Path "dist" "$env:ARCHIVE_STEM-$env:WEBCODEX_RELEASE_PLATFORM.tar.gz"
if ($canonicalArchive -ne $archive) {
Move-Item -LiteralPath $canonicalArchive -Destination $archive
}
$hash = (Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash.ToLowerInvariant()
$checksumLine = "$hash $(Split-Path -Leaf $archive)`n"
[System.IO.File]::WriteAllText("$archive.sha256", $checksumLine, [System.Text.Encoding]::ASCII)
- name: Smoke native Windows artifact through npm installer
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$binDir = Join-Path "target" (Join-Path $env:RUST_TARGET "release")
& .\scripts\npm_install_windows_smoke.ps1 `
-BinDir $binDir `
-Platform $env:WEBCODEX_RELEASE_PLATFORM
if ($LASTEXITCODE -ne 0) {
throw "native Windows npm smoke failed with exit code $LASTEXITCODE"
}
- name: Install shared frontend dependencies
run: npm ci --prefix frontend
- name: Install Desktop dependencies
run: npm ci --prefix apps/desktop
- name: Stage exact native Windows runtime for Desktop
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$binDir = Join-Path "target" (Join-Path $env:RUST_TARGET "release")
$stage = Join-Path $env:RUNNER_TEMP "webcodex-desktop-$env:WEBCODEX_RELEASE_PLATFORM-release-bundle"
& .\scripts\prepare_desktop_bundle.ps1 `
-BinDir $binDir `
-Version $env:VERSION `
-SourceSha $env:SOURCE_SHA `
-BuiltAt ([Int64]$env:WEBCODEX_BUILT_AT) `
-OutputDir $stage
$shortSource = $env:SOURCE_SHA.Substring(0, 12)
if ($env:BUILD_KIND -eq "release") {
$installerName = "webcodex-desktop-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM-setup.exe"
} else {
$installerName = "webcodex-desktop-$env:INPUT_TAG-$shortSource-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM-setup.exe"
}
$desktopDist = Join-Path $env:GITHUB_WORKSPACE "dist"
$installerPath = Join-Path $desktopDist $installerName
$tauriTarget = Join-Path $env:GITHUB_WORKSPACE "target\desktop-$env:WEBCODEX_RELEASE_PLATFORM-release-tauri"
"DESKTOP_TAURI_CONFIG=$(Join-Path $stage 'tauri.bundle.conf.json')" >> $env:GITHUB_ENV
"DESKTOP_TAURI_TARGET=$tauriTarget" >> $env:GITHUB_ENV
"DESKTOP_INSTALLER_NAME=$installerName" >> $env:GITHUB_ENV
"DESKTOP_INSTALLER_PATH=$installerPath" >> $env:GITHUB_ENV
- name: Build unsigned native Windows Desktop NSIS candidate
working-directory: apps/desktop
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$env:CARGO_TARGET_DIR = $env:DESKTOP_TAURI_TARGET
node node_modules/@tauri-apps/cli/tauri.js build --bundles nsis --config $env:DESKTOP_TAURI_CONFIG --ci --no-sign -- --locked
if ($LASTEXITCODE -ne 0) { throw "Tauri NSIS build failed" }
$bundleDir = Join-Path $env:CARGO_TARGET_DIR "release\bundle\nsis"
$built = @(Get-ChildItem -LiteralPath $bundleDir -Filter "*-setup.exe" -File)
if ($built.Count -ne 1) { throw "Expected exactly one NSIS candidate, found $($built.Count)" }
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $env:DESKTOP_INSTALLER_PATH) | Out-Null
Copy-Item -LiteralPath $built[0].FullName -Destination $env:DESKTOP_INSTALLER_PATH
$hash = (Get-FileHash -LiteralPath $env:DESKTOP_INSTALLER_PATH -Algorithm SHA256).Hash.ToLowerInvariant()
[System.IO.File]::WriteAllText(
"$($env:DESKTOP_INSTALLER_PATH).sha256",
"$hash $env:DESKTOP_INSTALLER_NAME`n",
[System.Text.Encoding]::ASCII
)
- name: Smoke native Windows Desktop NSIS candidate
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
& .\scripts\desktop_install_windows_smoke.ps1 `
-Installer $env:DESKTOP_INSTALLER_PATH `
-Version $env:VERSION `
-SourceSha $env:SOURCE_SHA `
-BuiltAt ([Int64]$env:WEBCODEX_BUILT_AT) `
-Platform $env:WEBCODEX_RELEASE_PLATFORM
- name: Install Python for Windows unified installer provenance
if: inputs.include_unified_installers
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: Collect native Windows unified installer inputs
if: inputs.include_unified_installers
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$binDir = Join-Path "target" (Join-Path $env:RUST_TARGET "release")
$tauriConfig = Get-Content -LiteralPath "apps/desktop/src-tauri/tauri.conf.json" -Raw | ConvertFrom-Json
if (-not $tauriConfig.mainBinaryName) { throw "Tauri mainBinaryName is missing" }
$desktopExe = Join-Path $env:DESKTOP_TAURI_TARGET ("release\{0}.exe" -f $tauriConfig.mainBinaryName)
if (-not (Test-Path -LiteralPath $desktopExe -PathType Leaf)) {
throw "Native Desktop executable missing: $desktopExe"
}
$inputRoot = Join-Path $env:RUNNER_TEMP "unified-input-$env:WEBCODEX_RELEASE_PLATFORM"
$binInput = Join-Path $inputRoot "artifacts\bin"
New-Item -ItemType Directory -Force -Path $binInput | Out-Null
foreach ($name in @("webcodex", "webcodex-server", "webcodex-runner")) {
Copy-Item -LiteralPath (Join-Path $binDir "$name.exe") -Destination (Join-Path $binInput "$name.exe")
}
Copy-Item -LiteralPath $desktopExe -Destination (Join-Path $binInput "webcodex-desktop.exe")
$candidate = Join-Path $env:RUNNER_TEMP "unified-candidate-$env:WEBCODEX_RELEASE_PLATFORM"
python scripts\collect_unified_installer_inputs.py `
--platform $env:WEBCODEX_RELEASE_PLATFORM `
--input-root $inputRoot `
--webcodex artifacts/bin/webcodex.exe `
--webcodex-server artifacts/bin/webcodex-server.exe `
--webcodex-runner artifacts/bin/webcodex-runner.exe `
--webcodex-desktop artifacts/bin/webcodex-desktop.exe `
--desktop-payload artifacts/bin/webcodex-desktop.exe `
--desktop-executable webcodex-desktop.exe `
--version $env:VERSION `
--source-sha $env:SOURCE_SHA `
--workflow-run-id $env:GITHUB_RUN_ID `
--workflow-ref $env:GITHUB_WORKFLOW_REF `
--output-dir $candidate
if ($LASTEXITCODE -ne 0) { throw "Native Windows provenance collection failed" }
$prepared = Join-Path $env:RUNNER_TEMP "unified-nsis-$env:WEBCODEX_RELEASE_PLATFORM"
python scripts\prepare_windows_unified_installer.py `
--candidate-dir $candidate `
--platform $env:WEBCODEX_RELEASE_PLATFORM `
--output-dir $prepared
if ($LASTEXITCODE -ne 0) { throw "Windows unified NSIS staging failed" }
"UNIFIED_CANDIDATE=$candidate" >> $env:GITHUB_ENV
"UNIFIED_TAURI_CONFIG=$(Join-Path $prepared 'tauri.unified-installer.conf.json')" >> $env:GITHUB_ENV
$installerName = "webcodex-unified-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM.exe"
"UNIFIED_INSTALLER_NAME=$installerName" >> $env:GITHUB_ENV
"UNIFIED_INSTALLER_PATH=$(Join-Path $env:GITHUB_WORKSPACE (Join-Path 'dist' $installerName))" >> $env:GITHUB_ENV
- name: Install NSIS compiler for the outer bootstrap
if: inputs.include_unified_installers
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
choco install nsis --yes --no-progress
$nsisRoots = @(
(Join-Path ${env:ProgramFiles(x86)} "NSIS\makensis.exe"),
(Join-Path $env:ProgramFiles "NSIS\makensis.exe")
)
$makensis = $nsisRoots | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
if (-not $makensis) { throw "NSIS was installed but makensis.exe was not found." }
Split-Path -Parent $makensis | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build native Tauri payload and outer Windows bootstrap
if: inputs.include_unified_installers
working-directory: apps/desktop
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$env:CARGO_TARGET_DIR = Join-Path $env:GITHUB_WORKSPACE "target\unified-$env:WEBCODEX_RELEASE_PLATFORM-release-tauri"
node node_modules/@tauri-apps/cli/tauri.js build --bundles nsis --config $env:UNIFIED_TAURI_CONFIG --ci --no-sign -- --locked
if ($LASTEXITCODE -ne 0) { throw "Unified Tauri payload NSIS build failed" }
$bundleDir = Join-Path $env:CARGO_TARGET_DIR "release\bundle\nsis"
$built = @(Get-ChildItem -LiteralPath $bundleDir -Filter "*-setup.exe" -File)
if ($built.Count -ne 1) { throw "Expected exactly one inner Tauri installer, found $($built.Count)" }
$inner = Join-Path $env:RUNNER_TEMP "webcodex-tauri-inner-$env:WEBCODEX_RELEASE_PLATFORM.exe"
Copy-Item -LiteralPath $built[0].FullName -Destination $inner
$sourceManifest = Join-Path $env:GITHUB_WORKSPACE "dist\webcodex-unified-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM.source-manifest.json"
$publicSourceManifest = Join-Path $env:GITHUB_WORKSPACE "dist\webcodex-source-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM.json"
$candidateSums = Join-Path $env:GITHUB_WORKSPACE "dist\webcodex-unified-v$env:VERSION-$env:WEBCODEX_RELEASE_PLATFORM.candidate-SHA256SUMS"
Copy-Item -LiteralPath (Join-Path $env:UNIFIED_CANDIDATE "source-manifest.json") -Destination $sourceManifest
Copy-Item -LiteralPath (Join-Path $env:UNIFIED_CANDIDATE "source-manifest.json") -Destination $publicSourceManifest
$publicSourceHash = (Get-FileHash -LiteralPath $publicSourceManifest -Algorithm SHA256).Hash.ToLowerInvariant()
[System.IO.File]::WriteAllText("$publicSourceManifest.sha256", "$publicSourceHash $(Split-Path -Leaf $publicSourceManifest)`n", [System.Text.Encoding]::ASCII)
Copy-Item -LiteralPath (Join-Path $env:UNIFIED_CANDIDATE "SHA256SUMS") -Destination $candidateSums
python "$env:GITHUB_WORKSPACE\scripts\build_windows_unified_bootstrap.py" `
--candidate-dir $env:UNIFIED_CANDIDATE `
--inner-installer $inner `
--platform $env:WEBCODEX_RELEASE_PLATFORM `
--output $env:UNIFIED_INSTALLER_PATH
if ($LASTEXITCODE -ne 0) { throw "Outer unified NSIS bootstrap build failed" }
$hash = (Get-FileHash -LiteralPath $env:UNIFIED_INSTALLER_PATH -Algorithm SHA256).Hash.ToLowerInvariant()
[System.IO.File]::WriteAllText(
"$($env:UNIFIED_INSTALLER_PATH).sha256",
"$hash $env:UNIFIED_INSTALLER_NAME`n",
[System.Text.Encoding]::ASCII
)
- name: Upload Windows unified installer and provenance
if: inputs.include_unified_installers
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ needs.prepare.outputs.archive_stem }}-unified-${{ matrix.platform }}
path: |
dist/webcodex-unified-*.exe
dist/webcodex-unified-*.exe.sha256
dist/webcodex-unified-*.exe.provenance.json
dist/webcodex-unified-*.source-manifest.json
dist/webcodex-source-v*.json
dist/webcodex-source-v*.json.sha256
dist/webcodex-unified-*.candidate-SHA256SUMS
if-no-files-found: error
retention-days: 7
compression-level: 0
- name: Upload Windows candidate
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}
path: |
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz
dist/${{ needs.prepare.outputs.archive_stem }}-${{ matrix.platform }}.tar.gz.sha256
if-no-files-found: error
retention-days: 7
compression-level: 0
- name: Upload native Windows Desktop candidate
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ needs.prepare.outputs.archive_stem }}-desktop-${{ matrix.platform }}
path: |
dist/webcodex-desktop-*-${{ matrix.platform }}-setup.exe
dist/webcodex-desktop-*-${{ matrix.platform }}-setup.exe.sha256
if-no-files-found: error
retention-days: 7
compression-level: 0
runtime-native:
needs: [prepare, linux]
if: inputs.include_runtime_installers
strategy:
fail-fast: false
matrix:
include:
- platform: linux-x64
runner: ubuntu-latest
architecture: x86_64
- platform: linux-arm64
runner: ubuntu-24.04-arm
architecture: aarch64
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
env:
VERSION: ${{ needs.prepare.outputs.version }}
SOURCE_SHA: ${{ needs.prepare.outputs.source_sha }}
ARCHIVE_STEM: ${{ needs.prepare.outputs.archive_stem }}
PLATFORM: ${{ matrix.platform }}
NATIVE_ARCHITECTURE: ${{ matrix.architecture }}
steps: