Files
marqdo-app-harness/scripts/tauri/build-linux.sh
T
cflmy d434130785
ci/woodpecker/pr/ci Pipeline is pending
ci/woodpecker/pr/tauri-linux Pipeline is pending
ci/woodpecker/push/tauri-linux Pipeline is pending
ci/woodpecker/push/ci Pipeline was canceled
ci/woodpecker/tag/ci Pipeline failed
ci/woodpecker/tag/tauri-linux Pipeline failed
ci/woodpecker/manual/tauri-linux Pipeline is pending
ci/woodpecker/manual/tauri-macos Pipeline is pending
ci/woodpecker/manual/tauri-windows Pipeline is pending
ci/woodpecker/manual/ci Pipeline was successful
fix(mqdh): pass installer triplet positionally to the evidence helper (#31)
2026-12-03 13:20:42 +08:00

52 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the Linux `.deb` MQDH installer from one frozen source SHA.
#
# Requires the `mqdh-tauri-build` image (Rust 1.100 + WebKitGTK + Tauri CLI) and
# the locked Node workspace already installed/built by the CI lanes.
set -euo pipefail
cd "$(dirname "$0")/../.."
version="$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' packages/marqdo/harness/package.json | head -1)"
test -n "$version"
target="x86_64-unknown-linux-gnu"
out="${MARQDO_CI_OUT:-.ci}"
mkdir -p "$out"
archive="$out/marqdo-harness-${version}-${target}.tar.gz"
if [ ! -f "$archive" ]; then
MQDH_PACKAGE_WORK="${MQDH_PACKAGE_WORK:-/tmp/mqdh-package}" bash scripts/package.sh
fi
test -f "$archive"
bash scripts/tauri/prepare-resources.sh
if [ ! -f src-tauri/icons/icon.ico ] || [ ! -f src-tauri/icons/icon.icns ]; then
tauri icon apps/desktop/resources/icon.png --output src-tauri/icons >/dev/null
fi
export MQDH_SOURCE_SHA="$(git rev-parse HEAD)"
# Tauri 2.13 downloads a GStreamer asset plugin at deb bundle time. The app does
# not enable the asset protocol (`app.security.assetProtocol.enable=false`), and
# direct GitHub access is not available in the CI network: fetch any bundler
# asset through the reviewed internal mirror instead.
export TAURI_BUNDLER_TOOLS_GITHUB_MIRROR="${TAURI_BUNDLER_TOOLS_GITHUB_MIRROR:-https://ghproxy.cflmy.top/}"
tauri build --bundles deb --config "{\"version\":\"$version\"}"
deb="$(find src-tauri/target/release/bundle/deb -maxdepth 1 -name '*.deb' | head -1)"
test -n "$deb"
final="$out/mqdh-${version}-linux-x86_64.deb"
cp "$deb" "$final"
node scripts/tauri/attach-installers.mjs --installer "$final" deb "$target"
# Smoke the exact deb bytes: unpack, read the desktop version, start the real
# bundled backend on loopback through the packaged tree, then stop it.
smoke="$(mktemp -d)"
trap 'rm -rf "$smoke"' EXIT
dpkg-deb -x "$final" "$smoke/root"
binary="$(find "$smoke/root" -type f -name mqdh-desktop | head -1)"
test -n "$binary"
"$binary" --version
MQDH_HOME="$smoke/home" "$binary" --smoke
echo "build-linux: OK $final"
ls -l "$final" "$out"/mqdh-release.json "$out"/release-evidence.json