Files
qbz/.github/workflows/release-flatpak.yml
T
vicrodh a912ced3d0 build: bump Node 20 to Node 24 across CI workflows and Flatpak manifest
Cherry-picked from PR #377 (thanks @Mar0xy) — Node-only portion, no
Discord IPC additions:

- 4 workflows (release-{linux,linux-aarch64,macos,flatpak}.yml) now
  install Node 24
- packaging/flatpak/com.blitzfc.qbz.yml: SDK extension node20 → node24,
  build append-path and npm_config_nodedir aligned

Forcing function: @icons-pack/svelte-simple-icons@7.x already in use
declares engines.node >=24, so Node 20 produces an EBADENGINE warning
in CI. Node 20 also reached EOL on 2026-04-30. Node 24 has been LTS
since October 2025 (~7 months of maturity).

Discord IPC permissions and qbz-wrapper script from #377 were
intentionally NOT cherry-picked — there's no Discord RPC feature in
QBZ today (#336 is still planned but not implemented), so adding the
sandbox permission and the launch wrapper now would expand the
attack surface for nothing. They'll land together with the actual
feature when it ships.

cc
2026-05-05 12:10:07 -06:00

130 lines
4.6 KiB
YAML

name: release-flatpak
on:
workflow_dispatch:
inputs:
tag:
description: "Optional release tag to build (e.g. v0.1.0)"
required: false
type: string
push:
tags:
- "v*"
jobs:
build-flatpak:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Resolve release version
id: release
run: |
VERSION=""
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
elif [[ -n "${{ inputs.tag }}" ]]; then
VERSION="${{ inputs.tag }}"
VERSION="${VERSION#v}"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Sync version to build metadata
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
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(
r'<release version="[^"]*" date="[^"]*">',
f'<release version="{version}" date="{today}">',
metainfo_text
)
metainfo_path.write_text(metainfo_text, encoding="utf-8")
PY
- name: Install flatpak tooling
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- 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
- name: Build Flatpak
id: build_flatpak
env:
VERSION: ${{ steps.release.outputs.version }}
run: |
mkdir -p flatpak-build flatpak-repo dist
BUNDLE_NAME="QBZ.flatpak"
if [[ -n "$VERSION" ]]; then
BUNDLE_NAME="qbz_${VERSION}_x86_64.flatpak"
fi
flatpak-builder --user --force-clean --repo=flatpak-repo \
flatpak-build packaging/flatpak/com.blitzfc.qbz.yml
flatpak build-bundle flatpak-repo "dist/${BUNDLE_NAME}" com.blitzfc.qbz
echo "bundle_name=${BUNDLE_NAME}" >> "$GITHUB_OUTPUT"
ls -la dist
- name: Upload Flatpak bundle
uses: actions/upload-artifact@v4
with:
name: qbz-flatpak
path: dist/${{ steps.build_flatpak.outputs.bundle_name }}
- name: Publish GitHub Release Asset
if: startsWith(github.ref, 'refs/tags/')
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' }}