ci(release): apply build numbers at build time - #33307
Conversation
…them Stop pushing [skip ci] Bump version number commits to release branches by removing commit-build-version.yml and passing generated build numbers into build.yml for RC, production, and auto RC workflows. Release cut no longer allocates a new build number via create-release-pr; it reads the current value for github-tools validation only. Fixes MCWP-527
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
Reviving this — I arrived here from the opposite direction and ended up concluding this PR is the right fix, so sharing the evidence in case it helps get it over the line. Why this matters more than "noisy commits"I was asked to just drop the The push in There's a clean natural experiment in
The four runs on And the loop would be worse than an extra build. Because Deleting the commit entirely, as this PR does, removes the hazard rather than working around it. That's the durable fix. Still applies cleanly to mainChecked against current main (624 commits past the branch point,
One thing I'd change before merge: keep the commit pinnedRight now So two independent runs would each check out a moving branch. If a cherry-pick lands between them, the iOS and Android RC builds ship from different commits under one build number. On a branch as busy as Suggest using trigger-ios-rc-build:
with:
platform: ios
source_branch: ${{ github.sha }}
build_number: ${{ needs.generate_rc_build_version.outputs.build-version }}
distribute_external: trueThat's the push that triggered the run — with the bump commit gone, exactly the commit we want built — and it restores today's pinning guarantee. Safe downstream, too: The same pinning argument applies to the two Happy to push the |
Keep iOS and Android on the same commit after removing bump commits, so cherry-picks mid-run cannot diverge platforms under one build number. Co-authored-by: Cursor <cursoragent@cursor.com>
Testing summary (MCWP-527)Validation that RC/prod (and related) builds apply build numbers at build time and do not push Fork (
|
| Workflow | Run | Result |
|---|---|---|
| Auto RC | https://github.com/MetaMask/metamask-mobile/actions/runs/31226430507 | Success (validate → allocate → iOS + Android → TestFlight → RC PR comment → Slack) |
| Runway RC | https://github.com/MetaMask/metamask-mobile/actions/runs/31227489758 | Success (allocate → iOS + Android → TestFlight → Slack) |
Confirmed:
- iOS and Android both received the expected build number
- No bump commit on
release/0.0.0-test
Not re-run on main for this round: Create Release PR full cut (avoids burning allocator numbers / stray release branches; fork already covered the resolve/read path). Runway Production optional after RC passed — not required for this signal. Nightly already uses generate + local build_number; no change needed for this PR.
Follow-ups (under MCWP-527)
- MCWP-768 — durable build number ↔ commit SHA mapping (ops/tooling)
- MCWP-767 — surface commit SHA in-app wherever we show/attach the build number
Cleanup
Close/delete throwaway PR #34515 / release/0.0.0-test when finished; drop any temporary Auto RC -test regex if it isn’t meant to ship with this PR.
|
This is great 🥇 |
HowardBraham
left a comment
There was a problem hiding this comment.
I think I'm not understanding where the actual step is that changes the build number when we build the packages.
The apply step is in |
Avoid a separate runner for get-build-metadata.sh by reading the current build number inside create-release-pr (non-OTA only).
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
None of these changes touch app source code, test infrastructure, page objects, selectors, flows, or any user-facing functionality. No E2E test tags are warranted. Performance Test Selection: |
|



Description
Release-branch RC and production builds currently commit build number changes back to the branch before building, producing noisy
[skip ci] Bump version number to xxxxcommits that clutter release history and are unrelated to product changes.This PR removes that pattern by applying build numbers locally at build time instead of committing them:
commit-build-version.yml— the reusable workflow that committed and pushed build number bumps.runway-rc-builds.yml,runway-production-builds.yml, andbuild-rc-auto.ymlto pass the generated build number intobuild.ymlvia the existingbuild_numberinput (applied byset-build-version.shon each runner, no git commit).auto-rc-ota-build-core.ymlto forwardbuild_numbertobuild.yml.create-release-pr.ymlto read the current build number from version files instead of generating a new one via OIDC at release cut (github-tools still requires the input for mobile, but only bumps semver on the release branch).scripts/create-release-pr.shto stop callingset-build-version.shfor local/manual release cut flows.Build numbers continue to be allocated by the centralized
metamask-mobile-build-versionservice at build time and remain unique/monotonically increasing. iOS and Android builds in the same workflow run still share the same generated number.Changelog
CHANGELOG entry: null
Related issues
Fixes: MCWP-527
Manual testing steps
N/A — CI workflow changes only. Verification is via workflow runs on a release branch:
build-rc-auto.yml) by pushing to arelease/*branch with an open PR — confirm the run completes, iOS and Android artifacts are produced, and no[skip ci] Bump version number tocommit appears on the branch.workflow_dispatch— confirm builds succeed, TestFlight upload completes (RC), and no build-number bump commit is pushed.Screenshots/Recordings
N/A — CI-only change with no UI impact.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist