hex/scripts/smoke-macos-app.sh
Dax Raad ecb228b8a0 feat(updater): one in-app updater on the Anomaly release service; drop Sparkle
Hex polls anoma.ly/release/hex/desktop/<channel>.json on every OS and decides
with the release protocol's client rules (the service's shared test vectors in
tests/fixtures/release-protocol): strictly newer unless revoked, the minimum
version before rollout, and a device-local rollout bucket that is never sent.
Direct installs (Linux and Windows with the installer's receipt, macOS a
replaceable Hex.app) download resumably, check size and SHA-256, then the OS
code signature (macOS app/update-requirement.txt: Developer ID 5NZ4Q7NXJ4,
anomaly.hex, notarized; Windows Authenticode from Anomaly's Artifact Signing
identity), and stage the update for Restart to update. macOS swaps the bundle
in with renamex_np(RENAME_SWAP) at restart or quit; a read-only location links
to the DMG. Package-managed installs show their manager's command; source and
test builds never check; DisableUpdates (macOS defaults, Windows policy key)
turns checks off.

Sparkle, its framework, Info.plist keys, appcast generation, and the ed25519
feeds are gone. release-app.sh prepare leaves Hex-<v>-macos-arm64.dmg and .zip
(root Hex.app). Macs on 2.3.1 get packaging/macos/legacy-appcast.xml: one
informational item linking to anoma.ly/hex.
2026-10-24 11:03:26 -04:00

44 lines
1.2 KiB
Shell
Executable file

#!/bin/sh
set -eu
# Launches a packaged Hex.app with throwaway Application Support for a few
# seconds and fails if it exits early.
# Permission prompts and onboarding may appear; nothing is granted or kept.
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <Hex.app path>" >&2
exit 1
fi
bundle=$1
seconds=${HEX_SMOKE_SECONDS:-15}
support=$(mktemp -d "${TMPDIR:-/tmp}/hex-smoke.XXXXXX")
pid=
trap '[ -z "$pid" ] || kill -KILL "$pid" 2>/dev/null || true; rm -rf "$support"' EXIT HUP INT TERM
fail() {
echo "Hex smoke test failed: $*" >&2
cat "$support/logs/process.log" >&2 2>/dev/null || cat "$support/output.log" >&2 || true
exit 1
}
HEX_APPLICATION_SUPPORT_DIR="$support" "$bundle/Contents/MacOS/hex" > "$support/output.log" 2>&1 &
pid=$!
sleep "$seconds"
if ! kill -0 "$pid" 2>/dev/null; then
status=0
wait "$pid" || status=$?
pid=
fail "exited with status $status within $seconds seconds"
fi
[ -s "$support/logs/process.log" ] || fail "wrote no process log"
kill -INT "$pid"
waited=0
while kill -0 "$pid" 2>/dev/null && [ "$waited" -lt 10 ]; do
sleep 1
waited=$((waited + 1))
done
if kill -0 "$pid" 2>/dev/null; then
echo "Hex was still running 10 seconds after SIGINT; killed it." >&2
fi
echo "Hex ran for $seconds seconds from $bundle."