feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
82
product-source/hololake-platform/scripts/build-windows-jd-cross.sh
Executable file
82
product-source/hololake-platform/scripts/build-windows-jd-cross.sh
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
target="x86_64-pc-windows-msvc"
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$repo_root"
|
||||
|
||||
if [[ "$(uname -s)" != "Linux" ]]; then
|
||||
echo "This cross-build entrypoint is intended for the JD Linux build node." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt_prefix=()
|
||||
if [[ "$(id -u)" -ne 0 ]]; then apt_prefix=(sudo); fi
|
||||
"${apt_prefix[@]}" apt-get update
|
||||
"${apt_prefix[@]}" apt-get install -y clang curl lld llvm nsis build-essential pkg-config libssl-dev
|
||||
fi
|
||||
|
||||
command -v node >/dev/null || { echo "Node.js is required." >&2; exit 2; }
|
||||
version="$(node scripts/internal-release-version.mjs src-tauri/tauri.conf.json "${HOLOLAKE_VERSION:-}")"
|
||||
tauri_config="${HOLOLAKE_TAURI_CONFIG:-}"
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
if ! command -v cargo >/dev/null 2>&1; then
|
||||
command -v curl >/dev/null || { echo "curl is required to install Rust." >&2; exit 2; }
|
||||
export RUSTUP_DIST_SERVER="${RUSTUP_DIST_SERVER:-https://rsproxy.cn}"
|
||||
export RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://rsproxy.cn/rustup}"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||
fi
|
||||
export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo-jd}"
|
||||
mkdir -p "$CARGO_HOME"
|
||||
cp scripts/cargo-config-jd.toml "$CARGO_HOME/config.toml"
|
||||
export PATH="$CARGO_HOME/bin:$HOME/.cargo/bin:$PATH"
|
||||
|
||||
if ! command -v corepack >/dev/null 2>&1; then
|
||||
npm install --global corepack
|
||||
fi
|
||||
|
||||
corepack enable 2>/dev/null || true
|
||||
corepack prepare pnpm@10.25.0 --activate
|
||||
rustup target add "$target"
|
||||
command -v cargo-xwin >/dev/null || cargo install cargo-xwin --locked
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
# Tauri's Linux CLI intentionally only exposes Linux bundle targets. Compile the
|
||||
# Windows application with cargo-xwin, then hand the resulting payload to NSIS.
|
||||
tauri_args=(build --runner cargo-xwin --target "$target" --no-bundle)
|
||||
if [[ -n "$tauri_config" ]]; then tauri_args+=(--config "$tauri_config"); fi
|
||||
pnpm tauri "${tauri_args[@]}"
|
||||
|
||||
target_root="${CARGO_TARGET_DIR:-$repo_root/src-tauri/target}"
|
||||
release_dir="$target_root/$target/release"
|
||||
app_exe="$release_dir/tolaria.exe"
|
||||
[[ -f "$app_exe" ]] || { echo "No Windows executable was produced: $app_exe" >&2; exit 1; }
|
||||
|
||||
bundle_dir="$release_dir/bundle/nsis"
|
||||
stage_dir="$bundle_dir/stage"
|
||||
installer_basename="${HOLOLAKE_INSTALLER_BASENAME:-HoloLake-Era_${version}_x64-internal-setup}"
|
||||
installer_basename="${installer_basename//\{version\}/$version}"
|
||||
installer="$bundle_dir/${installer_basename}.exe"
|
||||
rm -rf "$stage_dir"
|
||||
mkdir -p "$stage_dir/resources" "$bundle_dir"
|
||||
cp "$app_exe" "$stage_dir/HoloLake Era.exe"
|
||||
cp src-tauri/icons/icon.ico "$stage_dir/icon.ico"
|
||||
cp -R src-tauri/resources/mcp-server "$stage_dir/resources/"
|
||||
cp -R src-tauri/resources/agent-docs "$stage_dir/resources/"
|
||||
cp -R src-tauri/resources/public-architecture "$stage_dir/resources/"
|
||||
|
||||
makensis \
|
||||
-DAPP_VERSION="$version" \
|
||||
-DSTAGE_DIR="$stage_dir" \
|
||||
-DOUTPUT_FILE="$installer" \
|
||||
scripts/windows-installer.nsi
|
||||
|
||||
[[ -f "$installer" ]] || { echo "No NSIS installer was produced." >&2; exit 1; }
|
||||
[[ "$(basename "$installer")" == *"$version"* ]] || { echo "Installer filename does not contain version $version: $installer" >&2; exit 1; }
|
||||
|
||||
node scripts/verify-internal-package-content.mjs dist
|
||||
node scripts/verify-internal-package-content.mjs "$stage_dir"
|
||||
sha256sum "$installer" > "$installer.sha256"
|
||||
echo "$installer"
|
||||
Loading…
Reference in a new issue