From 305d22e4e6fa276b32b6e7536f92c754692e5bd4 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Fri, 20 Feb 2026 13:43:51 -0800 Subject: [PATCH] Fix same-day nightly update detection in Sparkle (#173) * Fix nightly build version monotonicity for Sparkle updates * Include run attempt in nightly build version --- .github/workflows/nightly.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 998b5c5d..965d69e1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -180,8 +180,14 @@ jobs: NIGHTLY_DATE=$(date -u +%Y%m%d) /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${BASE_MARKETING}-nightly.${NIGHTLY_DATE}" "$APP_PLIST" - # Build number: monotonic YYYYMMDDNN integer for clean Sparkle comparisons - NIGHTLY_BUILD="${NIGHTLY_DATE}01" + # Build number: unique/monotonic per workflow run attempt so same-day + # nightlies and reruns still compare as newer in Sparkle. + if [ -n "${GITHUB_RUN_ID:-}" ]; then + RUN_ATTEMPT="$(printf '%02d' "${GITHUB_RUN_ATTEMPT:-1}")" + NIGHTLY_BUILD="${GITHUB_RUN_ID}${RUN_ATTEMPT}" + else + NIGHTLY_BUILD="${NIGHTLY_DATE}000000" + fi /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${NIGHTLY_BUILD}" "$APP_PLIST" # Embed commit SHA for bug reports