






















@@ -26,12 +26,33 @@ canonical_sparkle_build() {
2626 node --import tsx "$ROOT_DIR/scripts/sparkle-build.ts" canonical-build "$1"
2727}
282829+correction_build_from_exact_tag() {
30+local version="$1"
31+local canonical="$2"
32+local tag correction highest
33+34+ highest=""
35+while IFS= read -r tag; do
36+if [[ "$tag" =~ ^v${version//./\\.}-([1-9][0-9]*)$ ]]; then
37+ correction="${BASH_REMATCH[1]}"
38+if [[ -z "$highest" || "$correction" -gt "$highest" ]]; then
39+ highest="$correction"
40+fi
41+fi
42+done < <(git -C "$ROOT_DIR" tag --points-at HEAD 2>/dev/null || true)
43+44+if [[ -n "$highest" ]]; then
45+printf '%s\n' "$((canonical + highest))"
46+fi
47+}
48+2949# Local fallback releases must not silently fall back to a git-rev-count build number.
3050# For correction tags, pass a higher explicit APP_BUILD than the canonical floor.
3151if [[ -z "${APP_BUILD:-}" && "$BUILD_CONFIG" == "release" ]]; then
3252 CANONICAL_APP_BUILD="$(canonical_sparkle_build "$APP_VERSION_INPUT" 2>/dev/null || true)"
3353if [[ "$CANONICAL_APP_BUILD" =~ ^[0-9]+$ ]]; then
34-export APP_BUILD="$CANONICAL_APP_BUILD"
54+ APP_BUILD="$(correction_build_from_exact_tag "$APP_VERSION_INPUT" "$CANONICAL_APP_BUILD")"
55+export APP_BUILD="${APP_BUILD:-$CANONICAL_APP_BUILD}"
3556fi
3657fi
3758此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。