From 3f849d0db6b9353077e9f5d3f76048cc64683a39 Mon Sep 17 00:00:00 2001 From: Micha Date: Tue, 25 Nov 2025 17:59:58 +0100 Subject: [PATCH] more Sparkle tests --- README.md | 10 ++++++++ Sparkle/appcast.xml | 10 +++++++- hooks/pre-push | 41 +++++++++++++++++++++++++++++++ iKeyMon.xcodeproj/project.pbxproj | 8 +++--- version.json | 2 +- 5 files changed, 65 insertions(+), 6 deletions(-) create mode 100755 hooks/pre-push diff --git a/README.md b/README.md index a9e1772..bca008d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,16 @@ Preferences expose Sparkle’s built-in toggles for “Automatically check” an > Build settings include `INFOPLIST_KEY_SUFeedURL` and `INFOPLIST_KEY_SUPublicEDKey`. Make sure to fill both before shipping a build so Sparkle knows where to fetch updates and how to verify them. +### Automated release push + +If you want `git push origin master` to build/sign/notarize/upload automatically, enable the provided pre-push hook: + +```bash +git config core.hooksPath hooks +``` + +The hook (see `hooks/pre-push`) watches for pushes that include `refs/heads/master`, runs `scripts/build_release.sh`, and automatically commits the updated `Sparkle/appcast.xml` so it travels with your release. To skip the automation temporarily, prepend `SKIP_RELEASE=1` to your `git push` command. + ### Versioning workflow - The canonical marketing version lives in `version.json` and follows the format `YY.major.minor` (example: `26.1.2`). Update that file manually whenever you cut a new release branch. diff --git a/Sparkle/appcast.xml b/Sparkle/appcast.xml index 972987a..c155b12 100644 --- a/Sparkle/appcast.xml +++ b/Sparkle/appcast.xml @@ -2,6 +2,14 @@ iKeyMon + + 26.0.15 + Tue, 25 Nov 2025 17:42:56 +0100 + 34 + 26.0.15 + 15.2 + + 26.0.13 Tue, 25 Nov 2025 00:05:46 +0100 @@ -11,4 +19,4 @@ - + \ No newline at end of file diff --git a/hooks/pre-push b/hooks/pre-push new file mode 100755 index 0000000..c9c3861 --- /dev/null +++ b/hooks/pre-push @@ -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." diff --git a/iKeyMon.xcodeproj/project.pbxproj b/iKeyMon.xcodeproj/project.pbxproj index c70b6d3..13f2a12 100644 --- a/iKeyMon.xcodeproj/project.pbxproj +++ b/iKeyMon.xcodeproj/project.pbxproj @@ -310,7 +310,7 @@ CODE_SIGN_ENTITLEMENTS = iKeyMon.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 32; + CURRENT_PROJECT_VERSION = 34; DEVELOPMENT_ASSET_PATHS = "\"Preview Content\""; DEVELOPMENT_TEAM = Q5486ZVAFT; ENABLE_HARDENED_RUNTIME = YES; @@ -325,7 +325,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 26.0.13; + MARKETING_VERSION = 26.0.15; PRODUCT_BUNDLE_IDENTIFIER = net.24unix.iKeyMon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -341,7 +341,7 @@ CODE_SIGN_ENTITLEMENTS = iKeyMon.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 32; + CURRENT_PROJECT_VERSION = 34; DEVELOPMENT_ASSET_PATHS = "\"Preview Content\""; DEVELOPMENT_TEAM = Q5486ZVAFT; ENABLE_HARDENED_RUNTIME = YES; @@ -356,7 +356,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 26.0.13; + MARKETING_VERSION = 26.0.15; PRODUCT_BUNDLE_IDENTIFIER = net.24unix.iKeyMon; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/version.json b/version.json index 551d686..3e7fe72 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "marketing_version": "26.0.13" + "marketing_version": "26.0.15" }