3434jobs :
3535 build-android-apks :
3636 name : Build Android E2E APKs
37- runs-on : ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-android-build' || ' ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' }} # Optimized for lg runner (48GB) with conservative memory settings
37+ runs-on : ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-android-build' || (startsWith(github.base_ref, 'release/') && fromJSON('[" ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg"]') || fromJSON('["ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg", "low-priority"]')) }} # Optimized for lg runner (48GB) with conservative memory settings
3838 timeout-minutes : 40
3939 env :
4040 GRADLE_USER_HOME : ${{ inputs.runner_provider == 'namespace' && '/home/runner/_work/.gradle' || '/home/admin/_work/.gradle' }}
@@ -117,6 +117,13 @@ jobs:
117117 exit 1
118118 fi
119119
120+ # TEMPORARY: `${{ github.run_id }}` makes every key unique per workflow
121+ # run so we always get a fresh build during the RN 0.81 upgrade — the
122+ # `yarn fingerprint:generate` heuristic doesn't track every native input
123+ # being changed (yarn patches, MainApplication, Podfile shims, etc.) so
124+ # the branch cache can serve a stale .apk and only the JS gets repacked.
125+ # Remove the trailing `-${{ github.run_id }}` from each `key:` below
126+ # once the upgrade is settled and fingerprint covers the touched paths.
120127 - name : Restore APKs matching fingerprint from branch cache
121128 if : ${{ inputs.runner_provider != 'namespace' }}
122129 id : apk-cache-restore
@@ -132,7 +139,7 @@ jobs:
132139 # - "Restore APKs matching fingerprint from main cache"
133140 # - "Restore Gradle dependencies from branch cache"
134141 # - "Restore Gradle dependencies from main cache"
135- key : android-apk-${{ github.ref_name }}-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
142+ key : android-apk-${{ github.ref_name }}-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
136143
137144 - name : Restore APKs matching fingerprint from main cache
138145 if : ${{ inputs.runner_provider != 'namespace' && steps.apk-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
@@ -149,7 +156,7 @@ jobs:
149156 # - "Restore APKs matching fingerprint from main cache"
150157 # - "Restore Gradle dependencies from branch cache"
151158 # - "Restore Gradle dependencies from main cache"
152- key : android-apk-main-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
159+ key : android-apk-main-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
153160
154161 - name : Restore Gradle dependencies from branch cache
155162 id : gradle-cache-restore
@@ -168,7 +175,7 @@ jobs:
168175 # - "Restore APKs matching fingerprint from main cache"
169176 # - "Restore Gradle dependencies from branch cache"
170177 # - "Restore Gradle dependencies from main cache"
171- key : gradle-${{ github.ref_name }}-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
178+ key : gradle-${{ github.ref_name }}-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
172179
173180 - name : Restore Gradle dependencies from main cache
174181 # This will only restore the cache, not update it
@@ -186,7 +193,7 @@ jobs:
186193 # - "Restore APKs matching fingerprint from main cache"
187194 # - "Restore Gradle dependencies from branch cache"
188195 # - "Restore Gradle dependencies from main cache"
189- key : gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
196+ key : gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
190197
191198 - name : Build Android E2E APKs
192199 if : ${{ inputs.runner_provider == 'namespace' || (steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true') }}
@@ -208,6 +215,12 @@ jobs:
208215 NODE_OPTIONS : ' --max-old-space-size=4096'
209216 # Limit Metro workers to prevent OOM (each worker uses ~3GB)
210217 METRO_MAX_WORKERS : ' 4'
218+ # React Native 0.81's ReactAndroid/build.gradle.kts requests CMake 3.30.5
219+ # via `System.getenv("CMAKE_VERSION") ?: "3.30.5"`. The self-hosted runner
220+ # only ships CMake 3.22.1 in /opt/android-sdk/cmake/ and AGP cannot auto-
221+ # download missing components, causing CXX1300. RN's CMakeLists.txt files
222+ # only require >= 3.13, so 3.22.1 is fully sufficient.
223+ CMAKE_VERSION : ' 3.22.1'
211224 BRIDGE_USE_DEV_APIS : ' true'
212225 RAMP_INTERNAL_BUILD : ' true'
213226 SEEDLESS_ONBOARDING_ENABLED : ' true'
0 commit comments