Fix Linux AppImage packaging (#6657)

* Fix Linux AppImage packaging stack

* Fix desktop release workflow guard
This commit is contained in:
Wasim Yousef Said 2026-06-25 04:40:00 +02:00 committed by GitHub
commit 2aef1a23cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 26 deletions

View file

@ -353,7 +353,7 @@ jobs:
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf
# ── Node.js ──
- name: Setup Node.js
@ -406,9 +406,24 @@ jobs:
if (config.bundle?.linux?.rpm) {
throw new Error('bundle.linux.rpm must not be configured');
}
if (config.bundle?.linux?.appimage?.bundleMediaFramework !== false) {
throw new Error('Linux AppImage bundleMediaFramework must stay false');
}
const workflow = readFileSync('.github/workflows/release-desktop.yml', 'utf8');
const lines = workflow.split(/\r?\n/);
const linuxInstallLines = lines.filter((line) => line.includes('sudo apt-get install'));
const ayatanaPackage = ['libayatana', 'appindicator3-dev'].join('-');
if (linuxInstallLines.some((line) => line.includes(ayatanaPackage))) {
throw new Error('Desktop Linux release must not install the Ayatana appindicator dev package');
}
if (!linuxInstallLines.some((line) => line.includes('libappindicator3-dev'))) {
throw new Error('Desktop Linux release must install libappindicator3-dev');
}
const linuxdeployLines = lines.filter((line) => line.includes('github.com/linuxdeploy/linuxdeploy/releases/download'));
if (!linuxdeployLines.some((line) => line.includes('1-alpha-20250213-2/linuxdeploy-x86_64.AppImage'))) {
throw new Error('Desktop Linux release must pin linuxdeploy 1-alpha-20250213-2');
}
const releaseBodies = [];
for (let i = 0; i < lines.length; i += 1) {
const match = lines[i].match(/^(\s*)releaseBody:\s*\|\s*$/);
@ -568,6 +583,19 @@ jobs:
Get-Command trusted-signing-cli -ErrorAction SilentlyContinue || Write-Output "trusted-signing-cli NOT in PATH"
trusted-signing-cli --version || Write-Output "trusted-signing-cli failed to run"
# ── Linux: pin AppImage packaging toolchain ──
- name: Pin linuxdeploy for AppImage
if: matrix.platform == 'ubuntu-22.04'
shell: bash
run: |
set -euo pipefail
tools_dir="$RUNNER_TEMP/tauri-tools-cache/tauri"
mkdir -p "$tools_dir"
curl -fsSL \
"https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage" \
-o "$tools_dir/linuxdeploy-x86_64.AppImage"
chmod +x "$tools_dir/linuxdeploy-x86_64.AppImage"
# ── Linux: build + sign + upload ──
- name: Build Linux app
if: matrix.platform == 'ubuntu-22.04'
@ -576,6 +604,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
XDG_CACHE_HOME: ${{ runner.temp }}/tauri-tools-cache
with:
projectPath: studio
tauriScript: npx --prefix . tauri

View file

@ -47,7 +47,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev \
libwebkit2gtk-4.1-dev libappindicator3-dev \
librsvg2-dev libxdo-dev libssl-dev patchelf
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0

View file

@ -159,36 +159,12 @@ fn setup_tray(app: &tauri::App) -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[cfg(target_os = "linux")]
fn apply_linux_appimage_webkit_workarounds() {
if std::env::var_os("APPIMAGE").is_none() {
return;
}
// AppImage bundles WebKitGTK/GTK while still using host Mesa/EGL.
// On some rolling Linux stacks that mixed path leaves WebKit blank.
set_env_if_missing("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
set_env_if_missing("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}
#[cfg(target_os = "linux")]
fn set_env_if_missing(key: &str, value: &str) {
if std::env::var_os(key).is_none() {
std::env::set_var(key, value);
}
}
#[cfg(not(target_os = "linux"))]
fn apply_linux_appimage_webkit_workarounds() {}
fn main() {
// Fix PATH for GUI apps (macOS .app bundles, Linux AppImage, Windows)
// GUI apps don't inherit shell dotfile PATH — this spawns the user's
// login shell to source .zshrc/.bashrc/.profile and sets PATH properly.
let _ = fix_path_env::fix();
apply_linux_appimage_webkit_workarounds();
setup_logging();
info!("Unsloth Studio desktop app starting");
windows_job::initialize();

View file

@ -76,6 +76,9 @@
}
},
"linux": {
"appimage": {
"bundleMediaFramework": false
},
"deb": {
"postRemoveScript": "./linux/postremove.sh"
}