Files
qbz/.github/workflows/release-linux.yml
T
vicrodh ddf4142188 fix(appimage): pin WebKitGTK to 2.44.0-2 to prevent EGL crash
The AppImage EGL_BAD_PARAMETER crash is caused by how Tauri's
linuxdeploy bundles newer WebKitGTK versions (tauri-apps/tauri#11994).

Fix: pin WebKitGTK to 2.44.0-2 on ubuntu-24.04, matching the proven
fix from other Tauri apps (audioling#40, OmniKee).

Also revert runtime env var workarounds (LIBGL_ALWAYS_SOFTWARE,
default-off hardware accel) since the fix is at the build level.
Keep only the NVIDIA DMA-BUF workaround which is still needed.
2026-02-09 01:28:11 -06:00

156 lines
5.2 KiB
YAML

name: release-linux
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-linux:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- 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")
PY
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: |
sudo apt-get update
# Pin WebKitGTK to 2.44.0-2 to prevent EGL_BAD_PARAMETER crash in AppImage
# See: https://github.com/tauri-apps/tauri/issues/11994
sudo apt-get install -y \
libwebkit2gtk-4.1-0=2.44.0-2 \
libwebkit2gtk-4.1-dev=2.44.0-2 \
libjavascriptcoregtk-4.1-0=2.44.0-2 \
libjavascriptcoregtk-4.1-dev=2.44.0-2 \
gir1.2-javascriptcoregtk-4.1=2.44.0-2 \
gir1.2-webkit2-4.1=2.44.0-2 \
libgtk-3-dev \
libappindicator3-dev \
librsvg2-dev \
libasound2-dev \
patchelf
- name: Install JS dependencies
run: npm ci
- name: Build DEB/RPM/AppImage
run: npm run tauri build -- --bundles deb,rpm,appimage
- name: Collect artifacts
id: artifacts
env:
VERSION: ${{ steps.release.outputs.version }}
run: |
mkdir -p dist
cp -v src-tauri/target/release/bundle/deb/*.deb dist/ || true
cp -v src-tauri/target/release/bundle/rpm/*.rpm dist/ || true
cp -v src-tauri/target/release/bundle/appimage/*.AppImage dist/ || true
# Create tarball for AUR with proper structure
TARBALL_DIR="qbz_${VERSION}_amd64"
mkdir -p "tarball-staging/${TARBALL_DIR}/icons/hicolor"/{32x32,48x48,64x64,128x128,256x256}/apps
# Binary
cp src-tauri/target/release/qbz-nix "tarball-staging/${TARBALL_DIR}/qbz"
# Icons (use available sizes, copy 128x128 for missing sizes)
cp src-tauri/icons/32x32.png "tarball-staging/${TARBALL_DIR}/icons/hicolor/32x32/apps/qbz.png"
cp src-tauri/icons/128x128.png "tarball-staging/${TARBALL_DIR}/icons/hicolor/48x48/apps/qbz.png"
cp src-tauri/icons/128x128.png "tarball-staging/${TARBALL_DIR}/icons/hicolor/64x64/apps/qbz.png"
cp src-tauri/icons/128x128.png "tarball-staging/${TARBALL_DIR}/icons/hicolor/128x128/apps/qbz.png"
cp src-tauri/icons/128x128@2x.png "tarball-staging/${TARBALL_DIR}/icons/hicolor/256x256/apps/qbz.png"
# Desktop file
cat > "tarball-staging/${TARBALL_DIR}/qbz.desktop" << 'EOF'
[Desktop Entry]
Name=QBZ
Comment=Native Qobuz client with hi-res audio support
Exec=qbz
Icon=qbz
Terminal=false
Type=Application
Categories=AudioVideo;Audio;Music;Player;
Keywords=music;audio;qobuz;hifi;streaming;audiophile;
EOF
tar -czvf "dist/qbz_${VERSION}_amd64.tar.gz" -C tarball-staging "${TARBALL_DIR}"
ls -la dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: qbz-linux-packages
path: dist/*
- name: Publish GitHub Release Assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: dist/*