Files
qbz/.github/workflows/build-slint-selfhosted.yml
T
vicrodh c8ef2a1b1d refactor(slint): split qbz-slint into qbz-ui lib + qbz bin; reclaim qbz binary
Slint cannot split the .slint compilation across crates, but a Slint LIBRARY
crate exposes its generated Rust types to dependent crates (verified with a
minimal proof). So:

- NEW crate `qbz-ui` (lib): owns the whole .slint tree + build.rs + bundled
  translations; `slint::include_modules!()` + the generated types (AppWindow,
  MiniPlayerWindow, all globals/structs) are re-exported. Translation domain is
  now `qbz-ui` (the .po files renamed accordingly).
- `qbz-slint` (bin) -> renamed to `qbz` (package + `[[bin]] name = "qbz"`),
  reclaiming the binary name from the retired Tauri app. It depends on `qbz-ui`
  and does `pub use qbz_ui::*;` so existing `crate::AppWindow` / `crate::*State`
  references resolve unchanged.

This splits the single ~20 GB rustc into two crates (UI/codegen vs the 75k LOC
of logic) — the foundation for lower build peak, incremental caching, and the
upcoming per-feature crate extraction.

Also fixed for the move: qbz-i18n bundled-.po include paths, the font/WGSL
`include_bytes!`/`include_str!` paths (-> ../../qbz-ui/ui/), workspace members,
dev scripts (`-p qbz`), and the CI workflows. `cargo check -p qbz` is green.

cc
2026-06-25 17:51:09 -06:00

55 lines
2.0 KiB
YAML

name: Build Slint (self-hosted)
# Builds qbz-slint on the self-hosted runner registered on the dev box
# (`qbz-box`, labels: self-hosted,linux,x64,qbz-builder). The box CAN compile
# qbz-slint (proven locally), so this is the reliable path to a real CI/CD
# artifact while the GitHub-hosted private runner (2 vCPU / 8 GB) cannot.
#
# Self-hosted runners keep their work directory between runs, so `target/`
# persists → builds are INCREMENTAL after the first (no `actions/cache` needed).
#
# MANUAL trigger only (workflow_dispatch): the box shares RAM with the desktop
# and earlyoom will SIGTERM the build if RAM runs low. Trigger this when the box
# is free (close heavy apps / TTY), and do NOT run a local build at the same
# time (one heavy build at a time — the box hard-freezes on double-build OOM).
on:
workflow_dispatch:
concurrency:
group: selfhosted-slint
cancel-in-progress: true
jobs:
build:
runs-on: [self-hosted, qbz-builder]
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- name: Free RAM check (earlyoom will kill the build if too low)
run: |
free -h | head -2
avail=$(free -m | awk '/^Mem:/ {print $7}')
echo "MemAvailable: ${avail} MB"
if [ "${avail}" -lt 16000 ]; then
echo "::warning::Only ${avail} MB free — earlyoom may SIGTERM the qbz-slint rustc. Close apps / drop to TTY for headroom."
fi
- name: Build qbz-slint (box-proven settings — uncapped, threads=2)
run: NORUN=1 CAPPED=0 THREADS=2 ./scripts/slint-run.sh
- name: Strip + report size
run: |
BIN=crates/target/release/qbz
echo "unstripped:"; ls -lh "$BIN" | awk '{print $5}'
cp "$BIN" qbz-linux-x86_64
strip qbz-linux-x86_64 || true
echo "stripped:"; ls -lh qbz-linux-x86_64 | awk '{print $5}'
- uses: actions/upload-artifact@v4
with:
name: qbz-linux-x86_64
path: qbz-linux-x86_64
if-no-files-found: error