forked from cflmy/deepseek-harness
The GitHub remote is CI/CD only: workflows download the exact Gitea archive for the requested source SHA instead of mirroring the large git history through a proxy (Git pack generation hits Cloudflare 524 limits). Source/SHA stay authoritative in Gitea; run-name + evidence record the Gitea SHA. The scheduled dispatcher reads Gitea tags and requests a release build for tags without an authoritative Release. Also allow MQDH_SOURCE_SHA without git metadata.
52 lines
2.1 KiB
Bash
Executable File
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="${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
|