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