forked from inferno-os/inferno-os
-
Notifications
You must be signed in to change notification settings - Fork 1
1104 lines (909 loc) · 37.9 KB
/
release.yml
File metadata and controls
1104 lines (909 loc) · 37.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: Release
on:
push:
tags: ['v*']
workflow_dispatch:
permissions: {}
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
# ─────────────────────────────────────────────
# Linux AMD64: Headless emulator + toolchain
# ─────────────────────────────────────────────
linux-amd64:
name: Linux AMD64
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
env:
ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp build version
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_DATE=$(date +%Y%m%d)
SHORT_SHA=${GITHUB_SHA::8}
sed -i "s|InferNode 0.1|InferNode ${VERSION} build ${BUILD_DATE}-${SHORT_SHA}|" include/version.h
echo "Version: $(cat include/version.h)"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Build (headless)
run: |
chmod +x build-linux-amd64.sh
./build-linux-amd64.sh headless
- name: Verify build
run: |
test -x emu/Linux/o.emu || { echo "Emulator not built"; exit 1; }
test -x Linux/amd64/bin/limbo || { echo "Limbo compiler not built"; exit 1; }
test -x Linux/amd64/bin/mk || { echo "mk not built"; exit 1; }
- name: Compile test suite
run: |
LIMBO="$ROOT/Linux/amd64/bin/limbo"
mkdir -p dis/tests dis/lib
COMPILE_FAILURES=0
if [ -d tests/testing ]; then
cd tests/testing
for f in *.b; do
if [ -f "$f" ]; then
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/dis/lib/${f%.b}.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile testing/$f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
fi
done
cd "$ROOT"
fi
cd tests
for f in *.b; do
name="${f%.b}"
echo "Compiling $f..."
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/tests/$name.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile $f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
done
cd "$ROOT"
test -f tests/runner.dis || { echo "Test runner not compiled"; exit 1; }
echo "Compiled test .dis files:"
ls tests/*_test.dis 2>/dev/null | wc -l
if [ "$COMPILE_FAILURES" -gt 0 ]; then
echo "ERROR: $COMPILE_FAILURES test file(s) failed to compile"
exit 1
fi
- name: Run test suite
run: |
mkdir -p tmp
echo "Running test suite inside Inferno emulator..."
timeout 60 ./emu/Linux/o.emu -c1 -r . /tests/runner.dis -v > test-output.txt 2>&1 || true
cat test-output.txt
if grep -q "^PASS$" test-output.txt; then
echo "Tests passed."
elif grep -q "^FAIL$" test-output.txt; then
echo "Tests failed."
exit 1
else
echo "No test result found in output — tests may not have run."
exit 1
fi
- name: Run wallet and secstore integration tests
run: |
echo "Running host-side integration tests..."
if [ -f tests/host/wallet9p_test.sh ]; then
echo "--- wallet9p test ---"
chmod +x tests/host/wallet9p_test.sh
ROOT=. bash tests/host/wallet9p_test.sh > wallet9p-test.txt 2>&1 || true
cat wallet9p-test.txt
if grep -q "=== PASS ===" wallet9p-test.txt; then
echo "wallet9p test: PASS"
else
echo "wallet9p test: SKIP (requires full Inferno namespace)"
fi
fi
if [ -f tests/host/wallet_persist_test.sh ]; then
echo "--- wallet persistence test ---"
chmod +x tests/host/wallet_persist_test.sh
ROOT=. bash tests/host/wallet_persist_test.sh > wallet-persist-test.txt 2>&1 || true
cat wallet-persist-test.txt
if grep -q "^PASS$" wallet-persist-test.txt; then
echo "wallet persistence test: PASS"
else
echo "wallet persistence test: FAIL (non-fatal in CI)"
fi
fi
- name: Package archive
run: |
VERSION="${{ steps.version.outputs.version }}"
STAGE="infernode-${VERSION}-linux-amd64"
mkdir -p "$STAGE/emu/Linux" "$STAGE/Linux/amd64/bin"
# Platform binaries (stripped for release)
cp emu/Linux/o.emu "$STAGE/emu/Linux/"
cp Linux/amd64/bin/limbo Linux/amd64/bin/mk "$STAGE/Linux/amd64/bin/"
strip "$STAGE/emu/Linux/o.emu" "$STAGE/Linux/amd64/bin/limbo" "$STAGE/Linux/amd64/bin/mk"
# Shared runtime tree
for d in dis lib fonts module services locale usr mnt; do
[ -d "$d" ] && cp -a "$d" "$STAGE/"
done
# tmp directory (needed by profile)
mkdir -p "$STAGE/tmp"
# mkconfig and mkfiles (needed for building from source)
cp mkconfig "$STAGE/"
[ -d mkfiles ] && cp -a mkfiles "$STAGE/"
# Headless launcher
cp Linux/infernode-headless "$STAGE/"
chmod +x "$STAGE/infernode-headless"
# Build scripts (so users can rebuild with SDL3)
cp build-linux-amd64.sh "$STAGE/"
cp install-sdl3.sh "$STAGE/"
# Docs and legal
for f in LICENCE NOTICE TRADEMARK.md README.md QUICKSTART.md; do
[ -f "$f" ] && cp "$f" "$STAGE/"
done
tar czf "${STAGE}.tar.gz" "$STAGE"
echo "Archive: $(ls -lh ${STAGE}.tar.gz)"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: infernode-linux-amd64-archive
path: infernode-*-linux-amd64.tar.gz
retention-days: 3
# ─────────────────────────────────────────────
# Linux AMD64 GUI: SDL3 emulator + self-contained bundle
# ─────────────────────────────────────────────
linux-amd64-gui:
name: Linux AMD64 GUI
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: read
env:
ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp build version
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_DATE=$(date +%Y%m%d)
SHORT_SHA=${GITHUB_SHA::8}
sed -i "s|InferNode 0.1|InferNode ${VERSION} build ${BUILD_DATE}-${SHORT_SHA}|" include/version.h
echo "Version: $(cat include/version.h)"
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential cmake ninja-build \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev \
libwayland-dev libxkbcommon-dev libegl-dev libgles-dev \
libxtst-dev libdrm-dev libgbm-dev \
patchelf
- name: Build SDL3 from source
run: |
chmod +x install-sdl3.sh
./install-sdl3.sh
- name: Build (SDL3 GUI)
run: |
chmod +x build-linux-amd64.sh
./build-linux-amd64.sh
- name: Verify build
run: |
test -x emu/Linux/o.emu || { echo "Emulator not built"; exit 1; }
test -x Linux/amd64/bin/limbo || { echo "Limbo compiler not built"; exit 1; }
test -x Linux/amd64/bin/mk || { echo "mk not built"; exit 1; }
- name: Verify SDL3 linkage
run: |
ldd emu/Linux/o.emu | grep libSDL3 || { echo "Emulator not linked against SDL3"; exit 1; }
- name: Compile test suite
run: |
LIMBO="$ROOT/Linux/amd64/bin/limbo"
mkdir -p dis/tests dis/lib
COMPILE_FAILURES=0
if [ -d tests/testing ]; then
cd tests/testing
for f in *.b; do
if [ -f "$f" ]; then
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/dis/lib/${f%.b}.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile testing/$f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
fi
done
cd "$ROOT"
fi
cd tests
for f in *.b; do
name="${f%.b}"
echo "Compiling $f..."
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/tests/$name.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile $f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
done
cd "$ROOT"
test -f tests/runner.dis || { echo "Test runner not compiled"; exit 1; }
echo "Compiled test .dis files:"
ls tests/*_test.dis 2>/dev/null | wc -l
if [ "$COMPILE_FAILURES" -gt 0 ]; then
echo "ERROR: $COMPILE_FAILURES test file(s) failed to compile"
exit 1
fi
- name: Run test suite
env:
SDL_VIDEODRIVER: dummy
run: |
mkdir -p tmp
echo "Running test suite inside Inferno emulator..."
timeout 60 ./emu/Linux/o.emu -c1 -r . /tests/runner.dis -v > test-output.txt 2>&1 || true
cat test-output.txt
if grep -q "^PASS$" test-output.txt; then
echo "Tests passed."
elif grep -q "^FAIL$" test-output.txt; then
echo "Tests failed."
exit 1
else
echo "No test result found in output — tests may not have run."
exit 1
fi
- name: Run wallet and secstore integration tests
run: |
echo "Running host-side integration tests..."
if [ -f tests/host/wallet9p_test.sh ]; then
echo "--- wallet9p test ---"
chmod +x tests/host/wallet9p_test.sh
ROOT=. bash tests/host/wallet9p_test.sh > wallet9p-test.txt 2>&1 || true
cat wallet9p-test.txt
if grep -q "=== PASS ===" wallet9p-test.txt; then
echo "wallet9p test: PASS"
else
echo "wallet9p test: SKIP (requires full Inferno namespace)"
fi
fi
if [ -f tests/host/wallet_persist_test.sh ]; then
echo "--- wallet persistence test ---"
chmod +x tests/host/wallet_persist_test.sh
ROOT=. bash tests/host/wallet_persist_test.sh > wallet-persist-test.txt 2>&1 || true
cat wallet-persist-test.txt
if grep -q "^PASS$" wallet-persist-test.txt; then
echo "wallet persistence test: PASS"
else
echo "wallet persistence test: FAIL (non-fatal in CI)"
fi
fi
- name: Prepare self-contained binary
run: |
# Set RPATH so the emulator finds libSDL3.so.0 in its own directory
patchelf --set-rpath '$ORIGIN' emu/Linux/o.emu
# Verify
echo "RPATH set to:"
patchelf --print-rpath emu/Linux/o.emu
- name: Package self-contained tarball
run: |
VERSION="${{ steps.version.outputs.version }}"
STAGE="infernode-${VERSION}-linux-amd64-gui"
mkdir -p "$STAGE/bin" "$STAGE/resources"
# GUI launcher (user runs this)
cp Linux/infernode "$STAGE/"
chmod +x "$STAGE/infernode"
# Desktop integration
cp Linux/infernode.desktop "$STAGE/"
cp Nt/Assets/Square150x150Logo.png "$STAGE/infernode.png"
# Build scripts
cp build-linux-amd64.sh install-sdl3.sh "$STAGE/"
# Docs and legal
for f in LICENCE NOTICE TRADEMARK.md README.md QUICKSTART.md; do
[ -f "$f" ] && cp "$f" "$STAGE/"
done
# Emulator binary + bundled SDL3 (stripped for release)
cp emu/Linux/o.emu "$STAGE/bin/emu"
# Find and bundle libSDL3.so.0
SDL3_LIB=$(ldd emu/Linux/o.emu | grep libSDL3 | awk '{print $3}')
cp "$SDL3_LIB" "$STAGE/bin/libSDL3.so.0"
# Native tools
cp Linux/amd64/bin/limbo Linux/amd64/bin/mk "$STAGE/bin/"
strip "$STAGE/bin/emu" "$STAGE/bin/limbo" "$STAGE/bin/mk"
# Runtime tree into resources/
for d in dis lib fonts module services locale usr mnt; do
[ -d "$d" ] && cp -a "$d" "$STAGE/resources/"
done
mkdir -p "$STAGE/resources/tmp"
# mkconfig and mkfiles
cp mkconfig "$STAGE/resources/"
[ -d mkfiles ] && cp -a mkfiles "$STAGE/resources/"
# Distribution defaults for LLM config
cat > "$STAGE/resources/lib/ndb/llm" << 'LLMCONF'
mode=local
backend=api
url=https://api.anthropic.com
model=claude-sonnet-4-5-20250929
dial=
LLMCONF
tar czf "${STAGE}.tar.gz" "$STAGE"
echo "Archive: $(ls -lh ${STAGE}.tar.gz)"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: infernode-linux-amd64-gui-archive
path: infernode-*-linux-amd64-gui.tar.gz
retention-days: 3
# ─────────────────────────────────────────────
# Linux ARM64: Headless emulator + toolchain
# ─────────────────────────────────────────────
linux-arm64:
name: Linux ARM64
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
permissions:
contents: read
env:
ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp build version
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_DATE=$(date +%Y%m%d)
SHORT_SHA=${GITHUB_SHA::8}
sed -i "s|InferNode 0.1|InferNode ${VERSION} build ${BUILD_DATE}-${SHORT_SHA}|" include/version.h
echo "Version: $(cat include/version.h)"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Build (headless)
run: |
chmod +x build-linux-arm64.sh
./build-linux-arm64.sh headless
- name: Verify build
run: |
test -x emu/Linux/o.emu || { echo "Emulator not built"; exit 1; }
test -x Linux/arm64/bin/limbo || { echo "Limbo compiler not built"; exit 1; }
test -x Linux/arm64/bin/mk || { echo "mk not built"; exit 1; }
- name: Compile test suite
run: |
LIMBO="$ROOT/Linux/arm64/bin/limbo"
mkdir -p dis/tests dis/lib
COMPILE_FAILURES=0
if [ -d tests/testing ]; then
cd tests/testing
for f in *.b; do
if [ -f "$f" ]; then
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/dis/lib/${f%.b}.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile testing/$f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
fi
done
cd "$ROOT"
fi
cd tests
for f in *.b; do
name="${f%.b}"
echo "Compiling $f..."
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/tests/$name.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile $f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
done
cd "$ROOT"
test -f tests/runner.dis || { echo "Test runner not compiled"; exit 1; }
echo "Compiled test .dis files:"
ls tests/*_test.dis 2>/dev/null | wc -l
if [ "$COMPILE_FAILURES" -gt 0 ]; then
echo "ERROR: $COMPILE_FAILURES test file(s) failed to compile"
exit 1
fi
- name: Run test suite
run: |
mkdir -p tmp
echo "Running test suite inside Inferno emulator..."
timeout 60 ./emu/Linux/o.emu -c1 -r . /tests/runner.dis -v > test-output.txt 2>&1 || true
cat test-output.txt
if grep -q "^PASS$" test-output.txt; then
echo "Tests passed."
elif grep -q "^FAIL$" test-output.txt; then
echo "Tests failed."
exit 1
else
echo "No test result found in output — tests may not have run."
exit 1
fi
- name: Run wallet and secstore integration tests
run: |
echo "Running host-side integration tests..."
if [ -f tests/host/wallet9p_test.sh ]; then
echo "--- wallet9p test ---"
chmod +x tests/host/wallet9p_test.sh
ROOT=. bash tests/host/wallet9p_test.sh > wallet9p-test.txt 2>&1 || true
cat wallet9p-test.txt
if grep -q "=== PASS ===" wallet9p-test.txt; then
echo "wallet9p test: PASS"
else
echo "wallet9p test: SKIP (requires full Inferno namespace)"
fi
fi
if [ -f tests/host/wallet_persist_test.sh ]; then
echo "--- wallet persistence test ---"
chmod +x tests/host/wallet_persist_test.sh
ROOT=. bash tests/host/wallet_persist_test.sh > wallet-persist-test.txt 2>&1 || true
cat wallet-persist-test.txt
if grep -q "^PASS$" wallet-persist-test.txt; then
echo "wallet persistence test: PASS"
else
echo "wallet persistence test: FAIL (non-fatal in CI)"
fi
fi
- name: Package archive
run: |
VERSION="${{ steps.version.outputs.version }}"
STAGE="infernode-${VERSION}-linux-arm64"
mkdir -p "$STAGE/emu/Linux" "$STAGE/Linux/arm64/bin"
# Platform binaries
cp emu/Linux/o.emu "$STAGE/emu/Linux/"
cp Linux/arm64/bin/limbo Linux/arm64/bin/mk "$STAGE/Linux/arm64/bin/"
# Shared runtime tree
for d in dis lib fonts module services locale usr mnt; do
[ -d "$d" ] && cp -a "$d" "$STAGE/"
done
# tmp directory (needed by profile)
mkdir -p "$STAGE/tmp"
# mkconfig and mkfiles (needed for building from source)
cp mkconfig "$STAGE/"
[ -d mkfiles ] && cp -a mkfiles "$STAGE/"
# Headless launcher
cp Linux/infernode-headless "$STAGE/"
chmod +x "$STAGE/infernode-headless"
# Build scripts (so users can rebuild with SDL3)
cp build-linux-arm64.sh "$STAGE/"
cp install-sdl3.sh "$STAGE/"
# Docs and legal
for f in LICENCE NOTICE TRADEMARK.md README.md QUICKSTART.md; do
[ -f "$f" ] && cp "$f" "$STAGE/"
done
tar czf "${STAGE}.tar.gz" "$STAGE"
echo "Archive: $(ls -lh ${STAGE}.tar.gz)"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: infernode-linux-arm64-archive
path: infernode-*-linux-arm64.tar.gz
retention-days: 3
# ─────────────────────────────────────────────
# Linux ARM64 GUI: SDL3 emulator + self-contained bundle
# ─────────────────────────────────────────────
linux-arm64-gui:
name: Linux ARM64 GUI
runs-on: ubuntu-24.04-arm
timeout-minutes: 45
permissions:
contents: read
env:
ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp build version
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_DATE=$(date +%Y%m%d)
SHORT_SHA=${GITHUB_SHA::8}
sed -i "s|InferNode 0.1|InferNode ${VERSION} build ${BUILD_DATE}-${SHORT_SHA}|" include/version.h
echo "Version: $(cat include/version.h)"
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential cmake ninja-build \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev \
libwayland-dev libxkbcommon-dev libegl-dev libgles-dev \
libxtst-dev libdrm-dev libgbm-dev \
patchelf
- name: Build SDL3 from source
run: |
chmod +x install-sdl3.sh
./install-sdl3.sh
- name: Build (SDL3 GUI)
run: |
chmod +x build-linux-arm64.sh
./build-linux-arm64.sh
- name: Verify build
run: |
test -x emu/Linux/o.emu || { echo "Emulator not built"; exit 1; }
test -x Linux/arm64/bin/limbo || { echo "Limbo compiler not built"; exit 1; }
test -x Linux/arm64/bin/mk || { echo "mk not built"; exit 1; }
- name: Verify SDL3 linkage
run: |
ldd emu/Linux/o.emu | grep libSDL3 || { echo "Emulator not linked against SDL3"; exit 1; }
- name: Compile test suite
run: |
LIMBO="$ROOT/Linux/arm64/bin/limbo"
mkdir -p dis/tests dis/lib
COMPILE_FAILURES=0
if [ -d tests/testing ]; then
cd tests/testing
for f in *.b; do
if [ -f "$f" ]; then
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/dis/lib/${f%.b}.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile testing/$f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
fi
done
cd "$ROOT"
fi
cd tests
for f in *.b; do
name="${f%.b}"
echo "Compiling $f..."
if ! "$LIMBO" -I "$ROOT/module" -o "$ROOT/tests/$name.dis" "$f" 2>&1; then
echo "ERROR: Failed to compile $f"
COMPILE_FAILURES=$((COMPILE_FAILURES + 1))
fi
done
cd "$ROOT"
test -f tests/runner.dis || { echo "Test runner not compiled"; exit 1; }
echo "Compiled test .dis files:"
ls tests/*_test.dis 2>/dev/null | wc -l
if [ "$COMPILE_FAILURES" -gt 0 ]; then
echo "ERROR: $COMPILE_FAILURES test file(s) failed to compile"
exit 1
fi
- name: Run test suite
env:
SDL_VIDEODRIVER: dummy
run: |
mkdir -p tmp
echo "Running test suite inside Inferno emulator..."
timeout 60 ./emu/Linux/o.emu -c1 -r . /tests/runner.dis -v > test-output.txt 2>&1 || true
cat test-output.txt
if grep -q "^PASS$" test-output.txt; then
echo "Tests passed."
elif grep -q "^FAIL$" test-output.txt; then
echo "Tests failed."
exit 1
else
echo "No test result found in output — tests may not have run."
exit 1
fi
- name: Run wallet and secstore integration tests
run: |
echo "Running host-side integration tests..."
if [ -f tests/host/wallet9p_test.sh ]; then
echo "--- wallet9p test ---"
chmod +x tests/host/wallet9p_test.sh
ROOT=. bash tests/host/wallet9p_test.sh > wallet9p-test.txt 2>&1 || true
cat wallet9p-test.txt
if grep -q "=== PASS ===" wallet9p-test.txt; then
echo "wallet9p test: PASS"
else
echo "wallet9p test: SKIP (requires full Inferno namespace)"
fi
fi
if [ -f tests/host/wallet_persist_test.sh ]; then
echo "--- wallet persistence test ---"
chmod +x tests/host/wallet_persist_test.sh
ROOT=. bash tests/host/wallet_persist_test.sh > wallet-persist-test.txt 2>&1 || true
cat wallet-persist-test.txt
if grep -q "^PASS$" wallet-persist-test.txt; then
echo "wallet persistence test: PASS"
else
echo "wallet persistence test: FAIL (non-fatal in CI)"
fi
fi
- name: Prepare self-contained binary
run: |
# Set RPATH so the emulator finds libSDL3.so.0 in its own directory
patchelf --set-rpath '$ORIGIN' emu/Linux/o.emu
# Verify
echo "RPATH set to:"
patchelf --print-rpath emu/Linux/o.emu
- name: Package self-contained tarball
run: |
VERSION="${{ steps.version.outputs.version }}"
STAGE="infernode-${VERSION}-linux-arm64-gui"
mkdir -p "$STAGE/bin" "$STAGE/resources"
# GUI launcher (user runs this)
cp Linux/infernode "$STAGE/"
chmod +x "$STAGE/infernode"
# Desktop integration
cp Linux/infernode.desktop "$STAGE/"
cp Nt/Assets/Square150x150Logo.png "$STAGE/infernode.png"
# Build scripts
cp build-linux-arm64.sh install-sdl3.sh "$STAGE/"
# Docs and legal
for f in LICENCE NOTICE TRADEMARK.md README.md QUICKSTART.md; do
[ -f "$f" ] && cp "$f" "$STAGE/"
done
cp emu/Linux/o.emu "$STAGE/bin/emu"
# Find and bundle libSDL3.so.0
SDL3_LIB=$(ldd emu/Linux/o.emu | grep libSDL3 | awk '{print $3}')
cp "$SDL3_LIB" "$STAGE/bin/libSDL3.so.0"
# Native tools
cp Linux/arm64/bin/limbo Linux/arm64/bin/mk "$STAGE/bin/"
# Runtime tree into resources/
for d in dis lib fonts module services locale usr mnt; do
[ -d "$d" ] && cp -a "$d" "$STAGE/resources/"
done
mkdir -p "$STAGE/resources/tmp"
# mkconfig and mkfiles
cp mkconfig "$STAGE/resources/"
[ -d mkfiles ] && cp -a mkfiles "$STAGE/resources/"
# Distribution defaults for LLM config
cat > "$STAGE/resources/lib/ndb/llm" << 'LLMCONF'
mode=local
backend=api
url=https://api.anthropic.com
model=claude-sonnet-4-5-20250929
dial=
LLMCONF
tar czf "${STAGE}.tar.gz" "$STAGE"
echo "Archive: $(ls -lh ${STAGE}.tar.gz)"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: infernode-linux-arm64-gui-archive
path: infernode-*-linux-arm64-gui.tar.gz
retention-days: 3
# ─────────────────────────────────────────────
# macOS ARM64: SDL3 GUI emulator + .app bundle
# ─────────────────────────────────────────────
macos-arm64:
name: macOS ARM64
runs-on: macos-15
timeout-minutes: 30
permissions:
contents: read
env:
ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Stamp build version
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_DATE=$(date +%Y%m%d)
SHORT_SHA=${GITHUB_SHA::8}
sed -i '' "s|InferNode 0.1|InferNode ${VERSION} build ${BUILD_DATE}-${SHORT_SHA}|" include/version.h
echo "Version: $(cat include/version.h)"
- name: Install SDL3
run: brew install sdl3 sdl3_ttf
- name: Build mk
run: |
chmod +x makemk.sh
./makemk.sh
test -x MacOSX/arm64/bin/mk || { echo "mk build failed"; exit 1; }
- name: Build system libraries
run: |
export PATH="$ROOT/MacOSX/arm64/bin:/usr/bin:/bin"
for dir in lib9 libbio libmp libsec libmath; do
echo "Building $dir..."
(cd $dir && "$ROOT/MacOSX/arm64/bin/mk" install) || exit 1
done
- name: Build limbo compiler
run: |
export PATH="$ROOT/MacOSX/arm64/bin:/usr/bin:/bin"
(cd limbo && "$ROOT/MacOSX/arm64/bin/mk" install) || exit 1
test -x MacOSX/arm64/bin/limbo || { echo "limbo not found"; exit 1; }
- name: Build libinterp and remaining libraries
run: |
export PATH="$ROOT/MacOSX/arm64/bin:/usr/bin:/bin"
(cd libinterp && "$ROOT/MacOSX/arm64/bin/mk" install) || exit 1
for dir in libfreetype libkeyring libdraw libmemdraw libmemlayer; do
echo "Building $dir..."
(cd $dir && "$ROOT/MacOSX/arm64/bin/mk" install) || true
done
- name: Build SDL3 GUI emulator
run: |
export PATH="$ROOT/MacOSX/arm64/bin:/usr/bin:/bin"
cd emu/MacOSX
mk clean 2>/dev/null || true
OBJTYPE=arm64 SYSTARG=MacOSX SHELL=/bin/sh mk GUIBACK=sdl3
test -f o.emu || { echo "Emulator build failed"; exit 1; }
- name: Prepare macOS binary
run: |
# Copy o.emu to InferNode so macOS shows correct app name in Dock/menu
cp emu/MacOSX/o.emu emu/MacOSX/InferNode
# Bundle SDL3 dylib next to the binary
SDL3_DYLIB=$(otool -L emu/MacOSX/InferNode | grep libSDL3 | awk '{print $1}')
cp "$SDL3_DYLIB" emu/MacOSX/libSDL3.0.dylib
# Rewrite InferNode to load SDL3 from its own directory
install_name_tool -change "$SDL3_DYLIB" \
@executable_path/libSDL3.0.dylib emu/MacOSX/InferNode
# Verify
echo "Updated load paths:"
otool -L emu/MacOSX/InferNode | grep -i sdl
- name: Import signing certificate
env:
APPLE_CERTIFICATE_P12: ${{ secrets.APPLE_CERTIFICATE_P12 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
echo "$APPLE_CERTIFICATE_P12" | base64 --decode > /tmp/certificate.p12
security create-keychain -p "" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
security import /tmp/certificate.p12 -k build.keychain \
-P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productsign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
security find-identity -v -p codesigning build.keychain
rm /tmp/certificate.p12
- name: Package self-contained app bundle
run: |
VERSION="${{ steps.version.outputs.version }}"
APP="InferNode.app"
CONTENTS="$APP/Contents"
MACOS="$CONTENTS/MacOS"
RESOURCES="$CONTENTS/Resources"
# Start from the checked-out .app bundle (has Info.plist, icon, launcher)
cp -a MacOSX/InferNode.app "$APP"
# Emulator binary and SDL3 go in Contents/MacOS/ (stripped for release)
cp emu/MacOSX/InferNode "$MACOS/emu"
cp emu/MacOSX/libSDL3.0.dylib "$MACOS/"
# Native tools
mkdir -p "$MACOS/tools"
cp MacOSX/arm64/bin/limbo MacOSX/arm64/bin/mk "$MACOS/tools/"
# Strip debug symbols before signing
strip "$MACOS/emu" "$MACOS/tools/limbo" "$MACOS/tools/mk"
# Runtime tree goes in Contents/Resources/
for d in dis lib fonts module services locale usr mnt; do
[ -d "$d" ] && cp -a "$d" "$RESOURCES/"
done
mkdir -p "$RESOURCES/tmp" "$RESOURCES/usr/inferno/secstore" "$RESOURCES/usr/inferno/tmp"
# Set distribution defaults for LLM config
# (dev config may point to internal servers)
cat > "$RESOURCES/lib/ndb/llm" << 'LLMCONF'
mode=local
backend=api
url=https://api.anthropic.com
model=claude-sonnet-4-5-20250929
dial=
LLMCONF
cp mkconfig "$RESOURCES/"
[ -d mkfiles ] && cp -a mkfiles "$RESOURCES/"
# Docs and build scripts in Resources
for f in LICENCE NOTICE TRADEMARK.md README.md QUICKSTART.md \
build-macos-sdl3.sh build-macos-headless.sh makemk.sh; do
[ -f "$f" ] && cp "$f" "$RESOURCES/"
done
- name: Sign app bundle
run: |
IDENTITY="Developer ID Application: Synectify, Pte Ltd (TJ448C32Q3)"
APP="InferNode.app"
cat > /tmp/emu-entitlements.plist << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>
PLIST
# Sign innermost binaries first
codesign --force --options runtime --timestamp \
--sign "$IDENTITY" "$APP/Contents/MacOS/libSDL3.0.dylib"
codesign --force --options runtime --timestamp \
--entitlements /tmp/emu-entitlements.plist \
--sign "$IDENTITY" "$APP/Contents/MacOS/emu"
for tool in "$APP/Contents/MacOS/tools/limbo" "$APP/Contents/MacOS/tools/mk"; do
[ -f "$tool" ] && codesign --force --options runtime --timestamp \
--sign "$IDENTITY" "$tool"
done
[ -f "$APP/Contents/MacOS/llm9p" ] && codesign --force --options runtime --timestamp \
--sign "$IDENTITY" "$APP/Contents/MacOS/llm9p"
# Sign the entire .app bundle (must be last)
codesign --force --options runtime --timestamp \
--entitlements /tmp/emu-entitlements.plist \
--sign "$IDENTITY" "$APP"
codesign -dvv "$APP"
- name: Create and notarize DMG
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
run: |
VERSION="${{ steps.version.outputs.version }}"
DMG="infernode-${VERSION}-macos-arm64.dmg"
hdiutil create -volname "InferNode" \
-srcfolder InferNode.app -ov -format UDZO "$DMG"
xcrun notarytool submit "$DMG" \
--apple-id "$APPLE_ID" \
--team-id "$APPLE_TEAM_ID" \
--password "$APPLE_APP_PASSWORD" \
--wait --timeout 15m
xcrun stapler staple "$DMG"
echo "DMG: $(ls -lh $DMG)"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: infernode-macos-arm64-archive
path: infernode-*-macos-arm64.dmg