From e0e93fb79ad231a88e366eb0375de6afd91e75cb Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 19 Feb 2026 15:29:10 -0800 Subject: [PATCH] Add setup-gradle to ad-hoc builds and force native build option Cache Gradle dependencies in the androidHybrid job to reduce build time variance caused by repeated Maven dependency resolution (~11 min avg). Also add a FORCE_NATIVE_BUILD checkbox to testBuild.yml that bypasses the Rock remote cache by injecting a unique run ID into the native fingerprint, forcing a full native build on both Android and iOS. Co-authored-by: Cursor --- .github/workflows/buildAdHoc.yml | 10 ++++++++++ .github/workflows/testBuild.yml | 5 +++++ rock.config.mjs | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildAdHoc.yml b/.github/workflows/buildAdHoc.yml index 9fd322c10a9ab..91f36c5460660 100644 --- a/.github/workflows/buildAdHoc.yml +++ b/.github/workflows/buildAdHoc.yml @@ -35,6 +35,10 @@ on: description: GitHub username who triggered the build type: string required: true + FORCE_NATIVE_BUILD: + description: Force a full native build, bypassing Rock remote cache + type: string + default: 'false' jobs: postGitHubCommentBuildStarted: @@ -153,6 +157,10 @@ jobs: with: IS_HYBRID_BUILD: 'true' + - name: Setup Gradle + # v4 + uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 + - name: Run grunt build run: | cd Mobile-Expensify @@ -209,6 +217,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} IS_HYBRID_APP: true + FORCE_NATIVE_BUILD: ${{ inputs.FORCE_NATIVE_BUILD == 'true' && github.run_id || '' }} with: variant: 'Adhoc' sign: true @@ -341,6 +350,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} IS_HYBRID_APP: true + FORCE_NATIVE_BUILD: ${{ inputs.FORCE_NATIVE_BUILD == 'true' && github.run_id || '' }} with: destination: device re-sign: true diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index ba03181ff3d15..7d0db6f4dee08 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -30,6 +30,10 @@ on: description: Should build android app? type: boolean default: true + FORCE_NATIVE_BUILD: + description: Force a full native build, bypassing Rock remote cache + type: boolean + default: false jobs: prep: @@ -158,4 +162,5 @@ jobs: BUILD_IOS: ${{ inputs.IOS && 'true' || 'false' }} BUILD_ANDROID: ${{ inputs.ANDROID && 'true' || 'false' }} TRIGGER_ACTOR: ${{ github.actor }} + FORCE_NATIVE_BUILD: ${{ inputs.FORCE_NATIVE_BUILD && 'true' || 'false' }} secrets: inherit diff --git a/rock.config.mjs b/rock.config.mjs index da68428100dd1..3bfe70bca2180 100644 --- a/rock.config.mjs +++ b/rock.config.mjs @@ -22,7 +22,7 @@ export default { android: platformAndroid({sourceDir: isHybrid ? './Mobile-Expensify/Android' : './android'}), }, fingerprint: { - env: ['USE_WEB_PROXY', 'PUSHER_DEV_SUFFIX', 'SECURE_NGROK_URL', 'NGROK_URL', 'USE_NGROK'], + env: ['USE_WEB_PROXY', 'PUSHER_DEV_SUFFIX', 'SECURE_NGROK_URL', 'NGROK_URL', 'USE_NGROK', 'FORCE_NATIVE_BUILD'], ignorePaths: ['Mobile-Expensify/Android/assets/app/shared/bundle.js'], }, // Forces React Native to build from source to include our custom patches