release: fix Sparkle upgrade path for 1.27.0 users
This commit is contained in:
parent
2bae2ca2f0
commit
faf1bd44c2
6 changed files with 46 additions and 14 deletions
|
|
@ -18,9 +18,26 @@ fi
|
|||
# Get current versions
|
||||
CURRENT_MARKETING=$(grep -m1 'MARKETING_VERSION = ' "$PROJECT_FILE" | sed 's/.*= \(.*\);/\1/')
|
||||
CURRENT_BUILD=$(grep -m1 'CURRENT_PROJECT_VERSION = ' "$PROJECT_FILE" | sed 's/.*= \(.*\);/\1/')
|
||||
MIN_BUILD="$CURRENT_BUILD"
|
||||
|
||||
echo "Current: MARKETING_VERSION=$CURRENT_MARKETING, CURRENT_PROJECT_VERSION=$CURRENT_BUILD"
|
||||
|
||||
# Keep Sparkle build numbers monotonic with the latest published stable appcast.
|
||||
# If local build numbers have fallen behind due merges/rebases, auto-correct upward.
|
||||
LATEST_RELEASE_BUILD="$(
|
||||
curl -fsSL --max-time 8 https://github.com/manaflow-ai/cmux/releases/latest/download/appcast.xml 2>/dev/null \
|
||||
| sed -n 's#.*<sparkle:version>\([0-9][0-9]*\)</sparkle:version>.*#\1#p' \
|
||||
| head -n1
|
||||
)"
|
||||
if [[ "$LATEST_RELEASE_BUILD" =~ ^[0-9]+$ ]]; then
|
||||
if (( LATEST_RELEASE_BUILD > MIN_BUILD )); then
|
||||
MIN_BUILD="$LATEST_RELEASE_BUILD"
|
||||
fi
|
||||
echo "Latest release appcast build: $LATEST_RELEASE_BUILD"
|
||||
else
|
||||
echo "Latest release appcast build: unavailable (continuing with local build baseline)"
|
||||
fi
|
||||
|
||||
# Parse current marketing version
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_MARKETING"
|
||||
|
||||
|
|
@ -42,8 +59,8 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Always increment build number
|
||||
NEW_BUILD=$((CURRENT_BUILD + 1))
|
||||
# Always increment build number, and never go backwards relative to published releases.
|
||||
NEW_BUILD=$((MIN_BUILD + 1))
|
||||
|
||||
echo "New: MARKETING_VERSION=$NEW_MARKETING, CURRENT_PROJECT_VERSION=$NEW_BUILD"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue