Release fixes: CLI --version, ALSA on Linux, web build via xtask, xtask version
- effectcraft-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. - packaging/web/package.sh builds with `cargo xtask web` (wasm-bindgen) and zips <target>/web/dist; the release job installs wasm-bindgen-cli 0.2.129. - xtask: version.rs (ported from PhotoCraft) called helpers that don't exist here, so xtask didn't compile; use the local run() and wire up `cargo xtask version`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
55daf36e38
commit
935cf691d1
@@ -171,7 +171,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y --no-install-recommends \
|
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
|
desktop-file-utils appstream python3-yaml
|
||||||
curl -fsSL -o "$RUNNER_TEMP/nfpm.deb" \
|
curl -fsSL -o "$RUNNER_TEMP/nfpm.deb" \
|
||||||
"https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_${{ matrix.deb }}.deb"
|
"https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_${{ matrix.deb }}.deb"
|
||||||
@@ -209,7 +209,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
EFFECTCRAFT_VERSION: ${{ needs.version.outputs.version }}
|
EFFECTCRAFT_VERSION: ${{ needs.version.outputs.version }}
|
||||||
EFFECTCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
|
EFFECTCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
|
||||||
TRUNK_VERSION: 0.21.14
|
WASM_BINDGEN_VERSION: 0.2.129
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
@@ -218,11 +218,12 @@ jobs:
|
|||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
key: release-web
|
key: release-web
|
||||||
- name: Install trunk
|
- name: Install wasm-bindgen CLI
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \
|
# Must match the wasm-bindgen version in Cargo.lock exactly (cargo xtask web checks it).
|
||||||
| tar -xz -C "$HOME/.cargo/bin" trunk
|
command -v wasm-bindgen >/dev/null && wasm-bindgen --version | grep -q "$WASM_BINDGEN_VERSION" \
|
||||||
trunk --version
|
|| cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --locked
|
||||||
|
wasm-bindgen --version
|
||||||
- name: Apply version override
|
- name: Apply version override
|
||||||
if: inputs.version != ''
|
if: inputs.version != ''
|
||||||
run: cargo xtask version set "$EFFECTCRAFT_VERSION"
|
run: cargo xtask version set "$EFFECTCRAFT_VERSION"
|
||||||
|
|||||||
@@ -138,6 +138,10 @@ fn value_arg(s: &str) -> Value {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let raw: Vec<String> = std::env::args().skip(1).collect();
|
let raw: Vec<String> = std::env::args().skip(1).collect();
|
||||||
|
if matches!(raw.first().map(String::as_str), Some("--version" | "-V" | "version")) {
|
||||||
|
println!("effectcraft-cli {}", env!("CARGO_PKG_VERSION"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if raw.is_empty() || raw.iter().any(|a| a == "-h" || a == "--help") {
|
if raw.is_empty() || raw.iter().any(|a| a == "-h" || a == "--help") {
|
||||||
println!("{USAGE}");
|
println!("{USAGE}");
|
||||||
std::process::exit(if raw.is_empty() { 2 } else { 0 });
|
std::process::exit(if raw.is_empty() { 2 } else { 0 });
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ finish-args:
|
|||||||
- --share=ipc
|
- --share=ipc
|
||||||
- --socket=wayland
|
- --socket=wayland
|
||||||
- --socket=fallback-x11
|
- --socket=fallback-x11
|
||||||
|
- --socket=pulseaudio
|
||||||
- --device=dri
|
- --device=dri
|
||||||
# Open/Save dialogs use the file-chooser portal (rfd), and drag-and-drop uses the document
|
# 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
|
# portal, so broad filesystem access isn't needed. Pictures is granted for opening files by
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ overrides:
|
|||||||
- libgcc-s1
|
- libgcc-s1
|
||||||
- libxkbcommon0
|
- libxkbcommon0
|
||||||
- libvulkan1 | libegl1
|
- libvulkan1 | libegl1
|
||||||
|
- libasound2 | libasound2t64
|
||||||
recommends:
|
recommends:
|
||||||
- libwayland-client0
|
- libwayland-client0
|
||||||
- libx11-6
|
- libx11-6
|
||||||
@@ -45,6 +46,7 @@ overrides:
|
|||||||
depends:
|
depends:
|
||||||
- libxkbcommon
|
- libxkbcommon
|
||||||
- (vulkan-loader or libglvnd-egl)
|
- (vulkan-loader or libglvnd-egl)
|
||||||
|
- alsa-lib
|
||||||
recommends:
|
recommends:
|
||||||
- libwayland-client
|
- libwayland-client
|
||||||
- libX11
|
- libX11
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
#
|
#
|
||||||
# Usage: packaging/web/package.sh [--skip-build]
|
# Usage: packaging/web/package.sh [--skip-build]
|
||||||
#
|
#
|
||||||
# Needs: trunk (brew install trunk / cargo install trunk --locked) and the wasm32-unknown-unknown
|
# Needs: the wasm32-unknown-unknown target and the wasm-bindgen CLI at the version in Cargo.lock;
|
||||||
# target. The zip holds a self-contained static site in effectcraft-web-<version>/ that works
|
# `cargo xtask web` builds it. The zip holds a self-contained static site in effectcraft-web-<version>/ that works
|
||||||
# from any URL path and inside an <iframe>. Hosting notes: packaging/web/README.md.
|
# from any URL path and inside an <iframe>. Hosting notes: packaging/web/README.md.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# shellcheck source=../env.sh
|
# shellcheck source=../env.sh
|
||||||
@@ -12,13 +12,12 @@ set -euo pipefail
|
|||||||
HERE="$ROOT/packaging/web"
|
HERE="$ROOT/packaging/web"
|
||||||
|
|
||||||
if [ "${1:-}" != "--skip-build" ]; then
|
if [ "${1:-}" != "--skip-build" ]; then
|
||||||
command -v trunk >/dev/null || { echo "error: trunk not found (cargo install trunk --locked)" >&2; exit 1; }
|
(cd "$ROOT" && cargo xtask web)
|
||||||
(cd "$ROOT/apps/effectcraft-web" && trunk build --release)
|
|
||||||
fi
|
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; }
|
[ -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
|
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
|
echo "error: $SITE/index.html has root-absolute URLs; it would break when served from a sub-path" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
+5
-1
@@ -365,7 +365,11 @@ fn main() -> ExitCode {
|
|||||||
let rest: Vec<String> = std::env::args().skip(2).collect();
|
let rest: Vec<String> = std::env::args().skip(2).collect();
|
||||||
ico::run(&rest.iter().map(String::as_str).collect::<Vec<_>>())
|
ico::run(&rest.iter().map(String::as_str).collect::<Vec<_>>())
|
||||||
}
|
}
|
||||||
_ => Err("usage: cargo xtask <layers|assets|wasm|web [--dev] [--serve PORT]|ico OUT.ico IN.png…|ci>".into()),
|
"version" => {
|
||||||
|
let rest: Vec<String> = std::env::args().skip(2).collect();
|
||||||
|
version::run(&root(), &rest.iter().map(String::as_str).collect::<Vec<_>>())
|
||||||
|
}
|
||||||
|
_ => Err("usage: cargo xtask <layers|assets|wasm|web [--dev] [--serve PORT]|ico OUT.ico IN.png…|version [set X.Y.Z]|ci>".into()),
|
||||||
};
|
};
|
||||||
match r {
|
match r {
|
||||||
Ok(()) => ExitCode::SUCCESS,
|
Ok(()) => ExitCode::SUCCESS,
|
||||||
|
|||||||
@@ -104,12 +104,12 @@ pub fn run(root: &Path, args: &[&str]) -> Result<(), String> {
|
|||||||
std::fs::write(&tmp, updated).map_err(|e| format!("write {}: {e}", tmp.display()))?;
|
std::fs::write(&tmp, updated).map_err(|e| format!("write {}: {e}", tmp.display()))?;
|
||||||
std::fs::rename(&tmp, &path).map_err(|e| format!("replace {}: {e}", path.display()))?;
|
std::fs::rename(&tmp, &path).map_err(|e| format!("replace {}: {e}", path.display()))?;
|
||||||
// Refresh the workspace members' entries in Cargo.lock (no dependency upgrades).
|
// Refresh the workspace members' entries in Cargo.lock (no dependency upgrades).
|
||||||
let mut c = crate::cargo();
|
let mut c = std::process::Command::new(env!("CARGO"));
|
||||||
c.args(["update", "--workspace", "--offline"]);
|
c.current_dir(root).args(["update", "--workspace", "--offline"]);
|
||||||
if crate::run(c, "cargo update --workspace --offline").is_err() {
|
if crate::run(&mut c).is_err() {
|
||||||
let mut c = crate::cargo();
|
let mut c = std::process::Command::new(env!("CARGO"));
|
||||||
c.args(["update", "--workspace"]);
|
c.current_dir(root).args(["update", "--workspace"]);
|
||||||
crate::run(c, "cargo update --workspace")?;
|
crate::run(&mut c)?;
|
||||||
}
|
}
|
||||||
println!("version: {old} -> {new}");
|
println!("version: {old} -> {new}");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user