From db4c2aa930a39453ea1e7903e731035d1ac33136 Mon Sep 17 00:00:00 2001 From: Micha Date: Sun, 7 Dec 2025 16:52:13 +0100 Subject: [PATCH] Sparkle fixes --- Sources/Views/Cells/InfoCell.swift | 1 + hooks/pre-push | 48 ++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/Sources/Views/Cells/InfoCell.swift b/Sources/Views/Cells/InfoCell.swift index d96ab31..ac4e8f3 100644 --- a/Sources/Views/Cells/InfoCell.swift +++ b/Sources/Views/Cells/InfoCell.swift @@ -26,6 +26,7 @@ struct InfoCell: View { .font(monospaced ? .system(.body, design: .monospaced) : .body) } } + // if let subtext { // Text(subtext) // .font(.caption) diff --git a/hooks/pre-push b/hooks/pre-push index e05535a..25743f2 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -3,9 +3,11 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" REMOTE_NAME="${1:-origin}" +QUIET_RELEASE="${QUIET_RELEASE:-1}" +RELEASE_LOG="${RELEASE_LOG:-$ROOT_DIR/build/release.log}" if [[ -n "${SKIP_RELEASE:-}" ]]; then - echo "⚙️ SKIP_RELEASE set — skipping automated release build." + echo "release: skipped (SKIP_RELEASE=1)" exit 0 fi @@ -34,29 +36,49 @@ if [[ "$should_release" != true ]]; then exit 0 fi -echo "🚀 Detected push to master — bumping version and building release..." -NEW_VERSION="$("$ROOT_DIR/scripts/bump_version.sh")" -echo "🔢 marketing_version -> ${NEW_VERSION}" -"$ROOT_DIR/scripts/sync_version.sh" +if [[ "$QUIET_RELEASE" == "1" ]]; then + mkdir -p "$(dirname "$RELEASE_LOG")" + : >"$RELEASE_LOG" +fi + +run_logged() { + if [[ "$QUIET_RELEASE" == "1" ]]; then + "$@" >>"$RELEASE_LOG" 2>&1 + else + "$@" + fi +} + +if [[ "$QUIET_RELEASE" == "1" ]]; then + NEW_VERSION="$("$ROOT_DIR/scripts/bump_version.sh" 2>>"$RELEASE_LOG" | tee -a "$RELEASE_LOG")" +else + NEW_VERSION="$("$ROOT_DIR/scripts/bump_version.sh")" +fi +run_logged "$ROOT_DIR/scripts/sync_version.sh" git -C "$ROOT_DIR" add "$ROOT_DIR/version.json" "$ROOT_DIR/iKeyMon.xcodeproj/project.pbxproj" -"$ROOT_DIR/scripts/build_release.sh" +echo "release: building v${NEW_VERSION}..." +if ! run_logged "$ROOT_DIR/scripts/build_release.sh"; then + echo "release: failed (log: $RELEASE_LOG)" + exit 1 +fi git -C "$ROOT_DIR" add "$ROOT_DIR/version.json" "$ROOT_DIR/iKeyMon.xcodeproj/project.pbxproj" "$ROOT_DIR/Sparkle/appcast.xml" if git -C "$ROOT_DIR" diff --cached --quiet; then - echo "⚠️ No release changes detected; skipping release commit." + echo "release: no changes detected; skipping commit" else - git -C "$ROOT_DIR" commit -m "chore: release ${NEW_VERSION}" - echo "📝 Committed release ${NEW_VERSION}." + run_logged git -C "$ROOT_DIR" commit -m "chore: release ${NEW_VERSION}" || { + echo "release: commit failed (log: $RELEASE_LOG)" + exit 1 + } fi -echo "📤 Pushing release commit..." -if SKIP_RELEASE=1 git -C "$ROOT_DIR" push "$REMOTE_NAME" "${release_local_ref:-refs/heads/master}:${release_remote_ref:-refs/heads/master}"; then - echo "✅ Release ${NEW_VERSION} pushed. Original push cancelled (already done)." +if SKIP_RELEASE=1 git -C "$ROOT_DIR" push --quiet "$REMOTE_NAME" "${release_local_ref:-refs/heads/master}:${release_remote_ref:-refs/heads/master}"; then + echo "release: success v${NEW_VERSION}" exit 1 else - echo "❌ Failed to push release ${NEW_VERSION}. Please resolve manually." + echo "release: push failed (log: $RELEASE_LOG)" exit 1 fi