Fix same-day nightly update detection in Sparkle (#173)

* Fix nightly build version monotonicity for Sparkle updates

* Include run attempt in nightly build version
This commit is contained in:
Lawrence Chen 2026-02-20 13:43:51 -08:00 committed by GitHub
parent 7b2675cd1e
commit 305d22e4e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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