From 7dfd787f5bf2acb876d88f40bb9d7afd37168cd6 Mon Sep 17 00:00:00 2001 From: Kresna Date: Mon, 27 Jul 2026 01:00:19 +0700 Subject: [PATCH] feat(desktop): bundle ffmpeg as a sidecar (externalBin) Re-enable externalBin "bin/ffmpeg" so recordings/conversions use a bundled ffmpeg instead of a system install. The compile-time sidecar validation that broke desktop-check before is handled: desktop-check stubs an empty sidecar (cargo check never runs it), release.yml downloads the real per-target binary, and beforeDev/BuildCommand auto-fetch it locally. ffmpeg_path() already prefers the bundled binary next to the exe. --- .github/workflows/desktop-check.yml | 10 ++++++++++ src-tauri/tauri.conf.json | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/desktop-check.yml b/.github/workflows/desktop-check.yml index 5b835a6..539bdfb 100644 --- a/.github/workflows/desktop-check.yml +++ b/.github/workflows/desktop-check.yml @@ -69,6 +69,16 @@ jobs: mkdir -p dist echo 'stub' > dist/index.html + # externalBin ("bin/ffmpeg") is validated at compile time by tauri-build; + # an empty file is enough for `cargo check` — we never execute it here. + - name: Stub ffmpeg sidecar + shell: bash + run: | + mkdir -p src-tauri/bin + TRIPLE=$(rustc -vV | sed -n 's/host: //p') + EXT=""; [ "${{ runner.os }}" = "Windows" ] && EXT=".exe" + : > "src-tauri/bin/ffmpeg-${TRIPLE}${EXT}" + - name: cargo check (all targets) working-directory: src-tauri run: cargo check --all-targets diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 519a362..4b40998 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -4,7 +4,8 @@ "version": "1.0.0-beta.2", "identifier": "com.goodwebtools.app", "build": { - "beforeBuildCommand": "npm run build", + "beforeDevCommand": "npm run download:ffmpeg", + "beforeBuildCommand": "npm run download:ffmpeg && npm run build", "frontendDist": "../dist", "devUrl": "http://localhost:4321" }, @@ -78,6 +79,7 @@ "bundle": { "active": true, "createUpdaterArtifacts": true, + "externalBin": ["bin/ffmpeg"], "targets": ["nsis", "app", "dmg", "deb"], "resources": [], "category": "Utility",