@@ -7,6 +7,11 @@ name: Nightly Build
77# [skip ci] commits (e.g. version bumps pushed via update-latest-build-version.yml)
88# are automatically skipped by GitHub Actions, so this workflow will NOT
99# double-trigger on those commits.
10+ #
11+ # Version strategy: exp and rc builds share the same bundle ID (MetaMask) so
12+ # TestFlight requires unique CFBundleVersion per upload. We call the external
13+ # version generator once (→ version N for exp), then locally increment to N+1
14+ # for the rc build. Both builds run in parallel after their respective bumps.
1015
1116on :
1217 push :
@@ -20,8 +25,8 @@ permissions:
2025 id-token : write
2126
2227jobs :
23- bump-version :
24- name : Bump build version
28+ bump-version-exp :
29+ name : Bump build version (exp)
2530 uses : ./.github/workflows/update-latest-build-version.yml
2631 permissions :
2732 contents : write
@@ -30,26 +35,59 @@ jobs:
3035 base-branch : ${{ github.ref_name }}
3136 secrets : inherit
3237
38+ bump-version-rc :
39+ name : Bump build version (rc)
40+ needs : [bump-version-exp]
41+ runs-on : ubuntu-latest
42+ permissions :
43+ contents : write
44+ outputs :
45+ commit-hash : ${{ steps.bump.outputs.commit-hash }}
46+ build-version : ${{ steps.bump.outputs.build-version }}
47+ steps :
48+ - uses : actions/checkout@v4
49+ with :
50+ ref : ${{ needs.bump-version-exp.outputs.commit-hash }}
51+ fetch-depth : 0
52+ token : ${{ secrets.PR_TOKEN || github.token }}
53+
54+ - name : Increment version for RC build
55+ id : bump
56+ env :
57+ EXP_VERSION : ${{ needs.bump-version-exp.outputs.build-version }}
58+ HEAD_REF : ${{ github.ref_name }}
59+ run : |
60+ RC_VERSION=$((EXP_VERSION + 1))
61+ echo "Exp version: $EXP_VERSION → RC version: $RC_VERSION"
62+ ./scripts/set-build-version.sh "$RC_VERSION"
63+ git config user.name metamaskbot
64+ git config user.email metamaskbot@users.noreply.github.com
65+ git add bitrise.yml package.json ios/MetaMask.xcodeproj/project.pbxproj android/app/build.gradle
66+ git commit -m "[skip ci] Bump version number to ${RC_VERSION} (nightly rc)"
67+ git push origin HEAD:"$HEAD_REF" --force-with-lease
68+ echo "commit-hash=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
69+ echo "build-version=$RC_VERSION" >> "$GITHUB_OUTPUT"
70+
3371 build-exp :
3472 name : Nightly exp build (main-exp)
35- needs : [bump-version]
73+ needs : [bump-version-exp ]
3674 uses : ./.github/workflows/build.yml
3775 with :
3876 build_name : main-exp
3977 platform : both
4078 skip_version_bump : true
41- ref : ${{ needs.bump-version.outputs.commit-hash }}
79+ ref : ${{ needs.bump-version-exp .outputs.commit-hash }}
4280 secrets : inherit
4381
4482 build-rc :
4583 name : Nightly RC build (main-rc)
46- needs : [bump-version]
84+ needs : [bump-version-rc ]
4785 uses : ./.github/workflows/build.yml
4886 with :
4987 build_name : main-rc
5088 platform : both
5189 skip_version_bump : true
52- ref : ${{ needs.bump-version.outputs.commit-hash }}
90+ ref : ${{ needs.bump-version-rc .outputs.commit-hash }}
5391 secrets : inherit
5492
5593 upload-exp-testflight :
0 commit comments