ci: rewrite release workflows for the Slint binary

release-linux, release-linux-aarch64, release-macos and release-flatpak
now build the crates/ workspace (Tauri npm builds removed) with the
proven build-slint recipe: 18 GB extra swap, mold, pinned nightly, MIN
memory tier. Build-once-package-many: nfpm deb/rpm, minimal-AppDir
AppImage, and the AUR/Gentoo/APT tarball with its name and layout
contract preserved. macOS assembles a QBZ.app skeleton, ad-hoc signs
it, and packs a dmg with hdiutil.

Cross-cutting: prerelease detection extended to -rc/-beta/-alpha/-pre,
tag-on-main ancestry guard (manual dispatch skips it), fail-fast
version assert against crates/Cargo.toml, unstripped binary archived
per tag. Tauri-updater bridge: AppImages and macOS .app.tar.gz are
signed with the existing Tauri minisign key so 1.2.x installs
auto-update into v2 via the unchanged release-updater-manifest.yml.

cc
This commit is contained in:
vicrodh committed 2026-07-02 10:11:16 -06:00
1 parent 9de3c19468
commit 1b933299e1
4 files changed
+613 -291

No files matched your search

+64 -46
View File
@@ -1,24 +1,43 @@
# Flatpak bundle for GitHub Releases — Slint binary (crates/ workspace).
#
# Rewritten 2026-07-02 for the Tauri -> Slint migration (v2.0). Builds
# packaging/flatpak/com.blitzfc.qbz.yml (network manifest) with
# flatpak-builder and attaches the .flatpak bundle to the Release.
# Flathub proper is a separate repo/manifest updated at tag time via
# scripts/update-flathub.sh (offline sources).
#
# 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
on:
workflow_dispatch:
inputs:
tag:
description: "Optional release tag to build (e.g. v0.1.0)"
description: "Optional release tag to build (e.g. v2.0.0). Empty = build HEAD, no Release publish."
required: false
type: string
push:
tags:
- "v*"
concurrency:
group: release-flatpak-${{ github.ref }}
cancel-in-progress: false
jobs:
build-flatpak:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 300
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve release version
id: release
@@ -30,56 +49,58 @@ jobs:
VERSION="${{ inputs.tag }}"
VERSION="${VERSION#v}"
fi
PRERELEASE=false
if [[ "$VERSION" =~ -(rc|beta|alpha|pre) ]]; then
PRERELEASE=true
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"
- name: Sync version to build metadata
- name: Verify tag is on main
if: startsWith(github.ref, 'refs/tags/')
run: |
git fetch origin main
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "::error::Tag ${GITHUB_REF#refs/tags/} is not on main. Releases are cut from main only."
exit 1
fi
# Keep the metainfo's top <release> entry honest (version + date).
- name: Sync metainfo release entry
if: steps.release.outputs.version != ''
env:
QBZ_VERSION: ${{ steps.release.outputs.version }}
run: |
python - <<'PY'
import json
import os
import pathlib
import re
version = os.environ["QBZ_VERSION"]
def update_json(path, updater):
p = pathlib.Path(path)
data = json.loads(p.read_text(encoding="utf-8"))
updater(data)
p.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
update_json("package.json", lambda d: d.__setitem__("version", version))
def update_lock(d):
d["version"] = version
packages = d.get("packages")
if isinstance(packages, dict) and "" in packages:
packages[""]["version"] = version
update_json("package-lock.json", update_lock)
update_json("src-tauri/tauri.conf.json", lambda d: d.__setitem__("version", version))
cargo_path = pathlib.Path("src-tauri/Cargo.toml")
cargo_text = cargo_path.read_text(encoding="utf-8")
cargo_text = re.sub(r'(?m)^version = \"[^\"]+\"', f'version = \"{version}\"', cargo_text, count=1)
cargo_path.write_text(cargo_text, encoding="utf-8")
# Update Flatpak metainfo.xml with version and date
python3 - <<'PY'
import os, pathlib, re
from datetime import date
metainfo_path = pathlib.Path("packaging/flatpak/com.blitzfc.qbz.metainfo.xml")
metainfo_text = metainfo_path.read_text(encoding="utf-8")
today = date.today().isoformat()
metainfo_text = re.sub(
version = os.environ["QBZ_VERSION"]
p = pathlib.Path("packaging/flatpak/com.blitzfc.qbz.metainfo.xml")
text = p.read_text(encoding="utf-8")
text = re.sub(
r'<release version="[^"]*" date="[^"]*">',
f'<release version="{version}" date="{today}">',
metainfo_text
f'<release version="{version}" date="{date.today().isoformat()}">',
text,
count=1,
)
metainfo_path.write_text(metainfo_text, encoding="utf-8")
p.write_text(text, encoding="utf-8")
PY
- name: Free disk space and add swap
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/opt/hostedtoolcache /usr/local/share/boost /usr/share/swift \
/usr/local/lib/node_modules || true
sudo docker system prune -af || true
if sudo fallocate -l 18G /swap_extra; then
sudo chmod 600 /swap_extra
sudo mkswap /swap_extra
sudo swapon /swap_extra
else
echo "::warning::could not allocate extra swap; build may OOM"
fi
free -h
- name: Install flatpak tooling
run: |
sudo apt-get update
@@ -88,13 +109,10 @@ jobs:
- name: Install runtimes
run: |
# Install GNOME runtime and SDK first
flatpak install --user -y --noninteractive flathub \
org.gnome.Platform//49 \
org.gnome.Sdk//49
# Install SDK extensions - flatpak-builder will auto-resolve the correct version based on the SDK
flatpak install --user -y --noninteractive flathub \
org.freedesktop.Sdk.Extension.node24//25.08 \
org.freedesktop.Sdk.Extension.rust-stable//25.08 \
org.freedesktop.Sdk.Extension.llvm20//25.08
@@ -125,5 +143,5 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: dist/${{ steps.build_flatpak.outputs.bundle_name }}
prerelease: ${{ contains(steps.release.outputs.version, '-rc') }}
make_latest: ${{ contains(steps.release.outputs.version, '-rc') && 'false' || 'true' }}
prerelease: ${{ steps.release.outputs.prerelease }}
make_latest: ${{ steps.release.outputs.prerelease == 'true' && 'false' || 'true' }}