Skip to content

Commit 96a98e9

Browse files
myleshortonclaude
andauthored
fix: use github.run_number for build numbers to prevent sysext regression (#8564)
The previous approach derived build numbers by incrementing the value stored in pubspec.yaml. This broke when the base version changed (9.0.3 → 9.0.15) and the build number was manually reset to 94, producing builds with lower CFBundleVersion than the prior release (155). macOS refuses to upgrade system extensions to a lower build number, so users silently kept the old sysext. github.run_number is monotonically increasing across all workflow runs, never resets on version changes, and requires no commit-back step. Fixes #3091 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 78bc231 commit 96a98e9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,23 @@ jobs:
170170
shell: bash
171171
env:
172172
RELEASE_TAG: ${{ steps.meta.outputs.release_tag }}
173+
# github.run_number is monotonically increasing across all workflow
174+
# runs and never resets when the base version changes. This is
175+
# critical for macOS system extensions, which compare CFBundleVersion
176+
# numerically and refuse to upgrade to a lower build number.
177+
BUILD_NUMBER: ${{ github.run_number }}
173178
run: |
174179
# Strip 'v' prefix if present
175180
VERSION="${RELEASE_TAG#v}"
176181
177182
# Extract base semver (strip suffixes like -beta, -nightly-...)
178183
BASE_VERSION=$(./scripts/ci/version.sh extract "$VERSION")
179184
180-
CURRENT_BUILD=$(grep '^version:' pubspec.yaml | sed -E 's/^version: [0-9]+\.[0-9]+\.[0-9]+\+([0-9]+).*/\1/')
181-
BUILD_NUMBER=$((CURRENT_BUILD + 1))
182185
FULL_VERSION="${BASE_VERSION}+${BUILD_NUMBER}"
183186
184187
echo "Setting pubspec version: $FULL_VERSION"
185188
echo " Base version: $BASE_VERSION"
186-
echo " Build number: $BUILD_NUMBER"
189+
echo " Build number: $BUILD_NUMBER (github.run_number)"
187190
188191
sed -i.bak -E "s/^version:.*/version: ${FULL_VERSION}/" pubspec.yaml
189192
grep '^version:' pubspec.yaml

0 commit comments

Comments
 (0)