From 3b6ef97010a6b57bec4ae0e63ff6217656c5bf9e Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 2 Oct 2026 12:33:59 -0400 Subject: [PATCH] Release fixes: CLI --version, ALSA on Linux, web build via xtask - filmcraft-cli: support --version/-V/version (the packaging smoke tests call it). - Linux release job installs libasound2-dev for alsa-sys; deb/rpm depend on libasound2/alsa-lib; Flatpak gets --socket=pulseaudio for audio. - packaging/web/package.sh builds with `cargo xtask web` (wasm-bindgen) and zips /web/dist instead of assuming trunk; the release job installs wasm-bindgen-cli 0.2.129 to match the crate. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 13 +++++++------ apps/filmcraft-cli/src/main.rs | 6 ++++++ .../linux/flatpak/ai.storyteller.filmcraft.yml | 1 + packaging/linux/nfpm.yaml | 2 ++ packaging/web/package.sh | 11 +++++------ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec50ab54..0cfad532 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,7 +171,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ - libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev \ + libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libasound2-dev \ desktop-file-utils appstream python3-yaml curl -fsSL -o "$RUNNER_TEMP/nfpm.deb" \ "https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_${{ matrix.deb }}.deb" @@ -209,7 +209,7 @@ jobs: env: FILMCRAFT_VERSION: ${{ needs.version.outputs.version }} FILMCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }} - TRUNK_VERSION: 0.21.14 + WASM_BINDGEN_VERSION: 0.2.129 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -218,11 +218,12 @@ jobs: - uses: Swatinem/rust-cache@v2 with: key: release-web - - name: Install trunk + - name: Install wasm-bindgen CLI run: | - curl -fsSL "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \ - | tar -xz -C "$HOME/.cargo/bin" trunk - trunk --version + # Must match the wasm-bindgen crate version exactly (WASM_BINDGEN in xtask/src/main.rs). + command -v wasm-bindgen >/dev/null && wasm-bindgen --version | grep -q "$WASM_BINDGEN_VERSION" \ + || cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --locked + wasm-bindgen --version - name: Apply version override if: inputs.version != '' run: cargo xtask version set "$FILMCRAFT_VERSION" diff --git a/apps/filmcraft-cli/src/main.rs b/apps/filmcraft-cli/src/main.rs index 2ab7c24b..df8b76c5 100644 --- a/apps/filmcraft-cli/src/main.rs +++ b/apps/filmcraft-cli/src/main.rs @@ -30,6 +30,7 @@ SUBCOMMANDS bench-decode [--frames N] mcp MCP server on stdio (headless, or --bridge to the live app) help this text + --version print the version OPTIONS --project open this project first (headless) @@ -130,10 +131,15 @@ fn format_for(path: &str) -> Option<&'static str> { #[tokio::main] async fn main() { + if matches!(std::env::args().nth(1).as_deref(), Some("--version" | "-V")) { + println!("filmcraft-cli {}", env!("CARGO_PKG_VERSION")); + return; + } let a = Args::parse(std::env::args().skip(1)); let Some(cmd) = a.pos(0) else { usage("missing subcommand") }; match cmd { "help" | "--help" | "-h" => print!("{HELP}"), + "version" => println!("filmcraft-cli {}", env!("CARGO_PKG_VERSION")), "probe" => { let path = a.pos(1).unwrap_or_else(|| usage("probe ")); let bytes = std::fs::read(path).unwrap_or_else(|e| fail(format!("{path}: {e}"))); diff --git a/packaging/linux/flatpak/ai.storyteller.filmcraft.yml b/packaging/linux/flatpak/ai.storyteller.filmcraft.yml index 1c54d17d..9c4f8b95 100644 --- a/packaging/linux/flatpak/ai.storyteller.filmcraft.yml +++ b/packaging/linux/flatpak/ai.storyteller.filmcraft.yml @@ -19,6 +19,7 @@ finish-args: - --share=ipc - --socket=wayland - --socket=fallback-x11 + - --socket=pulseaudio - --device=dri # Open/Save dialogs use the file-chooser portal (rfd), and drag-and-drop uses the document # portal, so broad filesystem access isn't needed. Pictures is granted for opening files by diff --git a/packaging/linux/nfpm.yaml b/packaging/linux/nfpm.yaml index 9ed31d81..26e7996f 100644 --- a/packaging/linux/nfpm.yaml +++ b/packaging/linux/nfpm.yaml @@ -32,6 +32,7 @@ overrides: - libgcc-s1 - libxkbcommon0 - libvulkan1 | libegl1 + - libasound2 | libasound2t64 recommends: - libwayland-client0 - libx11-6 @@ -45,6 +46,7 @@ overrides: depends: - libxkbcommon - (vulkan-loader or libglvnd-egl) + - alsa-lib recommends: - libwayland-client - libX11 diff --git a/packaging/web/package.sh b/packaging/web/package.sh index fbc927af..7f7d3c23 100755 --- a/packaging/web/package.sh +++ b/packaging/web/package.sh @@ -3,8 +3,8 @@ # # Usage: packaging/web/package.sh [--skip-build] # -# Needs: trunk (brew install trunk / cargo install trunk --locked) and the wasm32-unknown-unknown -# target. The zip holds a self-contained static site in filmcraft-web-/ that works +# Needs: the wasm32-unknown-unknown target and the wasm-bindgen CLI at the crate's exact version +# (cargo install wasm-bindgen-cli --version --locked); `cargo xtask web` builds it. The zip holds a self-contained static site in filmcraft-web-/ that works # from any URL path and inside an