ci: flatpak bundle repacks the bare binary on the KDE runtime

org.kde.Platform 6.9 provides Qt above the 6.8 floor; the manifest no
longer runs cargo, needs no rust/llvm SDK extensions and no swap. The
workflow takes the binary from build-qt-linux.yml, builds qbzd
alongside, and boots the installed bundle offscreen inside the sandbox
before publishing. Same shape as the Flathub manifest.

cc
This commit is contained in:
vicrodh committed 2026-08-26 19:11:01 -06:00
1 parent 89030b5b2a
commit c6bfb90ede
2 files changed
+87 -72

No files matched your search

+63 -30
View File
@@ -1,14 +1,10 @@
# Flatpak bundle for GitHub Releases — Slint binary (crates/ workspace). # Flatpak bundle for GitHub Releases — Qt frontend.
# #
# Rewritten 2026-07-02 for the Tauri -> Slint migration (v2.0). Builds # Rewritten 2026-08-25 for the Slint -> Qt frontend switch: the bundle is a
# packaging/flatpak/com.blitzfc.qbz.yml (network manifest) with # REPACK of the bare binary from the shared build-qt-linux.yml on the KDE
# flatpak-builder and attaches the .flatpak bundle to the Release. # runtime (org.kde.Platform 6.9 provides Qt). No cargo inside flatpak-builder,
# Flathub proper is a separate repo/manifest updated at tag time via # no swap ceremony. Same shape as the Flathub manifest, which consumes the
# scripts/update-flathub.sh (offline sources). # published release tarball instead.
#
# The cargo build runs on the HOST's resources even though it happens
# inside the flatpak sandbox, so this runner needs the same swap headroom
# as release-linux.yml (qbz_ui rustc peak ~30 GB).
name: release-flatpak name: release-flatpak
@@ -16,7 +12,7 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tag: tag:
description: "Optional release tag to build (e.g. v2.0.0). Empty = build HEAD, no Release publish." description: "Optional release tag to build (e.g. v2.1.0). Empty = build HEAD, no Release publish."
required: false required: false
type: string type: string
push: push:
@@ -28,9 +24,27 @@ concurrency:
cancel-in-progress: false cancel-in-progress: false
jobs: jobs:
build:
uses: ./.github/workflows/build-qt-linux.yml
with:
arch: x86_64
# qbzd rides in the bundle too (same as deb/rpm). Slint-free, minutes-class.
build-qbzd:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-jackd2-dev libdbus-1-dev libssl-dev
- run: cargo build --release --manifest-path crates/Cargo.toml -p qbzd
- uses: actions/upload-artifact@v7
with: { name: qbzd-linux-x86_64-flatpak, path: crates/target/release/qbzd }
build-flatpak: build-flatpak:
needs: [build, build-qbzd]
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
timeout-minutes: 300 timeout-minutes: 60
permissions: permissions:
contents: write contents: write
steps: steps:
@@ -86,20 +100,27 @@ jobs:
p.write_text(text, encoding="utf-8") p.write_text(text, encoding="utf-8")
PY PY
- name: Free disk space and add swap - name: Download bare binary
uses: actions/download-artifact@v8
with:
name: qbz-linux-x86_64
path: packaging/flatpak/payload
- name: Download qbzd
uses: actions/download-artifact@v8
with:
name: qbzd-linux-x86_64-flatpak
path: packaging/flatpak/payload
- name: Stage payload
run: | run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \ set -euo pipefail
/opt/hostedtoolcache /usr/local/share/boost /usr/share/swift \ P=packaging/flatpak/payload
/usr/local/lib/node_modules || true chmod +x "$P/qbz" "$P/qbzd"
sudo docker system prune -af || true cp packaging/flatpak/com.blitzfc.qbz.desktop "$P/qbz.desktop"
if sudo fallocate -l 18G /swap_extra; then cp packaging/flatpak/com.blitzfc.qbz.metainfo.xml "$P/"
sudo chmod 600 /swap_extra cp LICENSE "$P/LICENSE"
sudo mkswap /swap_extra mkdir -p "$P/icons"; cp packaging/icons/{32x32,128x128,256x256}.png "$P/icons/"
sudo swapon /swap_extra ls -la "$P"
else
echo "::warning::could not allocate extra swap; build may OOM"
fi
free -h
- name: Install flatpak tooling - name: Install flatpak tooling
run: | run: |
@@ -110,11 +131,8 @@ jobs:
- name: Install runtimes - name: Install runtimes
run: | run: |
flatpak install --user -y --noninteractive flathub \ flatpak install --user -y --noninteractive flathub \
org.gnome.Platform//49 \ org.kde.Platform//6.9 \
org.gnome.Sdk//49 org.kde.Sdk//6.9
flatpak install --user -y --noninteractive flathub \
org.freedesktop.Sdk.Extension.rust-stable//25.08 \
org.freedesktop.Sdk.Extension.llvm20//25.08
- name: Build Flatpak - name: Build Flatpak
id: build_flatpak id: build_flatpak
@@ -132,6 +150,21 @@ jobs:
echo "bundle_name=${BUNDLE_NAME}" >> "$GITHUB_OUTPUT" echo "bundle_name=${BUNDLE_NAME}" >> "$GITHUB_OUTPUT"
ls -la dist ls -la dist
# The bundle must boot on the KDE runtime's Qt: same offscreen gate as
# the Linux AppDir, run inside the sandbox.
- name: Offscreen smoke (inside the sandbox)
run: |
set -uo pipefail
flatpak install --user -y --noninteractive --bundle "dist/${{ steps.build_flatpak.outputs.bundle_name }}" || \
flatpak install --user -y --noninteractive "dist/${{ steps.build_flatpak.outputs.bundle_name }}"
timeout 60 flatpak run --env=QT_QPA_PLATFORM=offscreen --env=RUST_LOG=info com.blitzfc.qbz > smoke.log 2>&1 || true
lines=$(wc -l < smoke.log); echo "smoke log: $lines lines"
if (( lines < 10 )); then cat smoke.log; echo "::error::the app did not start"; exit 1; fi
errs=$(grep -av 'propertyCache' smoke.log | grep -aciE 'is not a type|unavailable|ReferenceError|TypeError|Cannot read|Unable to assign|Cannot open|no such method|non-existent property|failed to load component|is not installed' || true)
if (( errs > 0 )); then grep -av 'propertyCache' smoke.log | grep -aiE 'is not a type|unavailable|ReferenceError|TypeError|Cannot read|Unable to assign|Cannot open|no such method|non-existent property|failed to load component|is not installed' | head -20; echo "::error::$errs QML complaint(s)"; exit 1; fi
grep -aq 'QbzCore initialized' smoke.log || { tail -20 smoke.log; echo "::error::never reached QbzCore init"; exit 1; }
echo "smoke OK"
- name: Upload Flatpak bundle - name: Upload Flatpak bundle
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
+24 -42
View File
@@ -1,23 +1,21 @@
# Flatpak manifest — GitHub Releases bundle (network build). # Flatpak manifest — GitHub Releases bundle.
# #
# Rewritten 2026-07-02 for the Tauri -> Slint migration (v2.0): builds the # Rewritten 2026-08-25 for the Slint -> Qt frontend switch. This is a REPACK
# crates/ workspace with the rust-stable SDK extension. The node SDK, the # of the bare binary built by build-qt-linux.yml (release-flatpak.yml drops it
# whole intltool/libdbusmenu/libayatana-appindicator module chain and the # at packaging/flatpak/payload/ before flatpak-builder runs): no cargo, no
# lib64 workaround are gone — the Slint tray is ksni (pure Rust over D-Bus), # rust SDK extension, no memory-tier env. Qt comes from the KDE runtime
# no C appindicator involved. # (org.kde.Platform 6.9 >= the 6.8 floor; a binary built against 6.8 loads on
# 6.9 — Qt keeps forward ABI compatibility within a major).
# #
# The FLATHUB manifest (flathub/com.blitzfc.qbz repo) is the OFFLINE twin of # The FLATHUB manifest (flathub/com.blitzfc.qbz repo) is the sibling of this
# this file (cargo-sources.json, no network); keep the two in sync when # file consuming the published release tarball with x-checker-data; keep
# changing modules or finish-args. scripts/update-flathub.sh regenerates it. # runtime and finish-args in sync. Hashes there are computed from the
# published asset at its final URL, never from a local file.
app-id: com.blitzfc.qbz app-id: com.blitzfc.qbz
runtime: org.gnome.Platform runtime: org.kde.Platform
runtime-version: '49' runtime-version: '6.9'
sdk: org.gnome.Sdk sdk: org.kde.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
# bindgen (aws-lc-sys et al.) needs libclang.
- org.freedesktop.Sdk.Extension.llvm20
command: qbz command: qbz
finish-args: finish-args:
- --share=ipc - --share=ipc
@@ -64,32 +62,16 @@ finish-args:
modules: modules:
- name: qbz - name: qbz
buildsystem: simple buildsystem: simple
build-options:
append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm20/bin
build-args:
- --share=network
env:
LIBCLANG_PATH: /usr/lib/sdk/llvm20/lib
# Memory tier for 16 GB builders: the qbz_ui rustc is the ~30 GB
# peak; single job + high codegen-units + opt 2 is the measured
# MIN-footprint combination. Binary symbols are stripped by the
# workspace [profile.release].
CARGO_INCREMENTAL: '0'
CARGO_BUILD_JOBS: '1'
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '256'
CARGO_PROFILE_RELEASE_OPT_LEVEL: '2'
build-commands: build-commands:
- cargo build --release --manifest-path crates/Cargo.toml -p qbz - install -Dm755 payload/qbz /app/bin/qbz
- install -Dm755 crates/target/release/qbz /app/bin/qbz - install -Dm755 payload/qbzd /app/bin/qbzd
- install -Dm644 packaging/flatpak/com.blitzfc.qbz.desktop /app/share/applications/com.blitzfc.qbz.desktop - install -Dm644 payload/qbz.desktop /app/share/applications/com.blitzfc.qbz.desktop
- install -Dm644 packaging/flatpak/com.blitzfc.qbz.metainfo.xml /app/share/metainfo/com.blitzfc.qbz.metainfo.xml - install -Dm644 payload/com.blitzfc.qbz.metainfo.xml /app/share/metainfo/com.blitzfc.qbz.metainfo.xml
- install -Dm644 LICENSE /app/share/licenses/com.blitzfc.qbz/LICENSE - install -Dm644 payload/LICENSE /app/share/licenses/com.blitzfc.qbz/LICENSE
- install -Dm644 packaging/icons/32x32.png /app/share/icons/hicolor/32x32/apps/com.blitzfc.qbz.png - install -Dm644 payload/icons/32x32.png /app/share/icons/hicolor/32x32/apps/com.blitzfc.qbz.png
- install -Dm644 packaging/icons/128x128.png /app/share/icons/hicolor/128x128/apps/com.blitzfc.qbz.png - install -Dm644 payload/icons/128x128.png /app/share/icons/hicolor/128x128/apps/com.blitzfc.qbz.png
- install -Dm644 packaging/icons/256x256.png /app/share/icons/hicolor/256x256/apps/com.blitzfc.qbz.png - install -Dm644 payload/icons/256x256.png /app/share/icons/hicolor/256x256/apps/com.blitzfc.qbz.png
sources: sources:
- type: dir - type: dir
path: ../.. path: payload
skip: dest: payload
- .git
- crates/target