Anyone who installed an AppImage or ran the Windows installer was frozen
on that version forever. Nothing in the app ever mentioned a new release
existed, and the release notes were the only announcement.
Desktop now checks a signed manifest, shows the version and its notes in
Settings, and installs and relaunches on request. The signature check is
the whole point: it is what stops a substituted download from being
installed by the app itself. Windows binaries stay unsigned for
SmartScreen purposes -- that is a code-signing certificate, a separate
problem -- but the update payload is verified against our own key.
Android is deliberately not wired to the updater. An app may not replace
its own APK; that is the package installer's job, and the plugin has no
Android implementation. It gets a link to the releases page instead of a
button that would throw.
The plugins are gated with a target-triple cfg rather than
cfg(desktop). Cargo only evaluates target cfgs in a [target.'cfg(..)']
table, so cfg(desktop) matches nothing, silently drops the dependency,
and fails much later with "Permission updater:default not found" -- which
is exactly what the first attempt here did.
Where the manifest lives took some finding. This Gitea serves
/releases/download/<tag>/<asset> but 404s on
/releases/latest/download/<asset> (verified against a real asset), so
there is no stable latest-release URL. The gitea-pages branch is
force-pushed wholesale by publish-docs.yml, so it cannot host the file
either. latest.json therefore gets its own orphan branch, read over the
raw-file URL, and is published from a scratch repo in RUNNER_TEMP rather
than by switching branches in the checkout -- doing that would have left
the following steps standing on a one-commit history, and the next step
but one runs release:notes against the real commit range.
Also fixed, all of it release-integrity:
- "appimage" is in bundle.targets. The release notes have advertised an
AppImage for months; tauri.conf.json never built one, the artifact
step globbed for *.AppImage, found nothing, and said nothing. The
step now fails instead.
- The .AppImage.tar.gz/.sig pair and the NSIS .sig are collected. A
manifest referencing a signature that was never uploaded fails only
on the user's machine, so the manifest step also refuses to write an
entry with an empty signature.
- Release notes are generated by release:notes from the traceability
graph, which is what CLAUDE.md has asked for all along, instead of a
fixed heredoc that said "see CHANGELOG.md for detailed changes" and
linked "GitHub Issues" on a Gitea-hosted project.
- The notes tell users how to verify a download with SHA256SUMS.
Requirements UR-077 / DR-217, tests UT-208 (12 cases over the version
comparison and the platform decision, including that a pre-release does
not offer itself as an upgrade to the matching release).
Verified: 1070 frontend tests, cargo check for both the host and
aarch64-linux-android (confirming the plugins are absent there), clippy
-D warnings, svelte-check 0 errors.
80 lines
3.6 KiB
Bash
Executable File
80 lines
3.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Cross-compile JellyTau for Windows from Linux, producing an NSIS installer.
|
|
#
|
|
# Uses the OFFICIAL Tauri cross-compile path (https://v2.tauri.app/distribute/
|
|
# windows-installer/): the MSVC target driven by cargo-xwin, which downloads the
|
|
# MSVC CRT/Windows SDK headers and links with lld. This is the target Tauri
|
|
# officially supports for Windows (the mingw/GNU target is not), and unlike GNU
|
|
# it can bundle the NSIS installer from a Linux host.
|
|
#
|
|
# Playback on Windows: video renders via WebView2 and audio via the webview
|
|
# <audio> backend (WebviewAudioBackend) — see docs/build/build-windows.md.
|
|
#
|
|
# Requirements (present in the Docker windows-cross target / unified builder):
|
|
# - rustup target x86_64-pc-windows-msvc
|
|
# - cargo-xwin (cargo install --locked cargo-xwin)
|
|
# - lld, llvm (linker + llvm-lib used by cargo-xwin)
|
|
# - nsis (makensis) (installer generator)
|
|
#
|
|
# Usage:
|
|
# scripts/build-windows-cross.sh # exe + NSIS installer
|
|
# WIN_BUNDLES=none scripts/build-windows-cross.sh # exe only, skip bundling
|
|
# OUTPUT_DIR=/app/dist scripts/build-windows-cross.sh
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
TARGET="x86_64-pc-windows-msvc"
|
|
WIN_BUNDLES="${WIN_BUNDLES:-nsis}"
|
|
|
|
echo "🪟 Cross-compiling JellyTau for Windows ($TARGET, via cargo-xwin)"
|
|
echo "================================================================"
|
|
echo "Video plays via WebView2; audio via the webview <audio> backend."
|
|
echo "Bundles: $WIN_BUNDLES"
|
|
echo ""
|
|
|
|
bun install --frozen-lockfile 2>/dev/null || bun install
|
|
bun run build
|
|
|
|
# --runner cargo-xwin + the MSVC target is what makes the Tauri CLI treat this as
|
|
# a real Windows build and enable the nsis/msi bundlers on a Linux host.
|
|
#
|
|
# IMPORTANT: do NOT pass `--bundles nsis` here. tauri-cli 2.9.x validates the
|
|
# `--bundles` flag against a static clap enum gated by the HOST OS (Linux allows
|
|
# only deb/rpm/appimage) *before* it considers --target/--runner, so `--bundles
|
|
# nsis` is rejected at arg-parse time. Instead the Windows bundle targets come
|
|
# from tauri.conf.json (bundle.targets includes "nsis"), which is not subject to
|
|
# that CLI validation — the bundler then picks nsis once it knows the target is
|
|
# Windows.
|
|
if [[ "$WIN_BUNDLES" == "none" ]]; then
|
|
bun run tauri build --runner cargo-xwin --target "$TARGET" --no-bundle
|
|
else
|
|
bun run tauri build --runner cargo-xwin --target "$TARGET"
|
|
fi
|
|
|
|
BIN_DIR="src-tauri/target/$TARGET/release"
|
|
echo ""
|
|
echo "✅ Built Windows artifacts:"
|
|
find "$BIN_DIR" -maxdepth 1 -name '*.exe' -print
|
|
find "$BIN_DIR/bundle" -type f \( -name '*.exe' -o -name '*.msi' \) -print 2>/dev/null || true
|
|
|
|
if [[ -n "${OUTPUT_DIR:-}" ]]; then
|
|
mkdir -p "$OUTPUT_DIR"
|
|
find "$BIN_DIR" -maxdepth 1 -name 'jellytau.exe' -exec cp -v {} "$OUTPUT_DIR/" \;
|
|
# NSIS setup installers land in bundle/nsis/*-setup.exe; MSI in bundle/msi/*.msi.
|
|
#
|
|
# The .sig files come along too: when TAURI_SIGNING_PRIVATE_KEY is set the
|
|
# bundler writes `<installer>.sig` beside each installer, and that signature is
|
|
# what the updater verifies before installing anything. Leaving it behind
|
|
# produces a release whose manifest references a signature that was never
|
|
# published, which fails only on the user's machine.
|
|
find "$BIN_DIR/bundle" -type f \( -name '*-setup.exe' -o -name '*.msi' -o -name '*.sig' \) \
|
|
-exec cp -v {} "$OUTPUT_DIR/" \; 2>/dev/null || true
|
|
echo ""
|
|
echo "📦 Copied Windows artifacts to $OUTPUT_DIR"
|
|
fi
|
|
|
|
# Containerised builds run as root against a bind-mounted tree; hand the
|
|
# artifacts back to the host user. No-op when not root. See DR-213.
|
|
"$(dirname "$0")/restore-ownership.sh"
|