-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
2,034 additions
and
1,139 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -114,6 +114,51 @@ jobs: | |
env: | ||
BROWSERSTACK: ${{ secrets.BROWSERSTACK }} | ||
|
||
submitAndroid: | ||
name: Submit Android app for production review | ||
needs: prep | ||
if: ${{ github.ref == 'refs/heads/production' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/[email protected] | ||
with: | ||
bundler-cache: true | ||
|
||
- 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: Decrypt json w/ Google Play credentials | ||
run: gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output android-fastlane-json-key.json android-fastlane-json-key.json.gpg | ||
working-directory: android/app | ||
|
||
- name: Submit Android build for review | ||
run: bundle exec fastlane android upload_google_play_production | ||
env: | ||
VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} | ||
|
||
- name: Warn deployers if Android production deploy failed | ||
if: ${{ failure() }} | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: custom | ||
custom_payload: | | ||
{ | ||
channel: '#deployer', | ||
attachments: [{ | ||
color: "#DB4545", | ||
pretext: `<!subteam^S4TJJ3PSL>`, | ||
text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the <https://play.google.com/console/u/0/developers/8765590895836334604/app/4973041797096886180/releases/overview|Google Play Store>. 💥`, | ||
}] | ||
} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
|
||
android_hybrid: | ||
name: Build and deploy Android HybridApp | ||
needs: prep | ||
|
@@ -386,6 +431,12 @@ jobs: | |
APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} | ||
APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} | ||
|
||
- name: Submit build for App Store review | ||
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} | ||
run: bundle exec fastlane ios submit_for_review | ||
env: | ||
VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }} | ||
|
||
- name: Upload iOS build to Browser Stack | ||
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} | ||
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/Users/runner/work/App/App/New Expensify.ipa" | ||
|
@@ -503,6 +554,7 @@ jobs: | |
run: | | ||
op document get --output ./OldApp_AppStore.mobileprovision OldApp_AppStore | ||
op document get --output ./OldApp_AppStore_Share_Extension.mobileprovision OldApp_AppStore_Share_Extension | ||
op document get --output ./OldApp_AppStore_Notification_Service.mobileprovision OldApp_AppStore_Notification_Service | ||
- name: Decrypt AppStore profile | ||
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore.mobileprovision NewApp_AppStore.mobileprovision.gpg | ||
|
@@ -679,7 +731,7 @@ jobs: | |
name: Post a Slack message when any platform fails to build or deploy | ||
runs-on: ubuntu-latest | ||
if: ${{ failure() }} | ||
needs: [buildAndroid, uploadAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] | ||
needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -694,15 +746,21 @@ jobs: | |
outputs: | ||
IS_AT_LEAST_ONE_PLATFORM_DEPLOYED: ${{ steps.checkDeploymentSuccessOnAtLeastOnePlatform.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED }} | ||
IS_ALL_PLATFORMS_DEPLOYED: ${{ steps.checkDeploymentSuccessOnAllPlatforms.outputs.IS_ALL_PLATFORMS_DEPLOYED }} | ||
needs: [buildAndroid, uploadAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] | ||
needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] | ||
if: ${{ always() }} | ||
steps: | ||
- name: Check deployment success on at least one platform | ||
id: checkDeploymentSuccessOnAtLeastOnePlatform | ||
run: | | ||
isAtLeastOnePlatformDeployed="false" | ||
if [ "${{ needs.uploadAndroid.result }}" == "success" ]; then | ||
isAtLeastOnePlatformDeployed="true" | ||
if [ ${{ github.ref }} == 'refs/heads/production' ]; then | ||
if [ "${{ needs.submitAndroid.result }}" == "success" ]; then | ||
isAtLeastOnePlatformDeployed="true" | ||
fi | ||
else | ||
if [ "${{ needs.uploadAndroid.result }}" == "success" ]; then | ||
isAtLeastOnePlatformDeployed="true" | ||
fi | ||
fi | ||
if [ "${{ needs.iOS.result }}" == "success" ] || \ | ||
|
@@ -727,8 +785,14 @@ jobs: | |
isAllPlatformsDeployed="true" | ||
fi | ||
if [ "${{ needs.uploadAndroid.result }}" != "success" ]; then | ||
isAllPlatformsDeployed="false" | ||
if [ ${{ github.ref }} == 'refs/heads/production' ]; then | ||
if [ "${{ needs.submitAndroid.result }}" != "success" ]; then | ||
isAllPlatformsDeployed="false" | ||
fi | ||
else | ||
if [ "${{ needs.uploadAndroid.result }}" != "success" ]; then | ||
isAllPlatformsDeployed="false" | ||
fi | ||
fi | ||
echo "IS_ALL_PLATFORMS_DEPLOYED=$isAllPlatformsDeployed" >> "$GITHUB_OUTPUT" | ||
|
@@ -876,7 +940,7 @@ jobs: | |
name: Post a Slack message when all platforms deploy successfully | ||
runs-on: ubuntu-latest | ||
if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_ALL_PLATFORMS_DEPLOYED) }} | ||
needs: [prep, buildAndroid, uploadAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web, checkDeploymentSuccess, createPrerelease, finalizeRelease] | ||
needs: [prep, buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web, checkDeploymentSuccess, createPrerelease, finalizeRelease] | ||
steps: | ||
- name: 'Announces the deploy in the #announce Slack room' | ||
uses: 8398a7/action-slack@v3 | ||
|
@@ -930,11 +994,11 @@ jobs: | |
postGithubComments: | ||
uses: ./.github/workflows/postDeployComments.yml | ||
if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} | ||
needs: [prep, buildAndroid, uploadAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web, checkDeploymentSuccess, createPrerelease, finalizeRelease] | ||
needs: [prep, buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web, checkDeploymentSuccess, createPrerelease, finalizeRelease] | ||
with: | ||
version: ${{ needs.prep.outputs.APP_VERSION }} | ||
env: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }} | ||
android: ${{ github.ref == 'refs/heads/production' && needs.uploadAndroid.result }} | ||
android: ${{ github.ref == 'refs/heads/production' && needs.submitAndroid.result || needs.uploadAndroid.result }} | ||
android_hybrid: ${{ needs.android_hybrid.result }} | ||
ios: ${{ needs.iOS.result }} | ||
ios_hybrid: ${{ needs.iOS_hybrid.result }} | ||
|
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 |
---|---|---|
|
@@ -86,7 +86,7 @@ jobs: | |
run: | ||
working-directory: Mobile-Expensify/react-native | ||
outputs: | ||
APK_FILE_NAME: ${{ steps.build.outputs.APK_FILE_NAME }} | ||
S3_APK_PATH: ${{ steps.exportAndroidS3Path.outputs.S3_APK_PATH }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -139,9 +139,6 @@ jobs: | |
bundler-cache: true | ||
working-directory: 'Mobile-Expensify/react-native' | ||
|
||
- name: Install New Expensify Gems | ||
run: bundle install | ||
|
||
- name: Install 1Password CLI | ||
uses: 1password/install-cli-action@v1 | ||
|
||
|
@@ -175,68 +172,33 @@ jobs: | |
ANDROID_UPLOAD_KEYSTORE_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} | ||
ANDROID_UPLOAD_KEYSTORE_ALIAS: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} | ||
ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }} | ||
run: | | ||
bundle exec fastlane android build_adhoc_hybrid | ||
# Refresh environment variables from GITHUB_ENV that are updated when running fastlane | ||
# shellcheck disable=SC1090 | ||
source "$GITHUB_ENV" | ||
# apkPath is set within the Fastfile | ||
echo "APK_FILE_NAME=$(basename "$apkPath")" >> "$GITHUB_OUTPUT" | ||
uploadAndroid: | ||
name: Upload Android hybrid app to S3 | ||
needs: [androidHybrid] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
S3_APK_PATH: ${{ steps.exportS3Path.outputs.S3_APK_PATH }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/[email protected] | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Download Android build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/artifacts | ||
pattern: android-*-artifact | ||
merge-multiple: true | ||
|
||
- name: Log downloaded artifact paths | ||
run: ls -R /tmp/artifacts | ||
|
||
run: bundle exec fastlane android build_adhoc_hybrid | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Upload AdHoc build to S3 | ||
- name: Upload Android AdHoc build to S3 | ||
run: bundle exec fastlane android upload_s3 | ||
env: | ||
apkPath: /tmp/artifacts/${{ needs.androidHybrid.outputs.APK_FILE_NAME }} | ||
S3_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
S3_BUCKET: ad-hoc-expensify-cash | ||
S3_REGION: us-east-1 | ||
S3_REGION: us-east-1 | ||
|
||
- name: Export S3 paths | ||
id: exportS3Path | ||
- name: Export S3 path | ||
id: exportAndroidS3Path | ||
run: | | ||
# $s3APKPath is set from within the Fastfile, android upload_s3 lane | ||
echo "S3_APK_PATH=$s3APKPath" >> "$GITHUB_OUTPUT" | ||
postGithubComment: | ||
runs-on: ubuntu-latest | ||
name: Post a GitHub comment with app download links for testing | ||
needs: [validateActor, getBranchRef, uploadAndroid] #TODO add ios job | ||
needs: [validateActor, getBranchRef, androidHybrid] | ||
if: ${{ always() }} | ||
steps: | ||
- name: Checkout | ||
|
@@ -255,5 +217,5 @@ jobs: | |
with: | ||
PR_NUMBER: ${{ env.PULL_REQUEST_NUMBER }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
ANDROID: ${{ needs.uploadAndroid.result }} | ||
ANDROID_LINK: ${{ needs.uploadAndroid.outputs.S3_APK_PATH }} | ||
ANDROID: ${{ needs.androidHybrid.result }} | ||
ANDROID_LINK: ${{ needs.androidHybrid.outputs.S3_APK_PATH }} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Oops, something went wrong.