-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA] Callable buildAndroid workflow #49434
Merged
Merged
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
8ef859c
Remove unused VERSION environment variables
roryabraham a449e56
Save draft state
roryabraham e2d2dfb
Create and use callable buildAndroid workflow
roryabraham 281d558
Add quotes in case statement
roryabraham bb94f92
Simplify environment variable names
roryabraham b09fc11
Separate upload and submit step for Android deploys
roryabraham 5aa4d48
Add continue-on-error for artifact upload steps
roryabraham a5a8a4b
Merge branch 'main' into Rory-CallableBuild
roryabraham c165fd4
Merge branch 'main' into Rory-CallableBuild
roryabraham 019fcb2
Fix checkDeploymentSuccess job
roryabraham 6235d41
Fix needs for other jobs
roryabraham 00ffdda
Implement buildAndroid job in testBuild
roryabraham 21e2ecb
Merge branch 'main' into Rory-CallableBuild
roryabraham e4c568e
Setup dotenv for e2e and e2eDelta builds
roryabraham 87b7ca1
Add artifact-prefix input
roryabraham 5146322
Refactor e2ePerformanceTests to use callable builds
roryabraham 7e3c936
Delete now-unused buildAndroidE2EAPK composite action
roryabraham 48336e3
Use correct variable when checking if all platforms were a success
roryabraham 011e8d8
Add better comment for creating branch
roryabraham 581c2c6
Fix actionslint
roryabraham 01ed4b1
echo debug paths
roryabraham ed66629
Fix android e2eDelta lane name
roryabraham 1ec6555
Fix typo
roryabraham 25c54ac
Add back missing do
roryabraham 9cb7974
Merge branch 'main' into Rory-CallableBuild
roryabraham 45a589d
Source GITHUB_ENV before trying to access env vars set in fastlane in…
roryabraham 3cae22f
fix artifact paths
roryabraham 7b73ba5
Add missing setup-ruby step
roryabraham 5a4a734
Add missing checkout
roryabraham bedb860
Add missing env var for upload prod
roryabraham ab797cd
Fix downloaded artifact paths
roryabraham eb969cc
Remove some redundant debug logs
roryabraham feced84
Remove unnecessary artifact download step
roryabraham 50e1019
Improve grammar in step id name
roryabraham 2d78d20
Always run tests in AWS
roryabraham ff0e6ba
Disable shellcheck warning on source
roryabraham 9cd621a
Merge branch 'main' into Rory-CallableBuild
roryabraham c283f7c
Fix artifact name in e2e download-artifact
roryabraham 4097a12
Invert skip condition for building the baseline artifact
roryabraham 660020d
Remove unnecessary if statement
roryabraham 342f861
Consolidate S3 paths
roryabraham f2c9d7f
exportS3Path singular
roryabraham 9f6280a
Provide pull_request_number to AdHoc builds
roryabraham 74420b6
Make it type: string to make lint happy
roryabraham 5a4d56d
Don't access env where it's not available
roryabraham 4e452c8
Improve comment
roryabraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
102 changes: 0 additions & 102 deletions
102
.github/actions/composite/buildAndroidE2EAPK/action.yml
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
name: Build Android app | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
type: | ||
description: 'What type of build to run. Must be one of ["release", "adhoc", "e2e", "e2eDelta"]' | ||
type: string | ||
required: true | ||
ref: | ||
description: Git ref to checkout and build | ||
type: string | ||
required: true | ||
artifact-prefix: | ||
description: 'The prefix for build artifact names. This is useful if you need to call multiple builds from the same workflow' | ||
type: string | ||
required: false | ||
default: '' | ||
pull_request_number: | ||
description: The pull request number associated with this build, if relevant. | ||
type: string | ||
required: false | ||
outputs: | ||
AAB_FILE_NAME: | ||
value: ${{ jobs.build.outputs.AAB_FILE_NAME }} | ||
APK_FILE_NAME: | ||
value: ${{ jobs.build.outputs.APK_FILE_NAME }} | ||
|
||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: What type of build do you want to run? | ||
required: true | ||
type: choice | ||
options: | ||
- release | ||
- adhoc | ||
- e2e | ||
- e2eDelta | ||
ref: | ||
description: Git ref to checkout and build | ||
required: true | ||
type: string | ||
|
||
pull_request_number: | ||
description: The pull request number associated with this build, if relevant. | ||
type: number | ||
required: false | ||
|
||
jobs: | ||
build: | ||
name: Build Android app | ||
runs-on: ubuntu-latest-xl | ||
env: | ||
RUBYOPT: '-rostruct' | ||
outputs: | ||
AAB_FILE_NAME: ${{ steps.build.outputs.AAB_FILE_NAME }} | ||
APK_FILE_NAME: ${{ steps.build.outputs.APK_FILE_NAME }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Configure MapBox SDK | ||
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} | ||
|
||
- name: Setup Node | ||
uses: ./.github/actions/composite/setupNode | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: oracle | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1.190.0 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Decrypt keystore and json key | ||
run: | | ||
cd android/app | ||
gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output my-upload-key.keystore my-upload-key.keystore.gpg | ||
gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output android-fastlane-json-key.json android-fastlane-json-key.json.gpg | ||
|
||
- name: Get package version | ||
id: getPackageVersion | ||
run: echo "VERSION=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Get Android native version | ||
id: getAndroidVersion | ||
run: echo "VERSION_CODE=$(grep -o 'versionCode\s\+[0-9]\+' android/app/build.gradle | awk '{ print $2 }')" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Setup DotEnv | ||
if: ${{ inputs.type != 'release' }} | ||
run: | | ||
if [ '${{ inputs.type }}' == 'adhoc' ]; then | ||
cp .env.staging .env.adhoc | ||
sed -i 's/ENVIRONMENT=staging/ENVIRONMENT=adhoc/' .env.adhoc | ||
echo "PULL_REQUEST_NUMBER=${{ inputs.pull_request_number }}" >> .env.adhoc | ||
else | ||
envFile='' | ||
if [ '${{ inputs.type }}' == 'e2e' ]; then | ||
envFile='tests/e2e/.env.e2e' | ||
else | ||
envFile=tests/e2e/.env.e2edelta | ||
fi | ||
{ | ||
echo "EXPENSIFY_PARTNER_NAME=${{ secrets.EXPENSIFY_PARTNER_NAME }}" | ||
echo "EXPENSIFY_PARTNER_PASSWORD=${{ secrets.EXPENSIFY_PARTNER_PASSWORD }}" | ||
echo "EXPENSIFY_PARTNER_USER_ID=${{ secrets.EXPENSIFY_PARTNER_USER_ID }}" | ||
echo "EXPENSIFY_PARTNER_USER_SECRET=${{ secrets.EXPENSIFY_PARTNER_USER_SECRET }}" | ||
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${{ secrets.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}" | ||
} >> "$envFile" | ||
fi | ||
|
||
- name: Build Android app | ||
id: build | ||
run: | | ||
lane='' | ||
case '${{ inputs.type }}' in | ||
'release') | ||
lane='build';; | ||
'adhoc') | ||
lane='build_adhoc';; | ||
'e2e') | ||
lane='build_e2e';; | ||
'e2eDelta') | ||
lane='build_e2eDelta';; | ||
esac | ||
bundle exec fastlane android "$lane" | ||
|
||
# Reload environment variables from GITHUB_ENV | ||
# shellcheck disable=SC1090 | ||
source "$GITHUB_ENV" | ||
|
||
SHOULD_UPLOAD_SOURCEMAPS='false' | ||
if [ -f ./android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map ]; then | ||
SHOULD_UPLOAD_SOURCEMAPS='true' | ||
fi | ||
|
||
{ | ||
# aabPath and apkPath are environment varibles set within the Fastfile | ||
echo "AAB_PATH=$aabPath" | ||
echo "AAB_FILE_NAME=$(basename "$aabPath")" | ||
echo "APK_PATH=$apkPath" | ||
echo "APK_FILE_NAME=$(basename "$apkPath")" | ||
echo "SHOULD_UPLOAD_SOURCEMAPS=$SHOULD_UPLOAD_SOURCEMAPS" | ||
} >> "$GITHUB_OUTPUT" | ||
env: | ||
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }} | ||
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }} | ||
|
||
- name: Upload Android AAB artifact | ||
if: ${{ steps.build.outputs.AAB_PATH != '' }} | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-prefix }}android-artifact-aab | ||
path: ${{ steps.build.outputs.AAB_PATH }} | ||
|
||
- name: Upload Android APK artifact | ||
if: ${{ steps.build.outputs.APK_PATH != '' }} | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-prefix }}android-artifact-apk | ||
path: ${{ steps.build.outputs.APK_PATH }} | ||
|
||
- name: Upload Android sourcemaps artifact | ||
if: ${{ steps.build.outputs.SHOULD_UPLOAD_SOURCEMAPS == 'true' }} | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-prefix }}android-artifact-sourcemaps | ||
path: ./android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map | ||
|
||
- name: Announce failure in slack | ||
if: failure() | ||
uses: ./.github/actions/composite/announceFailedWorkflowInSlack | ||
with: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do and why is it required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained in this comment, but let me add a permanent code comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to improve the code comment, let me know what you think