Build and deploy apps for testing #7768
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy apps for testing | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| # If not specified, only build iOS and Android apps from the main branch of Expensify/App | |
| APP_PULL_REQUEST_URL: | |
| description: The Expensify/App pull request URL (e.g., https://github.com/Expensify/App/pull/12345). Defaults to main. | |
| required: false | |
| default: '' | |
| # Pull Request URL from Mobile-Expensify repo for correct placement of OD app. It will take precedence over MOBILE-EXPENSIFY from App's PR description if both are specified. If nothing is specified defaults to Mobile-Expensify's main | |
| MOBILE_EXPENSIFY_PULL_REQUEST_URL: | |
| description: The Expensify/Mobile-Expensify pull request URL. Defaults to main. Overrides MOBILE-EXPENSIFY set in App's PR description. | |
| required: false | |
| default: '' | |
| REVIEWED_CODE: | |
| description: I reviewed this pull request and verified that it does not contain any malicious code. | |
| type: boolean | |
| required: true | |
| default: false | |
| WEB: | |
| description: Should build web app? | |
| type: boolean | |
| default: true | |
| IOS: | |
| description: Should build iOS app? | |
| type: boolean | |
| default: true | |
| ANDROID: | |
| 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: | |
| # Validates the actor and that they reviewed the PR before any token is used or untrusted code is checked out. | |
| prep: | |
| uses: ./.github/workflows/validateBuildRequest.yml | |
| with: | |
| REVIEWED_CODE: ${{ inputs.REVIEWED_CODE }} | |
| secrets: | |
| OS_BOTIFY_COMMIT_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} | |
| # Resolves the App head ref and the Mobile-Expensify ref from the provided PR URLs (or the App PR's MOBILE-EXPENSIFY entry). | |
| # `needs: [prep]` gates this behind prep's actor validation before any token is used. | |
| resolveRefs: | |
| needs: [prep] | |
| uses: ./.github/workflows/resolveBuildRefs.yml | |
| with: | |
| APP_PULL_REQUEST_URL: ${{ inputs.APP_PULL_REQUEST_URL }} | |
| MOBILE_EXPENSIFY_PULL_REQUEST_URL: ${{ inputs.MOBILE_EXPENSIFY_PULL_REQUEST_URL }} | |
| secrets: | |
| OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} | |
| buildApps: | |
| needs: [prep, resolveRefs] | |
| uses: ./.github/workflows/buildAdHoc.yml | |
| with: | |
| # Fall back to App main when nothing is resolved (test builds default to the latest NewDot). | |
| APP_REF: ${{ needs.resolveRefs.outputs.APP_REF || 'main' }} | |
| APP_PR_NUMBER: ${{ needs.resolveRefs.outputs.APP_PR_NUMBER }} | |
| # Fall back to Mobile-Expensify main when nothing is resolved (test builds track the latest OldDot). | |
| MOBILE_EXPENSIFY_REF: ${{ needs.resolveRefs.outputs.MOBILE_EXPENSIFY_REF || 'main' }} | |
| MOBILE_EXPENSIFY_PR: ${{ needs.resolveRefs.outputs.MOBILE_EXPENSIFY_PR }} | |
| BUILD_WEB: ${{ inputs.WEB && 'true' || 'false' }} | |
| BUILD_IOS: ${{ inputs.IOS && 'true' || 'false' }} | |
| BUILD_ANDROID: ${{ inputs.ANDROID && 'true' || 'false' }} | |
| FORCE_NATIVE_BUILD: ${{ inputs.FORCE_NATIVE_BUILD && 'true' || 'false' }} | |
| secrets: inherit |