mirror of
https://github.com/storytold/filmcraft.git
synced 2026-10-14 19:26:59 -04:00
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 <target>/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 <[email protected]>
This commit is contained in:
1 parent
6e4e46a10a
commit
3b6ef97010
5 files changed
+21
-12
No files matched your search
@@ -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"
|
||||
|
||||
@@ -30,6 +30,7 @@ SUBCOMMANDS
|
||||
bench-decode <media> [--frames N]
|
||||
mcp MCP server on stdio (headless, or --bridge to the live app)
|
||||
help this text
|
||||
--version print the version
|
||||
|
||||
OPTIONS
|
||||
--project <p.fcproj> 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 <media>"));
|
||||
let bytes = std::fs::read(path).unwrap_or_else(|e| fail(format!("{path}: {e}")));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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-<version>/ 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 <see xtask WASM_BINDGEN> --locked); `cargo xtask web` builds it. The zip holds a self-contained static site in filmcraft-web-<version>/ that works
|
||||
# from any URL path and inside an <iframe>. Hosting notes: packaging/web/README.md.
|
||||
set -euo pipefail
|
||||
# shellcheck source=../env.sh
|
||||
@@ -12,13 +12,12 @@ set -euo pipefail
|
||||
HERE="$ROOT/packaging/web"
|
||||
|
||||
if [ "${1:-}" != "--skip-build" ]; then
|
||||
command -v trunk >/dev/null || { echo "error: trunk not found (cargo install trunk --locked)" >&2; exit 1; }
|
||||
(cd "$ROOT/apps/filmcraft-web" && trunk build --release)
|
||||
(cd "$ROOT" && cargo xtask web)
|
||||
fi
|
||||
|
||||
SITE="$ROOT/dist/web"
|
||||
SITE="$CARGO_TARGET_DIR/web/dist"
|
||||
[ -f "$SITE/index.html" ] || { echo "error: $SITE/index.html missing; run without --skip-build" >&2; exit 1; }
|
||||
# Paths must be relative so the site works under any prefix (public_url = "./" in Trunk.toml).
|
||||
# Paths must be relative so the site works under any prefix.
|
||||
if grep -Eq '(src|href)="/[^/]' "$SITE/index.html"; then
|
||||
echo "error: $SITE/index.html has root-absolute URLs; it would break when served from a sub-path" >&2
|
||||
exit 1
|
||||
|
||||
Reference in new issue
Block a user