Repository navigation
2874 lines (2635 loc) · 143 KB
/
Copy pathbuild.yml
File metadata and controls
2874 lines (2635 loc) · 143 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: Build Notepatra
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: false
jobs:
build-linux:
runs-on: ubuntu-24.04
# Fail fast instead of burning the 360-minute default on a wedge.
timeout-minutes: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake \
qtbase5-dev libqscintilla2-qt5-dev \
libqt5charts5-dev libqt5sql5-sqlite \
qtwebengine5-dev libqt5webenginewidgets5 \
libqt5svg5-dev qt5-image-formats-plugins
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @ 2026-05-14
- name: Audit Rust dependencies (cargo-audit)
run: |
# Install cargo-audit to scan Cargo.lock for known CVEs in transitive
# deps. Treat advisories as warnings (don't break the build) but make
# them visible in the GH Actions summary.
cargo install --locked cargo-audit 2>&1 | tail -5 || true
cd rust-core && cargo audit || echo "::warning::cargo-audit reported advisories — review them"
- name: Build Rust core
run: cd rust-core && cargo build --release
- name: Build C++
run: |
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
- name: Build regression tests (CMake targets)
run: |
# Reconfigure with -DBUILD_TESTING=ON so the existing smoke and
# regression binaries are registered through CTest in the same build
# tree as the main executable.
# -DCMAKE_BUILD_TYPE=Release explicitly re-asserted so a hypothetical
# generator switch (Ninja Multi-Config) or wiped cache can't silently
# run Debug binaries through ctest.
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build . --parallel "$(nproc)" \
--target notepatra_all_tests
- name: Run regression suite
run: |
ls -lh build/notepatra
file build/notepatra
build/notepatra --version || true
cd build
QT_QPA_PLATFORM=offscreen ctest --output-on-failure
# v0.1.118 — MCP sidecar; ships as notepatra-mcp-linux-x64.tar.gz.
#
# ORDERING LAW (all four platform jobs): `cargo test --features remote`
# REBUILDS target/release/notepatra-mcp WITH remote compiled in, because
# cargo unifies the bin's features when it builds the integration tests
# that depend on it. So the LAST cargo invocation before the upload must
# be a plain `cargo build --release`, and we then assert the flavor —
# otherwise we would silently ship a crypto-linked sidecar.
- name: Build and test MCP server
timeout-minutes: 25
run: |
cd notepatra-mcp
cargo test --release
cargo test --release --features remote
cargo build --release
# Flavor assertion. `serve` is remote-only: a std-only build prints
# "built without remote support" and exits 2 immediately.
#
# MUST be time-capped and backgrounded, NOT `OUT=$(... serve)`: on a
# remote-ENABLED build `serve` binds a port and blocks forever, so a
# command substitution would wait on an EOF that never comes and hang
# the job — in precisely the failure case this exists to catch. A
# hang is not a red state. Capped at 10s, then killed, then we judge
# by what it printed. </dev/null so it can never wait on stdin.
./target/release/notepatra-mcp serve </dev/null >flavor.txt 2>&1 & PID=$!
for _ in $(seq 1 20); do kill -0 $PID 2>/dev/null || break; sleep 0.5; done
kill -9 $PID 2>/dev/null || true
wait $PID 2>/dev/null || true
grep -q "built without remote support" flavor.txt || { echo "::error::shipped sidecar unexpectedly has remote support compiled in"; cat flavor.txt; exit 1; }
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64
path: build/notepatra
- name: Upload MCP server artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-mcp-linux-x64
path: notepatra-mcp/target/release/notepatra-mcp
# v0.1.64 — "Full" flavor (bundles QtWebEngine). The lite binary
# above is the default download; users who want inline Vega-Lite
# chart rendering grab this -full artifact instead. CMake's
# NOTEPATRA_WITH_WEBENGINE=ON flips on the WebEngine linkage and
# the renderer's WebEngine code path. ~85 MB extra on disk; ships
# alongside the lite artifact in every Release.
- name: Build C++ (full flavor — WebEngine bundled)
run: |
rm -rf build-full && mkdir -p build-full && cd build-full
# v0.1.107 — fetch + SHA-pin DuckDB v1.1.3 *C library* (NOT the CLI)
# for the Full flavor. libduckdb-linux-amd64.zip ships libduckdb.so +
# duckdb.h + duckdb.hpp at the zip root; CMake (Full) auto-detects it.
mkdir -p ../vendor/duckdb
curl -fL -o /tmp/libduckdb.zip https://github.com/duckdb/duckdb/releases/download/v1.1.3/libduckdb-linux-amd64.zip
echo "81199bf01b6d49941a38f426cad60e73c1ccd43f1f769a65ed8097d53fc7e40b /tmp/libduckdb.zip" | sha256sum -c - || { echo "::error::DuckDB x64 SHA256 mismatch"; exit 1; }
unzip -o /tmp/libduckdb.zip -d ../vendor/duckdb
test -f ../vendor/duckdb/libduckdb.so || { echo "::error::libduckdb.so missing after unzip"; exit 1; }
cmake .. -DCMAKE_BUILD_TYPE=Release -DNOTEPATRA_WITH_WEBENGINE=ON
make -j$(nproc)
ls -lh notepatra
ldd notepatra | grep -i webengine | head -3 || echo "WARN: full build did not link WebEngine"
ldd notepatra | grep -i duckdb || { echo "::error::Full build did not link DuckDB"; exit 1; }
# Stage libduckdb.so next to the binary so the $ORIGIN rpath resolves it.
cp ../vendor/duckdb/libduckdb.so .
# Runtime smoke test — v0.1.63 was a RUNTIME crash behind
# #ifdef NOTEPATRA_WITH_WEBENGINE; a compile-clean / link-broken
# binary would pass `ldd` and the lite ctest above, then crash in
# the wild. Headless --version forces Qt+WebEngine to initialize.
QT_QPA_PLATFORM=offscreen ./notepatra --version
- name: Upload artifact (full flavor)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64-full
path: |
build-full/notepatra
build-full/libduckdb.so
# ─── v0.1.72: Fleet-grade Linux installers ───────────────────────
# .deb + .rpm + AppImage for the regular (lite) flavor, plus a
# cloud-free .deb (notepatra-local-ai) built from a second pass
# with -DNOTEPATRA_NO_CLOUD=ON. All three formats use the lite
# binary; heavy bits stay opt-in per the project's bare-binary
# policy. Local Docker verification is in installers/{debian,rpm,
# appimage}/build-*.sh — they're authoritative; if anything in this
# block fails, the scripts themselves work standalone.
- name: Build C++ (cloud-free flavor for local-ai .deb)
run: |
rm -rf build-nocloud && mkdir -p build-nocloud && cd build-nocloud
cmake .. -DCMAKE_BUILD_TYPE=Release -DNOTEPATRA_NO_CLOUD=ON
make -j$(nproc) notepatra
./notepatra --version
- name: Install packaging deps
run: |
sudo apt-get install -y \
patchelf fakeroot dpkg-dev rpm \
curl ca-certificates file zsync libfuse2 \
qt5-qmake qttranslations5-l10n libqt5svg5 \
libxcb-cursor0 desktop-file-utils
- name: Build .deb (regular + cloud-free)
run: |
VERSION=$(grep -E "^project.*VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')
bash installers/debian/build-deb.sh "$VERSION" amd64 regular build
bash installers/debian/build-deb.sh "$VERSION" amd64 local-ai build-nocloud
ls -lh notepatra*amd64.deb
- name: Build .rpm
run: |
VERSION=$(grep -E "^project.*VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')
bash installers/rpm/build-rpm.sh "$VERSION" x86_64 build
ls -lh notepatra-*x86_64.rpm
- name: Build AppImage (x86_64)
run: |
VERSION=$(grep -E "^project.*VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')
bash installers/appimage/build-appimage.sh "$VERSION" x86_64 build
ls -lh Notepatra-*x86_64.AppImage
- name: Upload artifact (.deb regular)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64-deb
path: notepatra_*_amd64.deb
- name: Upload artifact (.deb local-ai cloud-free)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64-deb-local-ai
path: notepatra-local-ai_*_amd64.deb
- name: Upload artifact (.rpm)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64-rpm
path: notepatra-*x86_64.rpm
- name: Upload artifact (AppImage)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-x64-appimage
path: Notepatra-*x86_64.AppImage
build-linux-arm:
runs-on: ubuntu-24.04-arm
# Fail fast instead of burning the 360-minute default on a wedge.
timeout-minutes: 120
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake \
qtbase5-dev libqscintilla2-qt5-dev \
libqt5charts5-dev libqt5sql5-sqlite \
qtwebengine5-dev libqt5webenginewidgets5 \
libqt5svg5-dev qt5-image-formats-plugins
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @ 2026-05-14
- name: Audit Rust dependencies (cargo-audit)
run: |
cargo install --locked cargo-audit 2>&1 | tail -5 || true
cd rust-core && cargo audit || echo "::warning::cargo-audit reported advisories — review them"
- name: Build Rust core
run: cd rust-core && cargo build --release
- name: Build C++
run: |
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
- name: Build regression tests (CMake targets)
run: |
# See x64 job — Release re-asserted so generator switches can't
# silently swap Debug binaries into ctest.
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build . --parallel "$(nproc)" \
--target notepatra_all_tests
- name: Run regression suite
run: |
ls -lh build/notepatra
file build/notepatra
build/notepatra --version || true
cd build
QT_QPA_PLATFORM=offscreen ctest --output-on-failure
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-arm64
path: build/notepatra
# v0.1.118 — MCP sidecar. Runs the full default + remote suites natively
# on arm64 rather than trusting the x64 job: pointer-width and alignment
# differences are exactly what a cross-arch suite exists to catch.
# Same ordering law as the x64 job — plain build LAST, then assert flavor.
- name: Build and test MCP server
timeout-minutes: 25
run: |
cd notepatra-mcp
cargo test --release
cargo test --release --features remote
cargo build --release
# Time-capped flavor assertion — see the x64 job for why this cannot
# be a plain command substitution.
./target/release/notepatra-mcp serve </dev/null >flavor.txt 2>&1 & PID=$!
for _ in $(seq 1 20); do kill -0 $PID 2>/dev/null || break; sleep 0.5; done
kill -9 $PID 2>/dev/null || true
wait $PID 2>/dev/null || true
grep -q "built without remote support" flavor.txt || { echo "::error::shipped sidecar unexpectedly has remote support compiled in"; cat flavor.txt; exit 1; }
- name: Upload MCP server artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-mcp-linux-arm64
path: notepatra-mcp/target/release/notepatra-mcp
# v0.1.64 — Full flavor for ARM. Same dual-output pattern as x64.
- name: Build C++ (full flavor — WebEngine bundled)
run: |
rm -rf build-full && mkdir -p build-full && cd build-full
# v0.1.107 — fetch + SHA-pin DuckDB v1.1.3 C library (aarch64).
mkdir -p ../vendor/duckdb
curl -fL -o /tmp/libduckdb.zip https://github.com/duckdb/duckdb/releases/download/v1.1.3/libduckdb-linux-aarch64.zip
echo "9069db3627456ab8b14399a73cd8d450c7863b1bc93b2b197d157ea18bad7801 /tmp/libduckdb.zip" | sha256sum -c - || { echo "::error::DuckDB arm64 SHA256 mismatch"; exit 1; }
unzip -o /tmp/libduckdb.zip -d ../vendor/duckdb
test -f ../vendor/duckdb/libduckdb.so || { echo "::error::libduckdb.so missing after unzip"; exit 1; }
cmake .. -DCMAKE_BUILD_TYPE=Release -DNOTEPATRA_WITH_WEBENGINE=ON
make -j$(nproc)
ls -lh notepatra
ldd notepatra | grep -i webengine | head -3 || echo "WARN: full ARM build did not link WebEngine"
ldd notepatra | grep -i duckdb || { echo "::error::Full ARM build did not link DuckDB"; exit 1; }
# Stage libduckdb.so next to the binary so the $ORIGIN rpath resolves it.
cp ../vendor/duckdb/libduckdb.so .
# Runtime smoke test — see x64 job for v0.1.63 backstory.
QT_QPA_PLATFORM=offscreen ./notepatra --version
- name: Upload artifact (full flavor)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-arm64-full
path: |
build-full/notepatra
build-full/libduckdb.so
# ─── v0.1.72: Fleet-grade Linux installers (ARM64) ───────────────
# Same .deb + .rpm matrix as x64. No AppImage on ARM in this
# release — linuxdeploy's aarch64 plugin support is less mature
# and we want to ship a known-good initial set; ARM AppImage can
# land in v0.1.73 after the v0.1.72 .deb/.rpm flow proves out.
- name: Build C++ (cloud-free flavor for local-ai .deb)
run: |
rm -rf build-nocloud && mkdir -p build-nocloud && cd build-nocloud
cmake .. -DCMAKE_BUILD_TYPE=Release -DNOTEPATRA_NO_CLOUD=ON
make -j$(nproc) notepatra
./notepatra --version
- name: Install packaging deps
run: |
sudo apt-get install -y patchelf fakeroot dpkg-dev rpm
- name: Build .deb (regular + cloud-free)
run: |
VERSION=$(grep -E "^project.*VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')
bash installers/debian/build-deb.sh "$VERSION" arm64 regular build
bash installers/debian/build-deb.sh "$VERSION" arm64 local-ai build-nocloud
ls -lh notepatra*arm64.deb
- name: Build .rpm
run: |
VERSION=$(grep -E "^project.*VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9.]+).*/\1/')
bash installers/rpm/build-rpm.sh "$VERSION" aarch64 build
ls -lh notepatra-*aarch64.rpm
- name: Upload artifact (.deb regular ARM)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-arm64-deb
path: notepatra_*_arm64.deb
- name: Upload artifact (.deb local-ai ARM)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-arm64-deb-local-ai
path: notepatra-local-ai_*_arm64.deb
- name: Upload artifact (.rpm ARM)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-linux-arm64-rpm
path: notepatra-*aarch64.rpm
# Note: Intel Mac (macos-13) build was removed — Apple stopped selling Intel Macs in 2023,
# and the macos-13 free runner has been unreliable. Apple Silicon build covers all current
# Macs (M1/M2/M3/M4). Intel Mac users can build from source.
build-macos-arm:
runs-on: macos-14
# Fail fast instead of burning the 360-minute default on a wedge.
timeout-minutes: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install dependencies
run: |
brew install qt@5 cmake
QT_PATH=$(brew --prefix qt@5)
export PATH="$QT_PATH/bin:$PATH"
export PKG_CONFIG_PATH="$QT_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
curl -L -o qscintilla.tar.gz \
"https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.14.1/QScintilla_src-2.14.1.tar.gz"
tar xzf qscintilla.tar.gz
cd QScintilla_src-2.14.1/src
"$QT_PATH/bin/qmake" qscintilla.pro
make VERBOSE=1 2>&1 | tail -200
sudo make install
echo "=== Verify QScintilla install ==="
ls -la "$QT_PATH/lib/"libqscintilla2* 2>/dev/null || true
ls -la "$QT_PATH/include/Qsci/" 2>/dev/null | head -5 || true
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @ 2026-05-14
- name: Build Rust core
run: cd rust-core && cargo build --release
- name: Build C++
run: |
QT_PATH=$(brew --prefix qt@5)
export PATH="$QT_PATH/bin:$PATH"
# Find QScintilla wherever make install put it
echo "=== Searching for QScintilla ==="
find /opt/homebrew /usr/local -name "libqscintilla2*" 2>/dev/null
find /opt/homebrew /usr/local -name "qsciscintilla.h" 2>/dev/null
QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2_qt5*dylib" 2>/dev/null | head -1)
[ -z "$QSC_LIB" ] && QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2*dylib" 2>/dev/null | head -1)
[ -z "$QSC_LIB" ] && QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2*" -not -name "*.dSYM" 2>/dev/null | head -1)
QSC_HDR=$(find /opt/homebrew /usr/local -name "qsciscintilla.h" 2>/dev/null | head -1)
QSC_INC=$(dirname $(dirname "$QSC_HDR"))
echo "Lib: $QSC_LIB"
echo "Inc: $QSC_INC"
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$QT_PATH" \
-DQSCINTILLA_INCLUDE="$QSC_INC" \
-DQSCINTILLA_LIB="$QSC_LIB"
make VERBOSE=1 2>&1 | tail -200
- name: Build C++ (full flavor — WebEngine + DuckDB bundled)
run: |
QT_PATH=$(brew --prefix qt@5)
export PATH="$QT_PATH/bin:$PATH"
# Find QScintilla location (same as Lite build)
echo "=== Searching for QScintilla =="
QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2_qt5*dylib" 2>/dev/null | head -1)
[ -z "$QSC_LIB" ] && QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2*dylib" 2>/dev/null | head -1)
QSC_HDR=$(find /opt/homebrew /usr/local -name "qsciscintilla.h" 2>/dev/null | head -1)
QSC_INC=$(dirname $(dirname "$QSC_HDR"))
echo "Lib: $QSC_LIB"
echo "Inc: $QSC_INC"
# v0.1.107 — fetch + SHA-pin DuckDB v1.1.3 macOS universal C library
mkdir -p vendor/duckdb
curl -fL -o /tmp/libduckdb-osx.zip https://github.com/duckdb/duckdb/releases/download/v1.1.3/libduckdb-osx-universal.zip
echo "35d2d1c7da9770ccd70590f50313045382a44d06070580c0abf4e8eb2cccc405 /tmp/libduckdb-osx.zip" | shasum -a 256 -c - || { echo "::error::DuckDB macOS SHA256 mismatch"; exit 1; }
unzip -o /tmp/libduckdb-osx.zip -d vendor/duckdb
test -f vendor/duckdb/libduckdb.dylib || { echo "::error::libduckdb.dylib missing after unzip"; exit 1; }
echo "✓ DuckDB v1.1.3 verified and extracted"
rm -rf build-full && mkdir -p build-full && cd build-full
# macOS Full = DuckDB engine. Homebrew qt@5 dropped QtWebEngine
# (Chromium CVEs) and there is no arm64-native Qt5 WebEngine, so the
# WebEngine probe downgrades to a stub here — DuckDB is the macOS Full
# feature. NOTEPATRA_FULL enables DuckDB regardless of WebEngine.
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$QT_PATH" \
-DQSCINTILLA_INCLUDE="$QSC_INC" \
-DQSCINTILLA_LIB="$QSC_LIB" \
-DNOTEPATRA_FULL=ON
make VERBOSE=1 2>&1 | tail -200
# macOS links into an app bundle (MACOSX_BUNDLE), NOT a bare ./notepatra
# like Linux. The binary lives at Notepatra.app/Contents/MacOS/Notepatra.
BIN=Notepatra.app/Contents/MacOS/Notepatra
test -f "$BIN" || { echo "::error::macOS Full binary not found at $BIN"; ls -lR . | head -40; exit 1; }
ls -lh "$BIN"
otool -L "$BIN" | grep -i webengine | head -3 || echo "note: macOS Full has no WebEngine (brew qt@5 dropped it) — DuckDB only"
otool -L "$BIN" | grep -i duckdb || { echo "::error::Full build did not link DuckDB"; exit 1; }
echo "✓ macOS Full binary built (DuckDB engine; WebEngine N/A on brew qt@5)"
- name: Build and run regression suite
# ctest's blanket TIMEOUT 600 is per-TEST, not per-step: a systemic wedge across ~48 tests still runs for hours without this.
timeout-minutes: 75
run: |
# Reuse the same Qt5/QScintilla discovery the main build did by
# reconfiguring the existing build tree with -DBUILD_TESTING=ON.
QT_PATH=$(brew --prefix qt@5)
QSC_LIB=$(find /opt/homebrew /usr/local -name "libqscintilla2_qt5*dylib" 2>/dev/null | head -1)
QSC_HDR=$(find /opt/homebrew /usr/local -name "qsciscintilla.h" 2>/dev/null | head -1)
QSC_INC=$(dirname $(dirname "$QSC_HDR"))
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$QT_PATH" \
-DQSCINTILLA_INCLUDE="$QSC_INC" \
-DQSCINTILLA_LIB="$QSC_LIB" \
-DBUILD_TESTING=ON
cmake --build . --parallel "$(sysctl -n hw.ncpu)" \
--target notepatra_all_tests
QT_QPA_PLATFORM=offscreen ctest --output-on-failure
- name: Create DMG
run: |
QT_PATH=/opt/homebrew/opt/qt@5
export PATH="$QT_PATH/bin:$PATH"
APP=build/Notepatra.app
FW="$APP/Contents/Frameworks"
mkdir -p "$FW"
# ─── Step 1: macdeployqt bundles Qt frameworks for the main binary.
# This also adds an LC_RPATH of @executable_path/../Frameworks to
# notepatra, which is what lets @rpath/QtCore.framework/... resolve.
echo "=== macdeployqt ==="
macdeployqt "$APP"
# ─── Step 1b: Bundle OpenSSL 3 dylibs — REQUIRED for QNetworkAccessManager HTTPS.
# Homebrew's qt@5 is built --openssl-linked against openssl@3, and
# macdeployqt does NOT copy OpenSSL. Without these dylibs, every
# https:// request from the app silently fails with "TLS
# initialization failed" on an end-user Mac — including the Help →
# Check for Updates flow and the safe updater's SHA256SUMS fetch.
OPENSSL_PREFIX=$(brew --prefix openssl@3 2>/dev/null || echo /opt/homebrew/opt/openssl@3)
echo "=== OpenSSL source: $OPENSSL_PREFIX ==="
for lib in libssl.3.dylib libcrypto.3.dylib; do
SRC="$OPENSSL_PREFIX/lib/$lib"
if [ ! -f "$SRC" ]; then
echo "::error::$SRC missing — HTTPS will fail at runtime on user Macs"
exit 1
fi
cp "$SRC" "$FW/$lib"
chmod u+w "$FW/$lib"
install_name_tool -id "@rpath/$lib" "$FW/$lib"
echo " ✓ bundled $lib"
done
# libssl links libcrypto via Homebrew absolute path — rewrite to @rpath.
install_name_tool -change "$OPENSSL_PREFIX/lib/libcrypto.3.dylib" \
"@rpath/libcrypto.3.dylib" "$FW/libssl.3.dylib" 2>/dev/null || true
# Qt5Network.framework binary also references libssl/libcrypto via
# Homebrew paths — rewrite those to @rpath so the bundle is portable.
QTNET_BIN="$APP/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork"
if [ -f "$QTNET_BIN" ]; then
chmod u+w "$QTNET_BIN"
install_name_tool -change "$OPENSSL_PREFIX/lib/libssl.3.dylib" \
"@rpath/libssl.3.dylib" "$QTNET_BIN" 2>/dev/null || true
install_name_tool -change "$OPENSSL_PREFIX/lib/libcrypto.3.dylib" \
"@rpath/libcrypto.3.dylib" "$QTNET_BIN" 2>/dev/null || true
echo " ✓ rewrote QtNetwork OpenSSL refs → @rpath"
fi
# ─── Step 2: Copy QScintilla dylib into the bundle. macdeployqt
# doesn't know about QScintilla, so we have to drop it in + rewrite
# its load commands ourselves.
QSC_SRC=$(find "$QT_PATH/lib" -name "libqscintilla2_qt5*.dylib" -type f 2>/dev/null | head -1)
if [ -z "$QSC_SRC" ]; then
QSC_SRC=$(find /opt/homebrew /usr/local -name "libqscintilla2_qt5*.dylib" -type f 2>/dev/null | head -1)
fi
if [ -z "$QSC_SRC" ]; then
echo "::error::QScintilla dylib not found — bundle would be unusable"
exit 1
fi
echo "QScintilla source: $QSC_SRC"
cp "$QSC_SRC" "$FW/libqscintilla2_qt5.15.dylib"
chmod u+w "$FW/libqscintilla2_qt5.15.dylib"
QSC_BUNDLED="$FW/libqscintilla2_qt5.15.dylib"
# ─── Step 3: Set libqscintilla2's own install_name to @rpath so
# the main notepatra binary can find it via the LC_RPATH entry
# macdeployqt added in step 1.
install_name_tool -id "@rpath/libqscintilla2_qt5.15.dylib" "$QSC_BUNDLED"
# ─── Step 4: Rewrite every /opt/homebrew or /usr/local reference
# inside libqscintilla2 to use @rpath/<framework|dylib>. This
# catches QScintilla's known quirk of baking literal '*' globs
# into its LC_LOAD_DYLIB entries (e.g.
# /opt/homebrew/*/QtPrintSupport.framework/Versions/5/QtPrintSupport)
# which would otherwise crash dyld at launch.
echo "=== Before rewrite ==="
otool -L "$QSC_BUNDLED"
otool -L "$QSC_BUNDLED" | tail -n +2 | awk '{print $1}' | while read -r DEP; do
case "$DEP" in
/opt/homebrew*|/usr/local*)
if echo "$DEP" | grep -q "\.framework/"; then
FW_NAME=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\1|')
FW_VER=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\2|')
NEW="@rpath/${FW_NAME}.framework/Versions/${FW_VER}/${FW_NAME}"
else
NEW="@rpath/$(basename "$DEP")"
fi
echo " rewrite: $DEP"
echo " -> $NEW"
install_name_tool -change "$DEP" "$NEW" "$QSC_BUNDLED"
;;
esac
done
echo "=== After rewrite ==="
otool -L "$QSC_BUNDLED"
# ─── Step 5: Ad-hoc re-sign libqscintilla2 so Gatekeeper accepts
# the modified Mach-O load commands. Without this the modified
# dylib has an invalid signature and dyld refuses to load it.
codesign --force --sign - "$QSC_BUNDLED"
# ─── Step 6: macdeployqt may not have bundled QtPrintSupport
# (the main notepatra binary doesn't directly link it — only
# libqscintilla2 does). Force-copy it if missing.
if [ ! -d "$FW/QtPrintSupport.framework" ]; then
echo "=== Copying QtPrintSupport.framework (macdeployqt skipped it) ==="
cp -R "$QT_PATH/lib/QtPrintSupport.framework" "$FW/"
# Rewrite the framework's own install_name and its Qt deps
QTPS_BIN="$FW/QtPrintSupport.framework/Versions/5/QtPrintSupport"
chmod u+w "$QTPS_BIN"
install_name_tool -id "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" "$QTPS_BIN"
otool -L "$QTPS_BIN" | tail -n +2 | awk '{print $1}' | while read -r DEP; do
case "$DEP" in
/opt/homebrew*|/usr/local*)
if echo "$DEP" | grep -q "\.framework/"; then
FW_NAME=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\1|')
FW_VER=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\2|')
NEW="@rpath/${FW_NAME}.framework/Versions/${FW_VER}/${FW_NAME}"
else
NEW="@rpath/$(basename "$DEP")"
fi
install_name_tool -change "$DEP" "$NEW" "$QTPS_BIN"
;;
esac
done
codesign --force --sign - "$QTPS_BIN"
fi
# ─── Step 7: Final verification — no binary inside the bundle
# should reference /opt/homebrew or /usr/local anymore.
echo "=== Final bundle link audit ==="
LEFTOVER=$(find "$APP" -type f \( -name "*.dylib" -o -name "*.framework" \) -o -perm +111 2>/dev/null | \
xargs -I{} sh -c 'otool -L "{}" 2>/dev/null | grep -E "/opt/homebrew|/usr/local" && echo " ^ in: {}"' | head -40)
if [ -n "$LEFTOVER" ]; then
echo "::warning::Some bundled binaries still reference Homebrew paths:"
echo "$LEFTOVER"
else
echo "✓ All bundled binaries use @rpath or system paths — no Homebrew absolutes"
fi
# ─── Step 8: Ad-hoc re-sign the whole bundle with hardened
# runtime + entitlements so macOS Tahoe (26.0) will actually
# let it launch. Without these flags, Tahoe silently rejects
# ad-hoc-signed bundles at fork/exec time with no user-visible
# error, just a failed launch. Order matters:
# 1. Sign inner frameworks and dylibs first (deepest wins).
# 2. Sign the main bundle with entitlements last.
ENTITLEMENTS="$GITHUB_WORKSPACE/resources/entitlements.plist"
if [ ! -f "$ENTITLEMENTS" ]; then
echo "::error::entitlements.plist missing — Tahoe launch will fail"
exit 1
fi
# Sign every dylib / framework binary inside the bundle with
# hardened runtime so library validation doesn't reject them.
find "$APP/Contents/Frameworks" -type f \( -name "*.dylib" -o -name "*.so" \) 2>/dev/null | \
while read -r lib; do
codesign --force --sign - --options runtime --timestamp=none "$lib" 2>/dev/null || true
done
find "$APP/Contents/Frameworks" -type d -name "*.framework" 2>/dev/null | \
while read -r fw; do
codesign --force --sign - --options runtime --timestamp=none "$fw" 2>/dev/null || true
done
# Plugin dylibs under Contents/PlugIns
find "$APP/Contents/PlugIns" -type f -name "*.dylib" 2>/dev/null | \
while read -r plug; do
codesign --force --sign - --options runtime --timestamp=none "$plug" 2>/dev/null || true
done
# Sign the main bundle LAST with entitlements + hardened
# runtime. This is what makes Tahoe's launch service happy.
codesign --force --deep --sign - \
--options runtime \
--entitlements "$ENTITLEMENTS" \
--timestamp=none \
"$APP"
# Verify the signature satisfies Gatekeeper's minimum bar.
# spctl --assess will still warn (unsigned/unnotarized), but
# `codesign -v` must pass or the app definitely won't launch.
codesign -v --verbose=4 "$APP" || {
echo "::error::codesign verification failed — Tahoe will reject this bundle"
exit 1
}
echo "✓ Bundle signed with hardened runtime + entitlements"
# ─── Step 9: Create the DMG
#
# hdiutil create intermittently fails with "Resource busy" on
# CI runners when a previous mount hasn't fully settled. Retry
# up to 3 times with an increasing pause — the workaround
# documented in multiple well-known Qt CI pipelines.
rm -f build/Notepatra.dmg
for attempt in 1 2 3; do
if hdiutil create -volname "Notepatra" -srcfolder "$APP" -ov \
-format UDZO -nospotlight build/Notepatra.dmg; then
echo "✓ DMG built on attempt $attempt"
break
fi
echo "hdiutil create failed (attempt $attempt) — detaching any stale volumes and retrying"
hdiutil detach "/Volumes/Notepatra" -force 2>/dev/null || true
sleep $((attempt * 3))
if [ "$attempt" = "3" ]; then
echo "::error::hdiutil create failed after 3 attempts"; exit 1
fi
done
- name: Create DMG (full flavor)
run: |
QT_PATH=/opt/homebrew/opt/qt@5
export PATH="$QT_PATH/bin:$PATH"
APP=build-full/Notepatra.app
FW="$APP/Contents/Frameworks"
mkdir -p "$FW"
# ─── Step 1: macdeployqt bundles Qt frameworks + QtWebEngine for Full build
echo "=== macdeployqt (full) =="
macdeployqt "$APP"
# ─── Step 1b: Bundle OpenSSL 3 dylibs (same as Lite)
OPENSSL_PREFIX=$(brew --prefix openssl@3 2>/dev/null || echo /opt/homebrew/opt/openssl@3)
echo "=== OpenSSL source: $OPENSSL_PREFIX =="
for lib in libssl.3.dylib libcrypto.3.dylib; do
SRC="$OPENSSL_PREFIX/lib/$lib"
if [ ! -f "$SRC" ]; then
echo "::error::$SRC missing — HTTPS will fail at runtime on user Macs"
exit 1
fi
cp "$SRC" "$FW/$lib"
chmod u+w "$FW/$lib"
install_name_tool -id "@rpath/$lib" "$FW/$lib"
echo " ✓ bundled $lib"
done
install_name_tool -change "$OPENSSL_PREFIX/lib/libcrypto.3.dylib" \
"@rpath/libcrypto.3.dylib" "$FW/libssl.3.dylib" 2>/dev/null || true
QTNET_BIN="$APP/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork"
if [ -f "$QTNET_BIN" ]; then
chmod u+w "$QTNET_BIN"
install_name_tool -change "$OPENSSL_PREFIX/lib/libssl.3.dylib" \
"@rpath/libssl.3.dylib" "$QTNET_BIN" 2>/dev/null || true
install_name_tool -change "$OPENSSL_PREFIX/lib/libcrypto.3.dylib" \
"@rpath/libcrypto.3.dylib" "$QTNET_BIN" 2>/dev/null || true
echo " ✓ rewrote QtNetwork OpenSSL refs → @rpath"
fi
# ─── Step 2: Copy QScintilla dylib (same as Lite)
QSC_SRC=$(find "$QT_PATH/lib" -name "libqscintilla2_qt5*.dylib" -type f 2>/dev/null | head -1)
if [ -z "$QSC_SRC" ]; then
QSC_SRC=$(find /opt/homebrew /usr/local -name "libqscintilla2_qt5*.dylib" -type f 2>/dev/null | head -1)
fi
if [ -z "$QSC_SRC" ]; then
echo "::error::QScintilla dylib not found — bundle would be unusable"
exit 1
fi
echo "QScintilla source: $QSC_SRC"
cp "$QSC_SRC" "$FW/libqscintilla2_qt5.15.dylib"
chmod u+w "$FW/libqscintilla2_qt5.15.dylib"
QSC_BUNDLED="$FW/libqscintilla2_qt5.15.dylib"
install_name_tool -id "@rpath/libqscintilla2_qt5.15.dylib" "$QSC_BUNDLED"
# ─── Step 3: Rewrite QScintilla deps (same rewrite logic as Lite)
echo "=== Before rewrite ==="
otool -L "$QSC_BUNDLED"
otool -L "$QSC_BUNDLED" | tail -n +2 | awk '{print $1}' | while read -r DEP; do
case "$DEP" in
/opt/homebrew*|/usr/local*)
if echo "$DEP" | grep -q "\.framework/"; then
FW_NAME=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\1|')
FW_VER=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\2|')
NEW="@rpath/${FW_NAME}.framework/Versions/${FW_VER}/${FW_NAME}"
else
NEW="@rpath/$(basename "$DEP")"
fi
echo " rewrite: $DEP"
echo " -> $NEW"
install_name_tool -change "$DEP" "$NEW" "$QSC_BUNDLED"
;;
esac
done
echo "=== After rewrite ==="
otool -L "$QSC_BUNDLED"
codesign --force --sign - "$QSC_BUNDLED"
# ─── Step 4: Handle QtPrintSupport.framework (same as Lite)
if [ ! -d "$FW/QtPrintSupport.framework" ]; then
echo "=== Copying QtPrintSupport.framework (macdeployqt skipped it) ==="
cp -R "$QT_PATH/lib/QtPrintSupport.framework" "$FW/"
QTPS_BIN="$FW/QtPrintSupport.framework/Versions/5/QtPrintSupport"
chmod u+w "$QTPS_BIN"
install_name_tool -id "@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport" "$QTPS_BIN"
otool -L "$QTPS_BIN" | tail -n +2 | awk '{print $1}' | while read -r DEP; do
case "$DEP" in
/opt/homebrew*|/usr/local*)
if echo "$DEP" | grep -q "\.framework/"; then
FW_NAME=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\1|')
FW_VER=$(echo "$DEP" | sed -E 's|.*/([^/]+)\.framework/Versions/([^/]+)/.*|\2|')
NEW="@rpath/${FW_NAME}.framework/Versions/${FW_VER}/${FW_NAME}"
else
NEW="@rpath/$(basename "$DEP")"
fi
install_name_tool -change "$DEP" "$NEW" "$QTPS_BIN"
;;
esac
done
codesign --force --sign - "$QTPS_BIN"
fi
# ─── Step 5: Copy + rewrite libduckdb.dylib (Full-specific)
echo "=== Bundling libduckdb.dylib ==="
cp vendor/duckdb/libduckdb.dylib "$APP/Contents/MacOS/libduckdb.dylib"
chmod u+w "$APP/Contents/MacOS/libduckdb.dylib"
install_name_tool -id "@rpath/libduckdb.dylib" "$APP/Contents/MacOS/libduckdb.dylib"
echo " ✓ bundled libduckdb.dylib with @rpath id"
# The MAIN binary references libduckdb by the upstream dylib's id, which
# may NOT be @rpath/libduckdb.dylib. Rewrite whatever it references to
# @rpath so it resolves to Contents/MacOS/libduckdb.dylib via the
# @executable_path rpath baked in at link time — else the shipped app
# would point at a CI build path and crash on a user's Mac.
MACBIN="$APP/Contents/MacOS/Notepatra"
DUCKREF=$(otool -L "$MACBIN" | awk '/libduckdb\.dylib/{print $1; exit}')
if [ -z "$DUCKREF" ]; then
echo "::error::main binary does not reference libduckdb.dylib at all"; exit 1
fi
if [ "$DUCKREF" != "@rpath/libduckdb.dylib" ]; then
chmod u+w "$MACBIN"
install_name_tool -change "$DUCKREF" "@rpath/libduckdb.dylib" "$MACBIN"
echo " ✓ rewrote main binary libduckdb ref: $DUCKREF -> @rpath/libduckdb.dylib"
else
echo " ✓ main binary already references @rpath/libduckdb.dylib"
fi
# Prove it resolves: the @rpath ref + @executable_path rpath + the copy
# in Contents/MacOS must all line up.
otool -L "$MACBIN" | grep -i duckdb
test -f "$APP/Contents/MacOS/libduckdb.dylib" || { echo "::error::libduckdb.dylib not next to binary"; exit 1; }
# ─── Step 6: Final verification
echo "=== Final bundle link audit ==="
LEFTOVER=$(find "$APP" -type f \( -name "*.dylib" -o -name "*.framework" \) -o -perm +111 2>/dev/null | \
xargs -I{} sh -c 'otool -L "{}" 2>/dev/null | grep -E "/opt/homebrew|/usr/local" && echo " ^ in: {}"' | head -40)
if [ -n "$LEFTOVER" ]; then
echo "::warning::Some bundled binaries still reference Homebrew paths:"
echo "$LEFTOVER"
else
echo "✓ All bundled binaries use @rpath or system paths — no Homebrew absolutes"
fi
# ─── Step 7: Codesigning (same approach + pattern as Lite, including WebEngine helper)
ENTITLEMENTS="$GITHUB_WORKSPACE/resources/entitlements.plist"
if [ ! -f "$ENTITLEMENTS" ]; then
echo "::error::entitlements.plist missing — Tahoe launch will fail"
exit 1
fi
# Sign every dylib / framework binary including QtWebEngineProcess helper
find "$APP/Contents/Frameworks" -type f \( -name "*.dylib" -o -name "*.so" \) 2>/dev/null | \
while read -r lib; do
codesign --force --sign - --options runtime --timestamp=none "$lib" 2>/dev/null || true
done
find "$APP/Contents/Frameworks" -type d -name "*.framework" 2>/dev/null | \
while read -r fw; do
codesign --force --sign - --options runtime --timestamp=none "$fw" 2>/dev/null || true
done
# QtWebEngineProcess helper (in Contents/Frameworks or Contents/PlugIns)
if [ -f "$APP/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess" ]; then
HELPER="$APP/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app"
echo "=== Signing QtWebEngineProcess helper ==="
codesign --force --sign - --options runtime --timestamp=none "$HELPER" 2>/dev/null || true
echo " ✓ signed $HELPER"
fi
# Plugin dylibs under Contents/PlugIns
find "$APP/Contents/PlugIns" -type f -name "*.dylib" 2>/dev/null | \
while read -r plug; do
codesign --force --sign - --options runtime --timestamp=none "$plug" 2>/dev/null || true
done
# libduckdb.dylib in Contents/MacOS
codesign --force --sign - --options runtime --timestamp=none "$APP/Contents/MacOS/libduckdb.dylib" 2>/dev/null || true
# Sign the main bundle LAST with entitlements + hardened runtime
codesign --force --deep --sign - \
--options runtime \
--entitlements "$ENTITLEMENTS" \
--timestamp=none \
"$APP"
# Verify the signature
codesign -v --verbose=4 "$APP" || {
echo "::error::codesign verification failed — Tahoe will reject this bundle"
exit 1
}
echo "✓ Full bundle signed with hardened runtime + entitlements"
# ─── Step 8: Create the DMG
rm -f build-full/Notepatra-full.dmg
for attempt in 1 2 3; do
if hdiutil create -volname "Notepatra" -srcfolder "$APP" -ov \
-format UDZO -nospotlight build-full/Notepatra-full.dmg; then
echo "✓ Full DMG built on attempt $attempt"
break
fi
echo "hdiutil create failed (attempt $attempt) — detaching any stale volumes and retrying"
hdiutil detach "/Volumes/Notepatra" -force 2>/dev/null || true
sleep $((attempt * 3))
if [ "$attempt" = "3" ]; then
echo "::error::hdiutil create failed after 3 attempts"; exit 1
fi
done
- name: Upload DMG
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-macos-arm64
path: build/Notepatra.dmg
- name: Upload DMG (full flavor)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-macos-arm64-full
path: build-full/Notepatra-full.dmg
# v0.1.118 — MCP sidecar. As of v0.1.119 ALL FOUR platform jobs run both
# the default (std-only) and the remote-feature suites natively; there is
# no longer a single "canonical" test job. macOS additionally lipo's an
# arm64+x86_64 universal binary, because .mcpb declares ONE `darwin` entry
# and Claude Desktop on Intel Macs would otherwise get an unrunnable
# slice. The universal binary is consumed ONLY by the .mcpb — the
# standalone notepatra-mcp-macos-arm64.tar.gz stays arm64-thin so the
# released filename keeps meaning what it says.
#
# Same ordering law as the linux jobs: `cargo test --features remote`
# rebuilds the bin WITH remote, so the plain `cargo build --release` must
# come last, and the flavor assertion proves it did.
- name: Build and test MCP server (arm64 + x86_64 universal)
timeout-minutes: 25
run: |
cd notepatra-mcp
cargo test --release
cargo test --release --features remote
rustup target add x86_64-apple-darwin
cargo build --release
cargo build --release --target x86_64-apple-darwin
# Time-capped flavor assertion — see the linux x64 job for why this
# cannot be a plain command substitution.
./target/release/notepatra-mcp serve </dev/null >flavor.txt 2>&1 & PID=$!
for _ in $(seq 1 20); do kill -0 $PID 2>/dev/null || break; sleep 0.5; done
kill -9 $PID 2>/dev/null || true
wait $PID 2>/dev/null || true
grep -q "built without remote support" flavor.txt || { echo "::error::shipped sidecar unexpectedly has remote support compiled in"; cat flavor.txt; exit 1; }
lipo -create -output target/notepatra-mcp-universal target/release/notepatra-mcp target/x86_64-apple-darwin/release/notepatra-mcp
lipo -archs target/notepatra-mcp-universal | grep -q x86_64 || { echo "::error::universal sidecar missing x86_64 slice"; exit 1; }
lipo -archs target/notepatra-mcp-universal | grep -q arm64 || { echo "::error::universal sidecar missing arm64 slice"; exit 1; }
# Prove the x86_64 slice actually RUNS, not just that it links —
# </dev/null so the stdio server sees EOF and exits instead of
# blocking the job forever. Rosetta is absent on some hosted images,
# so this is a warning, never a hard failure.
if arch -x86_64 /usr/bin/true 2>/dev/null; then arch -x86_64 ./target/x86_64-apple-darwin/release/notepatra-mcp </dev/null >/dev/null && echo "x86_64 slice executed under Rosetta"; else echo "::warning::Rosetta unavailable — x86_64 slice not smoke-executed"; fi
- name: Upload MCP server artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-mcp-macos-arm64
path: notepatra-mcp/target/release/notepatra-mcp
- name: Upload MCP server universal artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: notepatra-mcp-macos-universal
path: notepatra-mcp/target/notepatra-mcp-universal
build-windows:
# PINNED (v0.1.113) for determinism: both windows-latest AND windows-2025
# now carry VS2026 (VS 18, MSVC 14.5x) as of mid-2026 — there is no hosted
# VS2022 image left. VS2026's STL REMOVED stdext::make_checked_array_iterator,
# which Qt 5.15.2's qlist.h:915 calls via QT_MAKE_CHECKED_ARRAY_ITERATOR, so
# every QList-instantiating TU failed C2653/C3861 (this killed v0.1.113's
# first two release runs). The ACTUAL fix is a force-included stdext shim
# (src/msvc_stdext_shim.h, wired in CMakeLists); this pin just stops the
# runner image from moving under us again. Durable path later: KDE-patched
# Qt 5.15 or the Qt6 migration (see project_qt6_migration_assessment).
runs-on: windows-2025
# HANG CONTAINMENT (v0.1.120). Without a job ceiling a wedge anywhere —
# QScintilla nmake, CMake, NSIS/WiX, an exe probe blocked on a modal
# Windows error box, or the regression suite — runs to GitHub's
# 360-minute default and reports NOTHING. This is the outermost net;
# the per-step ceilings below name the culprit, and the in-test
# watchdogs name the individual test.
timeout-minutes: 180
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Qt5
uses: jurplel/install-qt-action@48d3ad6db93f3627c8ee7a0454bc6f3744f7e730 # v4.3.1
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
# v0.1.43: qtcharts needed for inline AI Data Analyst charts.
# v0.1.63: qtwebengine needed for the Vega-Lite chart renderer in