more Sparkle tests

This commit is contained in:
Micha
2025-11-25 17:59:58 +01:00
parent 69904c07ce
commit 3f849d0db6
5 changed files with 65 additions and 6 deletions

41
hooks/pre-push Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ -n "${SKIP_RELEASE:-}" ]]; then
echo "⚙️ SKIP_RELEASE set — skipping automated release build."
exit 0
fi
should_release=false
while read -r local_ref local_sha remote_ref remote_sha; do
[[ -z "${local_ref:-}" ]] && continue
if [[ "$local_ref" == "refs/heads/master" || "$remote_ref" == "refs/heads/master" ]]; then
should_release=true
break
fi
done
if [[ "$should_release" != true ]]; then
exit 0
fi
echo "🚀 Pre-push hook detected master — running release build..."
"$ROOT_DIR/scripts/build_release.sh"
APPCAST_PATH="$ROOT_DIR/Sparkle/appcast.xml"
if ! git -C "$ROOT_DIR" diff --quiet "$APPCAST_PATH"; then
git -C "$ROOT_DIR" add "$APPCAST_PATH"
VERSION="$(python3 - "$ROOT_DIR/version.json" <<'PY'
import json, sys
with open(sys.argv[1], "r", encoding="utf-8") as handle:
data = json.load(handle)
print(data.get("marketing_version", "dev"))
PY
)"
git -C "$ROOT_DIR" commit -m "chore: update Sparkle appcast for ${VERSION}" >/dev/null
echo "📝 Committed updated Sparkle appcast for ${VERSION}."
fi
echo "✅ Release build complete — continuing push."