Repository navigation
908 lines (859 loc) · 42.4 KB
/
Copy pathbuild-linux.yml
File metadata and controls
908 lines (859 loc) · 42.4 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
name: Build Linux
# `contents: write` is required by softprops/action-gh-release@v1 to create
# the GH release and upload assets on tag push. Without it, the release job
# fails with HTTP 403 even though the matrix builds succeed.
permissions:
contents: write
# Builds 9 x86_64 and 2 experimental aarch64 variants in Docker.
# Each Dockerfile pins a glibc cap via its base image; the matrix mirrors that
# with a matching ubuntu host runner as belt-and-suspenders. See AGENTS.md
# "Building Release Binaries" for the policy this enforces.
#
# The release job signs every binary, companion .so, SHA256SUMS.txt, .deb,
# .rpm, and the GitHub auto-archive source tarball (issue #415) using the
# dedicated CI signing primary 9CCF7915... via the GPG_PRIVATE_KEY secret.
# All .asc files are uploaded alongside their artifacts on tag push so AUR /
# Deb / RPM consumers can verify without manual maintainer signing.
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-rc*'
branches:
- 'rc/*'
workflow_dispatch:
inputs:
version:
description: 'Version (without v prefix). Leave blank to read from Cargo.toml.'
required: false
default: ''
jobs:
build:
name: build-${{ matrix.variant }}
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.timeout_minutes }}
strategy:
fail-fast: false
matrix:
include:
# Runs on any x86-64-v2 CPU (Nehalem 2008+). Every other x86_64
# variant is built for Haswell or newer and SIGILLs without AVX2,
# which is what #612 reported from a 2012 Ivy Bridge MacBook Pro.
- variant: baseline
arch: x86_64
dockerfile: Dockerfile.baseline
runner: ubuntu-22.04
glibc_cap: '2.35'
check_no_avx512: true
companion_libs: ''
timeout_minutes: 60
- variant: avx2
arch: x86_64
dockerfile: Dockerfile.build
runner: ubuntu-22.04
glibc_cap: '2.35'
check_no_avx512: true
companion_libs: ''
timeout_minutes: 60
- variant: vulkan
arch: x86_64
dockerfile: Dockerfile.vulkan
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: true
companion_libs: ''
timeout_minutes: 60
- variant: avx512
arch: x86_64
dockerfile: Dockerfile.avx512
runner: ubuntu-22.04
glibc_cap: '2.35'
check_no_avx512: false
companion_libs: ''
timeout_minutes: 60
- variant: onnx-avx2
arch: x86_64
dockerfile: Dockerfile.onnx
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: false
companion_libs: ''
timeout_minutes: 90
- variant: onnx-avx512
arch: x86_64
dockerfile: Dockerfile.onnx-avx512
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: false
companion_libs: ''
timeout_minutes: 90
- variant: onnx-cuda-12
arch: x86_64
dockerfile: Dockerfile.onnx-cuda-12
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: false
companion_libs: 'libonnxruntime_providers_cuda.so libonnxruntime_providers_shared.so'
timeout_minutes: 120
- variant: onnx-cuda-13
arch: x86_64
dockerfile: Dockerfile.onnx-cuda-13
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: false
# cuda-13 dlopens ORT via ort/load-dynamic so the runtime ships
# alongside the binary (Microsoft's prebuilt is the only 1.24.4
# build with sm_120 Blackwell coverage, and it's distributed as
# .so only — see Dockerfile.onnx-cuda-13 header). The Dockerfile
# takes those three libraries from models.voxtype.io/build-inputs,
# pinned by sha256, not from github.com/microsoft/onnxruntime.
companion_libs: 'libonnxruntime.so.1.24.4 libonnxruntime_providers_cuda.so libonnxruntime_providers_shared.so'
timeout_minutes: 120
- variant: onnx-migraphx
arch: x86_64
dockerfile: Dockerfile.onnx-migraphx
runner: ubuntu-24.04
glibc_cap: '2.39'
check_no_avx512: false
# Compiles ONNX Runtime 1.24.2 with the MIGraphX provider. The
# source archive also comes from models.voxtype.io/build-inputs,
# pinned by sha256; ONNX Runtime's own CMake dependencies are
# still downloaded from their GitHub repositories.
companion_libs: 'libonnxruntime_providers_migraphx.so libonnxruntime_providers_shared.so'
timeout_minutes: 180
# Experimental aarch64 variants. CPU-only — no GPU EPs on arm64
# (Jetson CUDA toolchain is awkward, no mainstream consumer arm64
# Vulkan hardware yet). Marked experimental in release notes until
# external users validate on Pi/Ampere/Graviton/Snapdragon X.
- variant: cpu
arch: aarch64
dockerfile: Dockerfile.aarch64-cpu
runner: ubuntu-22.04-arm
glibc_cap: '2.35'
check_no_avx512: false
companion_libs: ''
timeout_minutes: 60
- variant: onnx
arch: aarch64
dockerfile: Dockerfile.aarch64-onnx
runner: ubuntu-24.04-arm
glibc_cap: '2.39'
check_no_avx512: false
companion_libs: ''
timeout_minutes: 120
steps:
- uses: actions/checkout@v4
# Canonical's DNS can go down while public resolvers still answer
# (2026-11-11), and then apt fails on the runner and in Docker builds.
# No-op whenever the Ubuntu mirrors resolve.
- name: Pin Ubuntu mirror addresses if DNS is down
run: bash scripts/ci/pin-ubuntu-mirrors.sh
# The CUDA, MIGraphX and ONNX images can exhaust the stock runner's disk.
# build-onnx-cuda-13 died on 2026-10-31 with 99 MB free while cargo was
# cloning a git dependency's submodules, which surfaced as the misleading
# "failed to load source for dependency `openvino-genai`". Drop the
# preinstalled toolchains the Docker build never touches.
- name: Free runner disk space
if: startsWith(matrix.variant, 'onnx-')
run: |
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/share/boost
sudo docker image prune --all --force
df -h /
- name: Determine version
id: version
run: |
set -euo pipefail
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
INPUT_VERSION="${{ github.event.inputs.version }}"
if [[ -n "${INPUT_VERSION}" ]]; then
VERSION="${INPUT_VERSION}"
else
VERSION="${CARGO_VERSION}"
fi
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF_NAME#v}"
# On tag pushes, fail fast if Cargo.toml's version doesn't match
# the tag. `voxtype --version` reads CARGO_PKG_VERSION at compile
# time, and the AUR `voxtype` source PKGBUILD's `cargo fetch
# --locked` requires Cargo.lock to list the same version. A tag
# cut without a matching bump produces binaries that report the
# previous version and a source package that won't build (the
# v0.4.6 incident). RC artifacts must compile the actual RC
# version too, not just receive an RC filename.
if [[ "${VERSION}" != "${CARGO_VERSION}" ]]; then
echo "::error::Cargo.toml version (${CARGO_VERSION}) does not match tag (${VERSION})."
echo "::error::Bump Cargo.toml + Cargo.lock to ${VERSION} before tagging."
exit 1
fi
else
# Branch push (e.g. rc/*) — read from Cargo.toml so artifacts get a sensible name.
VERSION="${CARGO_VERSION}"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Resolved VERSION=${VERSION} (Cargo.toml: ${CARGO_VERSION})"
- name: Install Rust for source-seam regressions
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Check release transport and desktop assets
run: |
python3 testing/test-release-transport.py
python3 testing/test-release-validation.py
python3 testing/test-platform-ci.py
python3 testing/test-meeting-portability.py
python3 testing/test-ci-baseline-model.py
python3 testing/test-build-input-pins.py
- name: Build ${{ matrix.variant }} binary in Docker
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
# DOCKER_ADD_HOSTS is empty unless the pin step found the Ubuntu
# mirrors unresolvable.
# shellcheck disable=SC2086
docker build --no-cache ${DOCKER_ADD_HOSTS:-} \
-f '${{ matrix.dockerfile }}' \
-t 'voxtype-${{ matrix.variant }}' \
--build-arg "VERSION=${VERSION}" \
.
mkdir -p "releases/${VERSION}"
docker run --rm \
-e "VERSION=${VERSION}" \
-v "${PWD}/releases/${VERSION}:/output" \
'voxtype-${{ matrix.variant }}'
- name: Take ownership of Docker outputs
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
# Docker writes /output as root via the volume mount. Chown to the
# runner user so subsequent workflow steps can read/move files.
sudo chown -R "$(id -u):$(id -g)" "releases/${VERSION}"
- name: Verify binary version
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
WORKER="${BIN}.gguf-worker"
test -f "${BIN}" || { echo "Missing binary: ${BIN}"; ls -la "releases/${VERSION}/"; exit 1; }
test -f "${WORKER}" || { echo "Missing GGUF worker: ${WORKER}"; ls -la "releases/${VERSION}/"; exit 1; }
# AVX-512 is cross-compiled; its Docker image emits hash-bound
# exact compile-version metadata rather than claiming execution.
python3 scripts/release-artifacts.py check "${BIN}" "${VERSION}"
- name: Verify glibc cap (max <= ${{ matrix.glibc_cap }})
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
WORKER="${BIN}.gguf-worker"
CAP='${{ matrix.glibc_cap }}'
for artifact in "${BIN}" "${WORKER}"; do
MAX=$(objdump -T "${artifact}" 2>/dev/null \
| grep -oP 'GLIBC_\d+\.\d+' \
| sed 's/GLIBC_//' \
| sort -t. -k1,1n -k2,2n -u \
| tail -1)
echo "$(basename "${artifact}"): GLIBC_${MAX} (cap GLIBC_${CAP})"
if [[ -z "${MAX}" ]]; then
echo "Could not determine max glibc version"; exit 1
fi
# Compare as version: fail if MAX > CAP.
higher=$(printf '%s\n%s\n' "${CAP}" "${MAX}" | sort -t. -k1,1n -k2,2n | tail -1)
if [[ "${higher}" != "${CAP}" ]]; then
echo "FAIL: ${artifact} requires GLIBC_${MAX} which exceeds cap GLIBC_${CAP}"
echo "This artifact was likely linked against a newer host glibc than the Docker base image."
exit 1
fi
done
- name: Verify GGUF client and worker companion
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
VARIANT='${{ matrix.variant }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${VARIANT}"
WORKER="${BIN}.gguf-worker"
# Every binary compiles the GGUF client. x86_64 vulkan and ONNX
# variants ship a Vulkan-capable worker; the Whisper CPU tiers and
# aarch64 ship CPU workers. ONNX binaries carry ORT's AVX-512, but
# their workers must still hold the Haswell floor.
args=()
if [[ '${{ matrix.arch }}' == x86_64 && ( "${VARIANT}" == vulkan || "${VARIANT}" == onnx-* ) ]]; then
args+=(--vulkan)
else
args+=(--cpu-only)
fi
case "${VARIANT}" in
avx2|vulkan|onnx-avx2|onnx-cuda-12|onnx-cuda-13|onnx-migraphx) args+=(--haswell-floor) ;;
esac
# AVX-512 variants are cross-compiled and may not run on the runner.
case "${VARIANT}" in
avx512|onnx-avx512) ;;
*) args+=(--run) ;;
esac
scripts/verify-gguf-companion.sh "${args[@]}" "${BIN}" "${WORKER}"
- name: Verify ISA floor (Haswell / x86_64-v3) on AVX2 and Vulkan variants
if: matrix.check_no_avx512
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
WORKER="${BIN}.gguf-worker"
# The "no AVX-512" variants must run on every x86_64-v3 CPU: Haswell,
# Kaby Lake, Zen 2, Zen 3, etc. That floor excludes AVX-512, GFNI,
# AVX-VNNI, and SSE4a (AMD-only). The previous gate only checked zmm
# registers — Zen 3 lacks AVX-512 but still has SSE4a's `insertq`,
# which is what crashed Kaby Lake daemons in issue #393. NOTE:
# SHA-NI, VAES (ymm), and VPCLMULQDQ (ymm) are NOT checked because
# the sha2/aes crates emit them behind cpufeatures-dispatched
# runtime CPUID guards; they show up in every working binary.
DUMP=$(objdump -d "${BIN}" "${WORKER}")
ZMM=$(echo "$DUMP" | grep -c zmm || true)
EVEX=$(echo "$DUMP" | grep -cE 'vpternlog|vpermt2|vpermi2|vpblendm|valign[dq]|vpcompress|vpexpand' || true)
BCAST=$(echo "$DUMP" | grep -c '{1to' || true)
GFNI=$(echo "$DUMP" | grep -cE '\b(vgf2p8|gf2p8)' || true)
SSE4A=$(echo "$DUMP" | grep -cE '\b(insertq|extrq)\b' || true)
AVXVNNI=$(echo "$DUMP" | grep -cE '\bvpdpbus(d|ds)|vpdpwss(d|ds)' || true)
printf ' zmm registers: %s\n' "$ZMM"
printf ' AVX-512 EVEX: %s\n' "$EVEX"
printf ' AVX-512 broadcast: %s\n' "$BCAST"
printf ' GFNI: %s\n' "$GFNI"
printf ' SSE4a (AMD-only): %s\n' "$SSE4A"
printf ' AVX-VNNI: %s\n' "$AVXVNNI"
fail=0
for n in "$ZMM" "$EVEX" "$BCAST" "$GFNI" "$SSE4A" "$AVXVNNI"; do
[[ "${n:-0}" -gt 0 ]] && fail=1
done
if [[ "$fail" -ne 0 ]]; then
echo "FAIL: ${{ matrix.variant }} binary contains out-of-floor instructions."
echo "It will SIGILL on x86_64-v3 CPUs (Kaby Lake, Zen 2/3, Haswell, etc.)."
echo "Most likely cause: RUSTFLAGS uses target-cpu=native or GGML_NATIVE=ON"
echo "on a build host whose CPU has features the floor doesn't allow."
exit 1
fi
- name: Verify ISA floor (x86-64-v2) on the baseline variant
if: matrix.variant == 'baseline'
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
WORKER="${BIN}.gguf-worker"
# The baseline promises x86-64-v2 (Nehalem 2008+). No static count
# can gate that promise: a correct build legitimately carries ~370
# BMI2 instructions (ring's CPUID-dispatched assembly) and ~1800
# FMA (rustfft's runtime-dispatched AVX kernels), while #740's ggml
# contamination added only ~60 BMI2 on top - inside the noise. The
# counts below are a drift alarm, not a gate; the decisive check is
# the QEMU inference step that follows.
DUMP=$(objdump -d "${BIN}" "${WORKER}")
BMI2=$(echo "$DUMP" | grep -cP '\t(shrx|sarx|shlx|mulx|pdep|pext|bzhi|rorx)[ \t]' || true)
FMA=$(echo "$DUMP" | grep -cP '\t(vfmadd|vfmsub|vfnmadd|vfnmsub)' || true)
YMM=$(echo "$DUMP" | grep -c ymm || true)
printf ' BMI2 (informational, ~370 expected from ring): %s\n' "$BMI2"
printf ' FMA (informational, ~1800 expected from rustfft): %s\n' "$FMA"
printf ' ymm (informational): %s\n' "$YMM"
- name: Run inference on a QEMU-modeled v2 CPU (baseline variant)
if: matrix.variant == 'baseline'
timeout-minutes: 15
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
# Static counts cannot separate an unconditional instruction from a
# runtime-dispatched one, and #740 proved that a baseline binary can
# load a model fine and only SIGILL at the first ggml matmul. TCG
# software emulation genuinely cannot decode instructions outside
# the modeled CPU, so running REAL INFERENCE under -cpu Nehalem
# (SSE4.2+POPCNT, no AVX: the v2 floor) is a true behavioral test
# of the exact artifact being shipped. Slow under TCG, but tiny.en
# on a two-second clip stays well inside the step timeout.
for attempt in 1 2 3 4; do
sudo apt-get update -qq -o Acquire::Retries=5 \
&& { sudo apt-get install -y -qq -o Acquire::Retries=5 qemu-user-static libasound2 || \
sudo apt-get install -y -qq -o Acquire::Retries=5 qemu-user-static libasound2t64; } \
&& break
[ "$attempt" = 4 ] && exit 1
echo "apt failed (attempt $attempt), mirror may be syncing; retrying in 90s"
sudo rm -rf /var/lib/apt/lists/*
sleep 90
done
chmod +x "${BIN}"
export XDG_DATA_HOME="${RUNNER_TEMP}/xdg-data"
export XDG_CONFIG_HOME="${RUNNER_TEMP}/xdg-config"
mkdir -p "${XDG_DATA_HOME}/voxtype/models" "${XDG_CONFIG_HOME}/voxtype"
bash scripts/ci/fetch-baseline-model.sh \
"${XDG_DATA_HOME}/voxtype/models/ggml-tiny.en.bin"
printf 'engine = "whisper"\n\n[whisper]\nmodel = "tiny.en"\n' \
> "${XDG_CONFIG_HOME}/voxtype/config.toml"
qemu-x86_64-static -cpu Nehalem "${BIN}" transcribe tests/fixtures/vad/speech_hello.wav
echo "✓ baseline binary completed inference on a v2-floor CPU model."
- name: Stage companion libraries
if: matrix.companion_libs != ''
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
PREFIX="releases/${VERSION}/voxtype-${VERSION}-linux-${{ matrix.arch }}-${{ matrix.variant }}"
missing=0
for lib in ${{ matrix.companion_libs }}; do
f="${PREFIX}.${lib}"
if [[ -f "${f}" ]]; then
echo "Found ${f}"
else
echo "MISSING ${f}"
missing=1
fi
done
if [[ "${missing}" -ne 0 ]]; then
echo "One or more companion libraries are missing from the Docker output."
ls -la "releases/${VERSION}/"
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-${{ matrix.variant }}
path: releases/${{ steps.version.outputs.version }}/voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-${{ matrix.variant }}*
if-no-files-found: error
retention-days: 14
# The OSD launcher + frontends + audio bridge are engine-agnostic and
# built alongside the ONNX binary in the same image (one cargo
# invocation produces voxtype-osd, voxtype-osd-gtk4,
# voxtype-osd-quickshell, and voxtype-audio-bridge). Two matrix jobs
# put them in /output: x86_64 onnx-avx2 and aarch64 onnx.
#
# The aarch64 job built them all along and they were dropped on the
# floor, because this upload was keyed to onnx-avx2 alone. Asahi users
# were told to build the OSD from source for a binary CI had already
# produced (#579).
- name: Verify OSD binaries start on a QEMU-modeled v2 CPU
if: matrix.variant == 'onnx-avx2'
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
# The OSD dispatcher, frontends, and audio bridge build at
# x86-64-v2 so pre-Haswell machines running the baseline daemon
# get an OSD too (#740 reported them SIGILLing at --version).
# They are pure Rust with no ggml, so a startup check under a
# v2-floor CPU model covers their whole risk surface.
for attempt in 1 2 3 4; do
sudo apt-get update -qq -o Acquire::Retries=5 \
&& { sudo apt-get install -y -qq -o Acquire::Retries=5 qemu-user-static libasound2t64 || \
sudo apt-get install -y -qq -o Acquire::Retries=5 qemu-user-static libasound2; } \
&& break
[ "$attempt" = 4 ] && exit 1
echo "apt failed (attempt $attempt), mirror may be syncing; retrying in 90s"
sudo rm -rf /var/lib/apt/lists/*
sleep 90
done
for suffix in osd osd-quickshell audio-bridge; do
BIN="releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-${suffix}"
chmod +x "${BIN}"
qemu-x86_64-static -cpu Nehalem "${BIN}" --version
done
echo "✓ OSD binaries start on a v2-floor CPU model."
- name: Upload OSD binaries + audio bridge (ONNX jobs only)
if: matrix.variant == 'onnx-avx2' || (matrix.arch == 'aarch64' && matrix.variant == 'onnx')
uses: actions/upload-artifact@v4
with:
name: voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-osd
path: |
releases/${{ steps.version.outputs.version }}/voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-osd*
releases/${{ steps.version.outputs.version }}/voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-meetings-gtk4*
releases/${{ steps.version.outputs.version }}/voxtype-${{ steps.version.outputs.version }}-linux-${{ matrix.arch }}-audio-bridge
if-no-files-found: error
retention-days: 14
release:
name: collect-and-release
needs: build
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
# Canonical's DNS can go down while public resolvers still answer
# (2026-11-11), and then apt fails on the runner and in Docker builds.
# No-op whenever the Ubuntu mirrors resolve.
- name: Pin Ubuntu mirror addresses if DNS is down
run: bash scripts/ci/pin-ubuntu-mirrors.sh
- name: Determine version
id: version
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
INPUT_VERSION="${{ github.event.inputs.version }}"
if [[ -n "${INPUT_VERSION}" ]]; then
VERSION="${INPUT_VERSION}"
else
VERSION=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
fi
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Resolved VERSION=${VERSION}"
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
# Pull each matrix-job artifact (named voxtype-${VERSION}-linux-${arch}-${variant})
# but skip the combined linux-all artifact this same job will write.
pattern: voxtype-*-linux-*-*
- name: Collect binaries
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
mkdir -p "releases/${VERSION}"
# Flatten artifact subdirs into releases/${VERSION}/.
find artifacts -type f -name 'voxtype-*' -exec mv -n {} "releases/${VERSION}/" \;
# download-artifact restores 0644. Restore only known binaries/workers,
# never archives, provider libraries, signatures or version proofs.
python3 scripts/release-artifacts.py restore "releases/${VERSION}" "${VERSION}"
echo "Collected files:"
ls -la "releases/${VERSION}/"
- name: Package matching desktop assets
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
python3 scripts/package-desktop-assets.py --output "releases/${VERSION}/voxtype-${VERSION}-desktop-assets.tar.gz"
- name: Generate SHA256SUMS.txt
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
cd "releases/${VERSION}"
# Sums cover every voxtype-* binary and any companion .so files.
shopt -s nullglob
files=( voxtype-* )
if [[ ${#files[@]} -eq 0 ]]; then
echo "No voxtype-* files to checksum; failing."
exit 1
fi
sha256sum "${files[@]}" > SHA256SUMS.txt
echo "SHA256SUMS.txt:"
cat SHA256SUMS.txt
# Sign every binary + companion .so + SHA256SUMS.txt with the dedicated
# CI signing primary 9CCF7915..., cross-signed by the offline maintainer
# key. Prior to v0.7.5 these `.asc` files were produced manually on Pete's
# laptop after each release; v0.7.4 was distributed without any per-binary
# `.asc` files in the initial cut for that reason. Moving signing to CI
# closes that gap so every release has hands-off per-artifact signatures
# without requiring a maintainer at the keyboard.
#
# Runs after SHA256SUMS.txt is written but before the .deb/.rpm packages
# are built, so the for-loop only walks binaries + companion .so files
# (the .deb/.rpm artifacts are signed in their own step below to keep
# the loop's glob simple). Both signing steps use the same GPG import
# plumbing — they share `WORK`/`GNUPGHOME` semantics by re-creating the
# ephemeral keyring per step, which is cheap and keeps the two signing
# surfaces independent.
- name: Sign binary artifacts
if: startsWith(github.ref, 'refs/tags/v')
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
set -euo pipefail
if [[ -z "${GPG_PRIVATE_KEY:-}" || -z "${GPG_PASSPHRASE:-}" ]]; then
echo "::warning::GPG secrets not set; skipping binary signing."
exit 0
fi
VERSION='${{ steps.version.outputs.version }}'
SIGNING_KEY="9CCF7915B750CAE8B095ED1AA3FC9F33FD209279"
WORK=$(mktemp -d)
trap 'rm -rf "${WORK}"' EXIT
export GNUPGHOME="${WORK}/gpg"
mkdir -p "${GNUPGHOME}"
chmod 700 "${GNUPGHOME}"
printf 'allow-loopback-pinentry\n' > "${GNUPGHOME}/gpg-agent.conf"
printf 'pinentry-mode loopback\n' > "${GNUPGHOME}/gpg.conf"
gpgconf --kill gpg-agent || true
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import
cd "releases/${VERSION}"
shopt -s nullglob
# Every binary + companion .so + the checksum manifest. `.asc` is
# excluded so a re-run doesn't sign sigs of sigs; .deb/.rpm don't
# exist yet at this point but are filtered defensively.
targets=()
for f in voxtype-* SHA256SUMS.txt; do
case "$f" in
*.asc|*.deb|*.rpm) continue ;;
esac
[[ -f "$f" ]] && targets+=("$f")
done
if [[ ${#targets[@]} -eq 0 ]]; then
echo "::warning::No artifacts to sign."
exit 0
fi
for f in "${targets[@]}"; do
printf '%s' "${GPG_PASSPHRASE}" | gpg --batch --yes \
--pinentry-mode loopback --passphrase-fd 0 \
--local-user "${SIGNING_KEY}!" \
--detach-sign --armor --output "${f}.asc" "${f}"
echo "Signed ${f}"
done
echo "Detached signatures produced:"
ls -1 *.asc
# Build distro packages (.deb for Debian/Ubuntu, .rpm for Fedora/RHEL).
# Prior to v0.7.5 these were manual: Pete ran `./scripts/package.sh
# --skip-build $VERSION` on his laptop after each CI cycle. The step
# gets skipped on hotfix cycles and downstream users ended up without
# a distro install path on tag (v0.7.4 was a recent example). Moving
# to CI eliminates the manual step and guarantees parity with the
# binary set in every release.
#
# fpm and rpmbuild both run cleanly on ubuntu-latest. The script
# honors --skip-build so it consumes the binaries already in
# releases/$VERSION/ from the collect step above; no rebuild.
# This job has no target/release, so the script renders the man pages
# itself with `cargo xtask man` (the runner image ships cargo). v1.1.1
# went out without man pages because the script only looked in
# target/release and merely warned when they were absent.
- name: Install fpm and rpmbuild
if: startsWith(github.ref, 'refs/tags/v')
run: |
for attempt in 1 2 3 4; do
sudo apt-get update -o Acquire::Retries=5 \
&& sudo apt-get install -y -o Acquire::Retries=5 rpm ruby ruby-dev build-essential \
&& break
[ "$attempt" = 4 ] && exit 1
echo "apt failed (attempt $attempt), mirror may be syncing; retrying in 90s"
sudo rm -rf /var/lib/apt/lists/*
sleep 90
done
sudo gem install --no-document fpm
- name: Build .deb and .rpm packages
if: startsWith(github.ref, 'refs/tags/v')
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
./scripts/package.sh --skip-build "${VERSION}"
echo "Distro packages built:"
ls -lh "releases/${VERSION}/"*.deb "releases/${VERSION}/"*.rpm
# Sign the .deb and .rpm with the dedicated CI signing primary,
# cross-signed by the offline maintainer key. Both keys are listed
# in voxtype-bin's `validpgpkeys`, so first-time AUR users get a
# clean auto-fetch of the new primary by fingerprint (unlike the
# subkey-by-keyid lookup that broke v0.7.4 yay upgrades).
- name: Sign .deb and .rpm artifacts
if: startsWith(github.ref, 'refs/tags/v')
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
set -euo pipefail
if [[ -z "${GPG_PRIVATE_KEY:-}" || -z "${GPG_PASSPHRASE:-}" ]]; then
echo "::warning::GPG secrets not set; skipping .deb/.rpm signing."
exit 0
fi
VERSION='${{ steps.version.outputs.version }}'
SIGNING_KEY="9CCF7915B750CAE8B095ED1AA3FC9F33FD209279"
WORK=$(mktemp -d)
trap 'rm -rf "${WORK}"' EXIT
export GNUPGHOME="${WORK}/gpg"
mkdir -p "${GNUPGHOME}"
chmod 700 "${GNUPGHOME}"
printf 'allow-loopback-pinentry\n' > "${GNUPGHOME}/gpg-agent.conf"
printf 'pinentry-mode loopback\n' > "${GNUPGHOME}/gpg.conf"
gpgconf --kill gpg-agent || true
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import
cd "releases/${VERSION}"
for f in voxtype_${VERSION}-1_amd64.deb voxtype-${VERSION}-1.x86_64.rpm; do
printf '%s' "${GPG_PASSPHRASE}" | gpg --batch --yes \
--pinentry-mode loopback --passphrase-fd 0 \
--local-user "${SIGNING_KEY}!" \
--detach-sign --armor --output "${f}.asc" "${f}"
echo "Signed ${f}"
done
- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
name: voxtype-${{ steps.version.outputs.version }}-linux-all
path: |
releases/${{ steps.version.outputs.version }}/voxtype-*
releases/${{ steps.version.outputs.version }}/voxtype_*
releases/${{ steps.version.outputs.version }}/SHA256SUMS.txt*
if-no-files-found: error
retention-days: 30
- name: Upload to GitHub release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ contains(github.ref_name, '-rc') }}
fail_on_unmatched_files: true
files: |
releases/${{ steps.version.outputs.version }}/voxtype-*
releases/${{ steps.version.outputs.version }}/voxtype_*
releases/${{ steps.version.outputs.version }}/SHA256SUMS.txt*
# Sign the GitHub-generated source archive (what `makepkg` for the AUR
# `voxtype` source PKGBUILD downloads) and upload the detached signature
# as a release asset. See issue #415 for the post-mortem: a previous
# release shipped a `.asc` signed against a locally-built tarball with
# different gzip metadata, so `gpg --verify` failed on the auto-archive
# the PKGBUILD actually pulls. Signing the auto-archive byte-for-byte
# closes that gap.
#
# Signing is done with a dedicated CI signing primary key:
# 9CCF7915B750CAE8B095ED1AA3FC9F33FD209279 ("Voxtype Release Signing"),
# cross-signed by the offline maintainer key
# (E79F5BAF8CD51A806AA27DBB7DA2709247D75BC6). The dedicated primary
# lives entirely in CI secrets; the offline maintainer primary
# never enters CI. Compromise of the CI key impersonates only
# "Voxtype Release Signing", not Pete's primary identity.
#
# The cross-signature on `NEW_PRIMARY` from `E79F5BAF...` gives
# security-conscious users a verifiable chain back to the offline
# primary they already trust. makepkg / yay don't enforce WoT depth
# so the cross-sig is informational for that flow — the practical
# benefit is that the new primary's fingerprint can be auto-fetched
# from keyservers (which can't be done reliably for subkey IDs),
# eliminating the v0.7.4 stale-keyring upgrade friction.
#
# Two repo secrets are required:
# GPG_PRIVATE_KEY — ASCII-armored export of the CI signing primary's
# secret material:
# gpg --export-secret-keys --armor \
# 9CCF7915B750CAE8B095ED1AA3FC9F33FD209279 \
# | gh secret set GPG_PRIVATE_KEY \
# -R peteonrails/voxtype
# GPG_PASSPHRASE — the random passphrase guarding the key on disk;
# piped to gpg over stdin with
# `--passphrase-fd 0 --pinentry-mode loopback`.
#
# If either secret is missing, the step fails with an actionable error
# so the first release attempt loudly surfaces the gap.
- name: Sign GitHub auto-archive (closes #415)
if: startsWith(github.ref, 'refs/tags/v')
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
TAG="v${VERSION}"
AUTO_TARBALL_URL="https://github.com/${GITHUB_REPOSITORY}/archive/refs/tags/${TAG}.tar.gz"
SIGNING_KEY="9CCF7915B750CAE8B095ED1AA3FC9F33FD209279"
if [[ -z "${GPG_PRIVATE_KEY:-}" ]]; then
echo "::error::GPG_PRIVATE_KEY secret is not set."
echo "::error::The AUR 'voxtype' source PKGBUILD requires a signed auto-archive."
echo "::error::Export and upload the CI signing primary:"
echo "::error:: gpg --export-secret-keys --armor ${SIGNING_KEY} \\"
echo "::error:: | gh secret set GPG_PRIVATE_KEY -R peteonrails/voxtype"
exit 1
fi
if [[ -z "${GPG_PASSPHRASE:-}" ]]; then
echo "::error::GPG_PASSPHRASE secret is not set."
echo "::error::The CI signing primary is passphrase-protected; CI needs the passphrase."
echo "::error::Set it via: gh secret set GPG_PASSPHRASE -R peteonrails/voxtype"
exit 1
fi
WORK=$(mktemp -d)
trap 'rm -rf "${WORK}"' EXIT
# Import the CI signing key into a throwaway GPG home so we don't
# pollute the runner's default keyring across steps. allow-loopback-
# pinentry lets us pass the passphrase over stdin (--passphrase-fd 0)
# without an interactive prompt, which doesn't exist in CI.
export GNUPGHOME="${WORK}/gpg"
mkdir -p "${GNUPGHOME}"
chmod 700 "${GNUPGHOME}"
printf 'allow-loopback-pinentry\n' > "${GNUPGHOME}/gpg-agent.conf"
printf 'pinentry-mode loopback\n' > "${GNUPGHOME}/gpg.conf"
gpgconf --kill gpg-agent || true
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import
# Wait briefly for GitHub to materialize the auto-archive. The
# archive is generated on first request, but a release uploaded
# seconds earlier may race with the tarball endpoint. Retry with
# backoff to keep the workflow robust.
TARBALL="${WORK}/voxtype-${VERSION}.tar.gz"
for attempt in 1 2 3 4 5; do
if curl -fsSL "${AUTO_TARBALL_URL}" -o "${TARBALL}"; then
break
fi
echo "Auto-archive not ready yet (attempt ${attempt}/5); sleeping..."
sleep $((attempt * 5))
done
test -s "${TARBALL}" || { echo "::error::Failed to download ${AUTO_TARBALL_URL}"; exit 1; }
# Detach-sign in ASCII-armored form. Lock signing to the CI signing
# primary explicitly with the `!` suffix on --local-user so gpg can't
# fall back to any other signing-capable key that might be present.
# Passphrase comes in over stdin via --passphrase-fd 0 with
# --pinentry-mode loopback, matching the gpg.conf above.
# Output filename matches the AUR PKGBUILD's expected asset name
# (voxtype-$pkgver.tar.gz.asc).
ASC="${WORK}/voxtype-${VERSION}.tar.gz.asc"
printf '%s' "${GPG_PASSPHRASE}" | gpg --batch --yes \
--pinentry-mode loopback \
--passphrase-fd 0 \
--local-user "${SIGNING_KEY}!" \
--detach-sign --armor \
--output "${ASC}" \
"${TARBALL}"
# Upload (--clobber to overwrite any stale asset from a prior
# workflow re-run on the same tag).
gh release upload "${TAG}" "${ASC}" --clobber --repo "${GITHUB_REPOSITORY}"
echo "Uploaded signature for auto-archive: voxtype-${VERSION}.tar.gz.asc"
# Self-check: re-download both the auto-archive and the just-uploaded
# .asc, then verify. This guards against future regressions of the
# same class as #415 (signing the wrong bytes) and against accidental
# asset overwrites that break the signature link.
- name: Verify auto-archive signature
if: startsWith(github.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
VERSION='${{ steps.version.outputs.version }}'
TAG="v${VERSION}"
WORK=$(mktemp -d)
trap 'rm -rf "${WORK}"' EXIT
# Pull the same auto-archive URL the AUR PKGBUILD uses.
curl -fsSL \
"https://github.com/${GITHUB_REPOSITORY}/archive/refs/tags/${TAG}.tar.gz" \
-o "${WORK}/voxtype-${VERSION}.tar.gz"
# Pull the signature asset we just uploaded.
gh release download "${TAG}" \
--repo "${GITHUB_REPOSITORY}" \
--pattern "voxtype-${VERSION}.tar.gz.asc" \
--dir "${WORK}"
# Import the maintainer public key from the keyserver to verify
# without trusting the .asc's own claims. Falls back to whatever
# signed it if keyserver lookup fails (still proves the sig matches
# the bytes).
export GNUPGHOME="${WORK}/gpg"
mkdir -p "${GNUPGHOME}"
chmod 700 "${GNUPGHOME}"
# Fetch the CI signing primary by fingerprint so the verify step
# below can prove the .asc actually came from voxtype CI. Also
# fetch the offline maintainer primary that cross-signs the CI
# key; this gives the audit chain (CI key ← maintainer key) for
# anyone watching the run.
gpg --batch --keyserver hkps://keys.openpgp.org \
--recv-keys 9CCF7915B750CAE8B095ED1AA3FC9F33FD209279 \
E79F5BAF8CD51A806AA27DBB7DA2709247D75BC6 \
|| echo "Keyserver lookup failed; verification will rely on the .asc's own key id"
gpg --batch --verify \
"${WORK}/voxtype-${VERSION}.tar.gz.asc" \
"${WORK}/voxtype-${VERSION}.tar.gz"
echo "Auto-archive signature verifies cleanly against the GitHub-generated tarball."
# Aggregator job — branch protection only needs to require `linux-ci-success`.
# Adding/removing matrix variants above just updates the matrix list and this
# job follows automatically; the protection rule never needs to be touched.
linux-ci-success:
name: linux-ci-success
needs: [build, release]
if: always()
runs-on: ubuntu-latest
steps:
- name: Verify all required jobs succeeded
run: |
set -e
build='${{ needs.build.result }}'
release='${{ needs.release.result }}'
echo "build: $build"
echo "release: $release"
if [[ "$build" != success || "$release" != success ]]; then
echo "::error::One or more required Linux jobs failed"
exit 1
fi
echo "All required Linux jobs succeeded."