mirror of
https://github.com/exo-explore/exo.git
synced 2026-02-26 03:06:05 -05:00
Previous Sparkle builds were cut from a different repo with different
build numbers, breaking version ordering. Users aren't receiving updates
because CFBundleVersion values don't reflect the actual version sequence.
Added a step to compute the build version deterministically from semver:
PRERELEASE + (1000 * PATCH) + (1_000_000 * MINOR) + (1_000_000_000 * MAJOR).
Release versions use prerelease=999 to ensure they're always higher than
their prereleases (e.g., 1.0.61 > 1.0.61-alpha.3).
This ensures consistent version ordering across repos, allowing Sparkle
to correctly identify and deliver updates to users.
Test plan:
- Verified formula with test script:
```sh
compute_version() {
VERSION="$1"
BASE_VERSION="${VERSION%%-*}"
MAJOR=$(echo "$BASE_VERSION" | cut -d. -f1)
MINOR=$(echo "$BASE_VERSION" | cut -d. -f2)
PATCH=$(echo "$BASE_VERSION" | cut -d. -f3)
if [[ "$VERSION" == *-* ]]; then
PRERELEASE_PART="${VERSION#*-}"
PRERELEASE_NUM="${PRERELEASE_PART##*.}"
if ! [[ "$PRERELEASE_NUM" =~ ^[0-9]+$ ]]; then
PRERELEASE_NUM=0
fi
else
PRERELEASE_NUM=999
fi
BUILD_VERSION=$((PRERELEASE_NUM + 1000 * PATCH + 1000000 * MINOR + 1000000000 * MAJOR))
printf "%-20s -> %12s\n" "$VERSION" "$BUILD_VERSION"
}
compute_version "1.0.61-alpha.2"
compute_version "1.0.61-alpha.3"
compute_version "1.0.61"
compute_version "1.0.62-alpha.1"
compute_version "1.1.0-alpha.1"
compute_version "2.0.0-alpha.1"
compute_version "0.0.0-alpha.0"
compute_version "0.0.1-alpha.1"
compute_version "1.2.3"
compute_version "1.2.3-beta.5"
```
- Output:
```sh
Version -> Build Number
----------------------------------------
1.0.61-alpha.2 -> 1000061002
1.0.61-alpha.3 -> 1000061003
1.0.61 -> 1000061999
1.0.62-alpha.1 -> 1000062001
1.1.0-alpha.1 -> 1001000001
2.0.0-alpha.1 -> 2000000001
0.0.0-alpha.0 -> 0
0.0.1-alpha.1 -> 1001
1.2.3 -> 1002003999
1.2.3-beta.5 -> 1002003005
```
- Confirmed ordering: alpha.2 < alpha.3 < release < next-alpha