From 2416af5a94496559c3c9c25aaedf8ae9300dc20d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 14:26:05 -0600 Subject: [PATCH 01/12] Remove fetch depth 0 for hybrid app builds --- .github/workflows/deploy.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 59f41bd12526..aab0a6218171 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy code to staging or production on: push: - branches: [staging, production] + branches: [staging, production, andrew-fetch-depth2] env: SHOULD_DEPLOY_PRODUCTION: ${{ github.ref == 'refs/heads/production' }} @@ -182,14 +182,13 @@ jobs: submodules: true path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} - fetch-depth: 0 - name: Update submodule run: | git submodule update --init # Update submodule to latest on staging - git fetch - git checkout staging + git fetch --depth=1 origin staging + git checkout -b staging origin/staging - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -482,14 +481,13 @@ jobs: submodules: true path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} - fetch-depth: 0 - name: Update submodule run: | git submodule update --init # Update submodule to latest on staging - git fetch - git checkout staging + git fetch --depth=1 origin staging + git checkout -b staging origin/staging - name: Configure MapBox SDK run: | From 3d00a75bf832b142b047d018906324e2b1fc2cb5 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 14:28:43 -0600 Subject: [PATCH 02/12] Comment out code to test --- .github/workflows/deploy.yml | 1246 +++++++++++++++++----------------- 1 file changed, 623 insertions(+), 623 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aab0a6218171..4c1b5df55443 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -53,115 +53,115 @@ jobs: id: getAppVersion run: echo "VERSION=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT" - - name: Create and push tag - if: ${{ github.ref == 'refs/heads/staging' }} - run: | - git tag ${{ steps.getAppVersion.outputs.VERSION }} - git push origin --tags - - # Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform - deployChecklist: - name: Create or update deploy checklist - uses: ./.github/workflows/createDeployChecklist.yml - if: ${{ github.ref == 'refs/heads/staging' }} - needs: prep - secrets: inherit - - buildAndroid: - name: Build Android app - uses: ./.github/workflows/buildAndroid.yml - if: ${{ github.ref == 'refs/heads/staging' }} - needs: prep - secrets: inherit - with: - type: release - ref: staging - - uploadAndroid: - name: Upload Android build to Google Play Store - needs: buildAndroid - runs-on: ubuntu-latest - env: - RUBYOPT: '-rostruct' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1.190.0 - 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 - - - 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: Upload Android app to Google Play - run: bundle exec fastlane android upload_google_play_internal - env: - aabPath: /tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }} - - - name: Upload Android build to Browser Stack - run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }}" - env: - BROWSERSTACK: ${{ secrets.BROWSERSTACK }} - - submitAndroid: - name: Submit Android app for production review - needs: prep - if: ${{ github.ref == 'refs/heads/production' }} - runs-on: ubuntu-latest - env: - RUBYOPT: '-rostruct' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1.190.0 - 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: ``, - text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# - name: Create and push tag +# if: ${{ github.ref == 'refs/heads/staging' }} +# run: | +# git tag ${{ steps.getAppVersion.outputs.VERSION }} +# git push origin --tags + +# # Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform +# deployChecklist: +# name: Create or update deploy checklist +# uses: ./.github/workflows/createDeployChecklist.yml +# if: ${{ github.ref == 'refs/heads/staging' }} +# needs: prep +# secrets: inherit +# +# buildAndroid: +# name: Build Android app +# uses: ./.github/workflows/buildAndroid.yml +# if: ${{ github.ref == 'refs/heads/staging' }} +# needs: prep +# secrets: inherit +# with: +# type: release +# ref: staging +# +# uploadAndroid: +# name: Upload Android build to Google Play Store +# needs: buildAndroid +# runs-on: ubuntu-latest +# env: +# RUBYOPT: '-rostruct' +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Setup Ruby +# uses: ruby/setup-ruby@v1.190.0 +# 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 +# +# - 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: Upload Android app to Google Play +# run: bundle exec fastlane android upload_google_play_internal +# env: +# aabPath: /tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }} +# +# - name: Upload Android build to Browser Stack +# run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }}" +# env: +# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} +# +# submitAndroid: +# name: Submit Android app for production review +# needs: prep +# if: ${{ github.ref == 'refs/heads/production' }} +# runs-on: ubuntu-latest +# env: +# RUBYOPT: '-rostruct' +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Setup Ruby +# uses: ruby/setup-ruby@v1.190.0 +# 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: ``, +# text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} android_hybrid: name: Build and deploy Android HybridApp @@ -296,171 +296,171 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - desktop: - name: Build and deploy Desktop - needs: prep - runs-on: macos-14-large - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node - uses: ./.github/actions/composite/setupNode - - - name: Decrypt Developer ID Certificate - run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg - env: - DEVELOPER_ID_SECRET_PASSPHRASE: ${{ secrets.DEVELOPER_ID_SECRET_PASSPHRASE }} - - - name: Build desktop app - run: | - if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then - npm run desktop-build - else - npm run desktop-build-staging - fi - env: - CSC_LINK: ${{ secrets.CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }} - - - name: Upload desktop sourcemaps artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-sourcemaps-artifact' || 'desktop-staging-sourcemaps-artifact' }} - path: ./desktop/dist/www/merged-source-map.js.map - - - name: Upload desktop build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-build-artifact' || 'desktop-staging-build-artifact' }} - path: ./desktop-build/NewExpensify.dmg - - iOS: - name: Build and deploy iOS - needs: prep - env: - DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer - runs-on: macos-13-xlarge - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure MapBox SDK - run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} - - - name: Setup Node - id: setup-node - uses: ./.github/actions/composite/setupNode - - - name: Setup Ruby - uses: ruby/setup-ruby@v1.190.0 - with: - bundler-cache: true - - - name: Cache Pod dependencies - uses: actions/cache@v4 - id: pods-cache - with: - path: ios/Pods - key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }} - - - name: Compare Podfile.lock and Manifest.lock - id: compare-podfile-and-manifest - run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT" - - - name: Install cocoapods - uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 - if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true' - with: - timeout_minutes: 10 - max_attempts: 5 - command: scripts/pod-install.sh - - - name: Decrypt AppStore profile - run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore.mobileprovision NewApp_AppStore.mobileprovision.gpg - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - - name: Decrypt AppStore Notification Service profile - run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore_Notification_Service.mobileprovision NewApp_AppStore_Notification_Service.mobileprovision.gpg - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - - name: Decrypt certificate - run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - - name: Decrypt App Store Connect API key - run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output ios-fastlane-json-key.json ios-fastlane-json-key.json.gpg - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - - name: Get iOS native version - id: getIOSVersion - run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_OUTPUT" - - - name: Build iOS release app - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: bundle exec fastlane ios build - - - name: Upload release build to TestFlight - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: bundle exec fastlane ios upload_testflight - env: - APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} - APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} - 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" - env: - BROWSERSTACK: ${{ secrets.BROWSERSTACK }} - - - name: Upload iOS sourcemaps artifact - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: actions/upload-artifact@v4 - with: - name: ios-sourcemaps-artifact - path: ./main.jsbundle.map - - - name: Upload iOS build artifact - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: actions/upload-artifact@v4 - with: - name: ios-build-artifact - path: /Users/runner/work/App/App/New\ Expensify.ipa - - - name: Warn deployers if iOS production deploy failed - if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: "#DB4545", - pretext: ``, - text: `💥 iOS production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# desktop: +# name: Build and deploy Desktop +# needs: prep +# runs-on: macos-14-large +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Setup Node +# uses: ./.github/actions/composite/setupNode +# +# - name: Decrypt Developer ID Certificate +# run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg +# env: +# DEVELOPER_ID_SECRET_PASSPHRASE: ${{ secrets.DEVELOPER_ID_SECRET_PASSPHRASE }} +# +# - name: Build desktop app +# run: | +# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then +# npm run desktop-build +# else +# npm run desktop-build-staging +# fi +# env: +# CSC_LINK: ${{ secrets.CSC_LINK }} +# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} +# APPLE_ID: ${{ secrets.APPLE_ID }} +# APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }} +# +# - name: Upload desktop sourcemaps artifact +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-sourcemaps-artifact' || 'desktop-staging-sourcemaps-artifact' }} +# path: ./desktop/dist/www/merged-source-map.js.map +# +# - name: Upload desktop build artifact +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-build-artifact' || 'desktop-staging-build-artifact' }} +# path: ./desktop-build/NewExpensify.dmg +# +# iOS: +# name: Build and deploy iOS +# needs: prep +# env: +# DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer +# runs-on: macos-13-xlarge +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Configure MapBox SDK +# run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} +# +# - name: Setup Node +# id: setup-node +# uses: ./.github/actions/composite/setupNode +# +# - name: Setup Ruby +# uses: ruby/setup-ruby@v1.190.0 +# with: +# bundler-cache: true +# +# - name: Cache Pod dependencies +# uses: actions/cache@v4 +# id: pods-cache +# with: +# path: ios/Pods +# key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }} +# +# - name: Compare Podfile.lock and Manifest.lock +# id: compare-podfile-and-manifest +# run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT" +# +# - name: Install cocoapods +# uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 +# if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true' +# with: +# timeout_minutes: 10 +# max_attempts: 5 +# command: scripts/pod-install.sh +# +# - name: Decrypt AppStore profile +# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore.mobileprovision NewApp_AppStore.mobileprovision.gpg +# env: +# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} +# +# - name: Decrypt AppStore Notification Service profile +# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore_Notification_Service.mobileprovision NewApp_AppStore_Notification_Service.mobileprovision.gpg +# env: +# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} +# +# - name: Decrypt certificate +# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg +# env: +# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} +# +# - name: Decrypt App Store Connect API key +# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output ios-fastlane-json-key.json ios-fastlane-json-key.json.gpg +# env: +# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} +# +# - name: Get iOS native version +# id: getIOSVersion +# run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_OUTPUT" +# +# - name: Build iOS release app +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# run: bundle exec fastlane ios build +# +# - name: Upload release build to TestFlight +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# run: bundle exec fastlane ios upload_testflight +# env: +# APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} +# APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} +# 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" +# env: +# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} +# +# - name: Upload iOS sourcemaps artifact +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: actions/upload-artifact@v4 +# with: +# name: ios-sourcemaps-artifact +# path: ./main.jsbundle.map +# +# - name: Upload iOS build artifact +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: actions/upload-artifact@v4 +# with: +# name: ios-build-artifact +# path: /Users/runner/work/App/App/New\ Expensify.ipa +# +# - name: Warn deployers if iOS production deploy failed +# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: "#DB4545", +# pretext: ``, +# text: `💥 iOS production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} iOS_hybrid: name: Build and deploy iOS HybridApp @@ -613,352 +613,352 @@ jobs: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - web: - name: Build and deploy Web - needs: prep - runs-on: ubuntu-latest-xl - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node - uses: ./.github/actions/composite/setupNode - - - name: Setup Cloudflare CLI - run: pip3 install cloudflare==2.19.0 - - - 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: Build web - run: | - if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then - npm run build - else - npm run build-staging - fi - - - name: Build storybook docs - continue-on-error: true - run: | - if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then - npm run storybook-build - else - npm run storybook-build-staging - fi - - - name: Deploy to S3 - run: | - aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist ${{ env.S3_URL }}/ - aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{ env.S3_URL }}/.well-known/apple-app-site-association - aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{env.S3_URL }}/apple-app-site-association - env: - S3_URL: s3://${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging-' || '' }}expensify-cash - - - name: Purge Cloudflare cache - run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging.' || '' }}new.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache - env: - CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }} - - - name: Verify staging deploy - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: ./.github/scripts/verifyDeploy.sh staging ${{ needs.prep.outputs.APP_VERSION }} - - - name: Verify production deploy - if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: ./.github/scripts/verifyDeploy.sh production ${{ needs.prep.outputs.APP_VERSION }} - - - name: Upload web sourcemaps artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-sourcemaps-artifact - path: ./dist/merged-source-map.js.map - - - name: Compress web build .tar.gz and .zip - run: | - tar -czvf webBuild.tar.gz dist - zip -r webBuild.zip dist - - - name: Upload .tar.gz web build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-tar-gz-artifact - path: ./webBuild.tar.gz - - - name: Upload .zip web build artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-zip-artifact - path: ./webBuild.zip - - postSlackMessageOnFailure: - name: Post a Slack message when any platform fails to build or deploy - runs-on: ubuntu-latest - if: ${{ failure() }} - needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Post Slack message on failure - uses: ./.github/actions/composite/announceFailedWorkflowInSlack - with: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - checkDeploymentSuccess: - runs-on: ubuntu-latest - 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, 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 [ ${{ 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" ] || \ - [ "${{ needs.iOS_hybrid.result }}" == "success" ] || \ - [ "${{ needs.android_hybrid.result }}" == "success" ] || \ - [ "${{ needs.desktop.result }}" == "success" ] || \ - [ "${{ needs.web.result }}" == "success" ]; then - isAtLeastOnePlatformDeployed="true" - fi - echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED=$isAtLeastOnePlatformDeployed" >> "$GITHUB_OUTPUT" - echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED is $isAtLeastOnePlatformDeployed" - - - name: Check deployment success on all platforms - id: checkDeploymentSuccessOnAllPlatforms - run: | - isAllPlatformsDeployed="false" - if [ "${{ needs.iOS.result }}" == "success" ] && \ - [ "${{ needs.iOS_hybrid.result }}" == "success" ] && \ - [ "${{ needs.android_hybrid.result }}" == "success" ] && \ - [ "${{ needs.desktop.result }}" == "success" ] && \ - [ "${{ needs.web.result }}" == "success" ]; then - isAllPlatformsDeployed="true" - fi - - 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" - echo "IS_ALL_PLATFORMS_DEPLOYED is $isAllPlatformsDeployed" - - createPrerelease: - runs-on: ubuntu-latest - if: ${{ always() && github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} - needs: [prep, checkDeploymentSuccess] - steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 - - - name: 🚀 Create prerelease 🚀 - run: | - gh release create ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --title ${{ needs.prep.outputs.APP_VERSION }} --generate-notes --prerelease --target staging - RETRIES=0 - MAX_RETRIES=10 - until [[ $(gh release view ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }}) || $RETRIES -ge $MAX_RETRIES ]]; do - echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times" - sleep 1 - done - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name - continue-on-error: true - run: | - mv ./desktop-staging-sourcemaps-artifact/merged-source-map.js.map ./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map - mv ./web-staging-sourcemaps-artifact/merged-source-map.js.map ./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map - - - name: Upload artifacts to GitHub Release - continue-on-error: true - run: | - # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] - files=( - "./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map" - "./android-aab-artifact/app-production-release.aab#android.aab" - "./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab" - "./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map" - "./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg" - "./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map" - "./ios-build-artifact/New Expensify.ipa#ios.ipa" - "./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa" - "./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map" - "./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz" - "./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip" - ) - - # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) - for file_entry in "${files[@]}"; do - gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" - done - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Warn deployers if staging deploy failed - if: ${{ failure() }} - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: "#DB4545", - pretext: ``, - text: `💥 NewDot staging deploy failed. 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - finalizeRelease: - runs-on: ubuntu-latest - if: ${{ always() && github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} - needs: [prep, checkDeploymentSuccess] - steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 - - - name: 🚀 Edit the release to be no longer a prerelease 🚀 - run: | - LATEST_RELEASE="$(gh release list --repo ${{ github.repository }} --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')" - gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ needs.prep.outputs.APP_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md - gh release edit ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --prerelease=false --latest --notes-file releaseNotes.md - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name - continue-on-error: true - run: | - mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map - mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map - - - name: Upload artifacts to GitHub Release - continue-on-error: true - run: | - # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] - files=( - "./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map" - "./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg" - "./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map" - "./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz" - "./web-build-zip-artifact/webBuild.zip#web-production.zip" - ) - - # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) - for file_entry in "${files[@]}"; do - gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" - done - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Warn deployers if production deploy failed - if: ${{ failure() }} - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: "#DB4545", - pretext: ``, - text: `💥 NewDot production deploy failed. 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - postSlackMessageOnSuccess: - 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, 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 - with: - status: custom - custom_payload: | - { - channel: '#announce', - attachments: [{ - color: 'good', - text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - - name: 'Announces the deploy in the #deployer Slack room' - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: 'good', - text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - - name: 'Announces a production deploy in the #expensify-open-source Slack room' - uses: 8398a7/action-slack@v3 - if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - with: - status: custom - custom_payload: | - { - channel: '#expensify-open-source', - attachments: [{ - color: 'good', - text: `🎉️ Successfully deployed ${process.env.AS_REPO} to production 🎉️`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - postGithubComments: - uses: ./.github/workflows/postDeployComments.yml - if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} - 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.submitAndroid.result || needs.uploadAndroid.result }} - android_hybrid: ${{ needs.android_hybrid.result }} - ios: ${{ needs.iOS.result }} - ios_hybrid: ${{ needs.iOS_hybrid.result }} - web: ${{ needs.web.result }} - desktop: ${{ needs.desktop.result }} +# web: +# name: Build and deploy Web +# needs: prep +# runs-on: ubuntu-latest-xl +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Setup Node +# uses: ./.github/actions/composite/setupNode +# +# - name: Setup Cloudflare CLI +# run: pip3 install cloudflare==2.19.0 +# +# - 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: Build web +# run: | +# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then +# npm run build +# else +# npm run build-staging +# fi +# +# - name: Build storybook docs +# continue-on-error: true +# run: | +# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then +# npm run storybook-build +# else +# npm run storybook-build-staging +# fi +# +# - name: Deploy to S3 +# run: | +# aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist ${{ env.S3_URL }}/ +# aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{ env.S3_URL }}/.well-known/apple-app-site-association +# aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{env.S3_URL }}/apple-app-site-association +# env: +# S3_URL: s3://${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging-' || '' }}expensify-cash +# +# - name: Purge Cloudflare cache +# run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging.' || '' }}new.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache +# env: +# CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }} +# +# - name: Verify staging deploy +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# run: ./.github/scripts/verifyDeploy.sh staging ${{ needs.prep.outputs.APP_VERSION }} +# +# - name: Verify production deploy +# if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# run: ./.github/scripts/verifyDeploy.sh production ${{ needs.prep.outputs.APP_VERSION }} +# +# - name: Upload web sourcemaps artifact +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-sourcemaps-artifact +# path: ./dist/merged-source-map.js.map +# +# - name: Compress web build .tar.gz and .zip +# run: | +# tar -czvf webBuild.tar.gz dist +# zip -r webBuild.zip dist +# +# - name: Upload .tar.gz web build artifact +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-tar-gz-artifact +# path: ./webBuild.tar.gz +# +# - name: Upload .zip web build artifact +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-zip-artifact +# path: ./webBuild.zip +# +# postSlackMessageOnFailure: +# name: Post a Slack message when any platform fails to build or deploy +# runs-on: ubuntu-latest +# if: ${{ failure() }} +# needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Post Slack message on failure +# uses: ./.github/actions/composite/announceFailedWorkflowInSlack +# with: +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# +# checkDeploymentSuccess: +# runs-on: ubuntu-latest +# 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, 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 [ ${{ 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" ] || \ +# [ "${{ needs.iOS_hybrid.result }}" == "success" ] || \ +# [ "${{ needs.android_hybrid.result }}" == "success" ] || \ +# [ "${{ needs.desktop.result }}" == "success" ] || \ +# [ "${{ needs.web.result }}" == "success" ]; then +# isAtLeastOnePlatformDeployed="true" +# fi +# echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED=$isAtLeastOnePlatformDeployed" >> "$GITHUB_OUTPUT" +# echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED is $isAtLeastOnePlatformDeployed" +# +# - name: Check deployment success on all platforms +# id: checkDeploymentSuccessOnAllPlatforms +# run: | +# isAllPlatformsDeployed="false" +# if [ "${{ needs.iOS.result }}" == "success" ] && \ +# [ "${{ needs.iOS_hybrid.result }}" == "success" ] && \ +# [ "${{ needs.android_hybrid.result }}" == "success" ] && \ +# [ "${{ needs.desktop.result }}" == "success" ] && \ +# [ "${{ needs.web.result }}" == "success" ]; then +# isAllPlatformsDeployed="true" +# fi +# +# 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" +# echo "IS_ALL_PLATFORMS_DEPLOYED is $isAllPlatformsDeployed" +# +# createPrerelease: +# runs-on: ubuntu-latest +# if: ${{ always() && github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} +# needs: [prep, checkDeploymentSuccess] +# steps: +# - name: Download all workflow run artifacts +# uses: actions/download-artifact@v4 +# +# - name: 🚀 Create prerelease 🚀 +# run: | +# gh release create ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --title ${{ needs.prep.outputs.APP_VERSION }} --generate-notes --prerelease --target staging +# RETRIES=0 +# MAX_RETRIES=10 +# until [[ $(gh release view ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }}) || $RETRIES -ge $MAX_RETRIES ]]; do +# echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times" +# sleep 1 +# done +# env: +# GITHUB_TOKEN: ${{ github.token }} +# +# - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name +# continue-on-error: true +# run: | +# mv ./desktop-staging-sourcemaps-artifact/merged-source-map.js.map ./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map +# mv ./web-staging-sourcemaps-artifact/merged-source-map.js.map ./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map +# +# - name: Upload artifacts to GitHub Release +# continue-on-error: true +# run: | +# # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] +# files=( +# "./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map" +# "./android-aab-artifact/app-production-release.aab#android.aab" +# "./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab" +# "./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map" +# "./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg" +# "./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map" +# "./ios-build-artifact/New Expensify.ipa#ios.ipa" +# "./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa" +# "./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map" +# "./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz" +# "./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip" +# ) +# +# # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) +# for file_entry in "${files[@]}"; do +# gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" +# done +# env: +# GITHUB_TOKEN: ${{ github.token }} +# +# - name: Warn deployers if staging deploy failed +# if: ${{ failure() }} +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: "#DB4545", +# pretext: ``, +# text: `💥 NewDot staging deploy failed. 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# +# finalizeRelease: +# runs-on: ubuntu-latest +# if: ${{ always() && github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} +# needs: [prep, checkDeploymentSuccess] +# steps: +# - name: Download all workflow run artifacts +# uses: actions/download-artifact@v4 +# +# - name: 🚀 Edit the release to be no longer a prerelease 🚀 +# run: | +# LATEST_RELEASE="$(gh release list --repo ${{ github.repository }} --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')" +# gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ needs.prep.outputs.APP_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md +# gh release edit ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --prerelease=false --latest --notes-file releaseNotes.md +# env: +# GITHUB_TOKEN: ${{ github.token }} +# +# - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name +# continue-on-error: true +# run: | +# mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map +# mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map +# +# - name: Upload artifacts to GitHub Release +# continue-on-error: true +# run: | +# # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] +# files=( +# "./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map" +# "./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg" +# "./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map" +# "./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz" +# "./web-build-zip-artifact/webBuild.zip#web-production.zip" +# ) +# +# # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) +# for file_entry in "${files[@]}"; do +# gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" +# done +# env: +# GITHUB_TOKEN: ${{ github.token }} +# +# - name: Warn deployers if production deploy failed +# if: ${{ failure() }} +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: "#DB4545", +# pretext: ``, +# text: `💥 NewDot production deploy failed. 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# +# postSlackMessageOnSuccess: +# 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, 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 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#announce', +# attachments: [{ +# color: 'good', +# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# +# - name: 'Announces the deploy in the #deployer Slack room' +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: 'good', +# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# +# - name: 'Announces a production deploy in the #expensify-open-source Slack room' +# uses: 8398a7/action-slack@v3 +# if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# with: +# status: custom +# custom_payload: | +# { +# channel: '#expensify-open-source', +# attachments: [{ +# color: 'good', +# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to production 🎉️`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# +# postGithubComments: +# uses: ./.github/workflows/postDeployComments.yml +# if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} +# 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.submitAndroid.result || needs.uploadAndroid.result }} +# android_hybrid: ${{ needs.android_hybrid.result }} +# ios: ${{ needs.iOS.result }} +# ios_hybrid: ${{ needs.iOS_hybrid.result }} +# web: ${{ needs.web.result }} +# desktop: ${{ needs.desktop.result }} From a0b51126cd456d940599d44b8e8f0af5114f2038 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 14:29:57 -0600 Subject: [PATCH 03/12] One more comment to test code --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4c1b5df55443..53e6bd5838aa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -168,7 +168,7 @@ jobs: needs: prep runs-on: ubuntu-latest-xl # Only deploy HybridApp to staging - if: ${{ github.ref == 'refs/heads/staging' }} +# if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native @@ -469,7 +469,7 @@ jobs: env: DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer # Only deploy HybridApp to staging - if: ${{ github.ref == 'refs/heads/staging' }} +# if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native From 6e75c6701481e944885f56a7696b5e61022aedd1 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 14:31:41 -0600 Subject: [PATCH 04/12] Tweak the checkout --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 53e6bd5838aa..ff1bbcf55578 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -188,7 +188,7 @@ jobs: git submodule update --init # Update submodule to latest on staging git fetch --depth=1 origin staging - git checkout -b staging origin/staging + git checkout staging - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -487,7 +487,7 @@ jobs: git submodule update --init # Update submodule to latest on staging git fetch --depth=1 origin staging - git checkout -b staging origin/staging + git checkout staging - name: Configure MapBox SDK run: | From 3bf0ca3f66a7d1f43db220336cbaf3593f968f12 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 14:36:49 -0600 Subject: [PATCH 05/12] Fix paths --- .github/workflows/deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ff1bbcf55578..3106526bce87 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -185,7 +185,9 @@ jobs: - name: Update submodule run: | + cd .. git submodule update --init + cd react-native # Update submodule to latest on staging git fetch --depth=1 origin staging git checkout staging @@ -484,7 +486,9 @@ jobs: - name: Update submodule run: | + cd .. git submodule update --init + cd react-native # Update submodule to latest on staging git fetch --depth=1 origin staging git checkout staging From 087c7c96fc779338ab8baf407ccc650575a1861a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 15:21:10 -0600 Subject: [PATCH 06/12] Try a different fetch --- .github/workflows/deploy.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3106526bce87..0dee49f70b08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -183,11 +183,11 @@ jobs: path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} - - name: Update submodule + - name: Update submodule to staging run: | - cd .. - git submodule update --init - cd react-native + # Adjust fetch configuration to ensure all branches are fetched + git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + # Update submodule to latest on staging git fetch --depth=1 origin staging git checkout staging @@ -484,11 +484,11 @@ jobs: path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} - - name: Update submodule + - name: Update submodule to staging run: | - cd .. - git submodule update --init - cd react-native + # Adjust fetch configuration to ensure all branches are fetched + git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + # Update submodule to latest on staging git fetch --depth=1 origin staging git checkout staging From 038b19254bba5c2665b1eaafe53b20131cfd17ab Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 15:25:14 -0600 Subject: [PATCH 07/12] Tweak checkout and fetch --- .github/workflows/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0dee49f70b08..f19cddda7a7b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -189,8 +189,8 @@ jobs: git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" # Update submodule to latest on staging - git fetch --depth=1 origin staging - git checkout staging + git fetch + git checkout -b staging origin/staging - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -490,8 +490,8 @@ jobs: git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" # Update submodule to latest on staging - git fetch --depth=1 origin staging - git checkout staging + git fetch + git checkout -b staging origin/staging - name: Configure MapBox SDK run: | From 82547b86732b2ed6a59f09353301b4cf75cf84b7 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 31 Oct 2024 15:38:30 -0600 Subject: [PATCH 08/12] Build iOS and Android to look for source maps --- .github/workflows/deploy.yml | 174 ++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 84 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f19cddda7a7b..e5ae04c61a98 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -182,15 +182,15 @@ jobs: submodules: true path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} + # fetch-depth: 0 is required in order to fetch the correct submodule branch + fetch-depth: 0 - - name: Update submodule to staging + - name: Update submodule run: | - # Adjust fetch configuration to ensure all branches are fetched - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - + git submodule update --init # Update submodule to latest on staging git fetch - git checkout -b staging origin/staging + git checkout staging - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -259,44 +259,47 @@ jobs: ANDROID_UPLOAD_KEYSTORE_ALIAS: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }} - - name: Upload Android app to Google Play - run: bundle exec fastlane android upload_google_play_internal_hybrid - env: - VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} - - - name: Upload Android 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=@${{ env.aabPath }}" - env: - BROWSERSTACK: ${{ secrets.BROWSERSTACK }} - - - name: Upload Android build artifact - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: actions/upload-artifact@v4 - with: - name: android-hybrid-build-artifact - path: ${{ env.aabPath }} - - - name: Set current App version in Env - run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" + - name: Debug paths + run: ls -laR . - - name: Warn deployers if Android production deploy failed - if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: "#DB4545", - pretext: ``, - text: `💥 Android HybridApp production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# - name: Upload Android app to Google Play +# run: bundle exec fastlane android upload_google_play_internal_hybrid +# env: +# VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} +# +# - name: Upload Android 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=@${{ env.aabPath }}" +# env: +# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} +# +# - name: Upload Android build artifact +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: actions/upload-artifact@v4 +# with: +# name: android-hybrid-build-artifact +# path: ${{ env.aabPath }} +# +# - name: Set current App version in Env +# run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" +# +# - name: Warn deployers if Android production deploy failed +# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: "#DB4545", +# pretext: ``, +# text: `💥 Android HybridApp production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # desktop: # name: Build and deploy Desktop @@ -483,15 +486,15 @@ jobs: submodules: true path: 'Mobile-Expensify' token: ${{ secrets.OS_BOTIFY_TOKEN }} + # fetch-depth: 0 is required in order to fetch the correct submodule branch + fetch-depth: 0 - - name: Update submodule to staging + - name: Update submodule run: | - # Adjust fetch configuration to ensure all branches are fetched - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - + git submodule update --init # Update submodule to latest on staging git fetch - git checkout -b staging origin/staging + git checkout staging - name: Configure MapBox SDK run: | @@ -577,45 +580,48 @@ jobs: if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} run: bundle exec fastlane ios build_hybrid - - name: Upload release build to TestFlight - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: bundle exec fastlane ios upload_testflight_hybrid - env: - APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} - APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} - APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} - APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} - - - 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=@${{ env.ipaPath }}" - env: - BROWSERSTACK: ${{ secrets.BROWSERSTACK }} + - name: Debug paths + run: ls -laR . - - name: Upload iOS build artifact - if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: actions/upload-artifact@v4 - with: - name: ios-hybrid-build-artifact - path: ${{ env.ipaPath }} +# - name: Upload release build to TestFlight +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# run: bundle exec fastlane ios upload_testflight_hybrid +# env: +# APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} +# APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} +# APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} +# APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} +# +# - 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=@${{ env.ipaPath }}" +# env: +# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} +# +# - name: Upload iOS build artifact +# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: actions/upload-artifact@v4 +# with: +# name: ios-hybrid-build-artifact +# path: ${{ env.ipaPath }} - - name: Warn deployers if iOS production deploy failed - if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - uses: 8398a7/action-slack@v3 - with: - status: custom - custom_payload: | - { - channel: '#deployer', - attachments: [{ - color: "#DB4545", - pretext: ``, - text: `💥 iOS HybridApp production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, - }] - } - env: - GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} +# - name: Warn deployers if iOS production deploy failed +# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} +# uses: 8398a7/action-slack@v3 +# with: +# status: custom +# custom_payload: | +# { +# channel: '#deployer', +# attachments: [{ +# color: "#DB4545", +# pretext: ``, +# text: `💥 iOS HybridApp production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, +# }] +# } +# env: +# GITHUB_TOKEN: ${{ github.token }} +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # web: # name: Build and deploy Web From a76e5459404958158e9033543756502c8ab18783 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 4 Nov 2024 09:58:13 -0700 Subject: [PATCH 09/12] Debug path above --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e5ae04c61a98..7a2c66b11218 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -260,7 +260,7 @@ jobs: ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }} - name: Debug paths - run: ls -laR . + run: ls -laR ../ # - name: Upload Android app to Google Play # run: bundle exec fastlane android upload_google_play_internal_hybrid @@ -581,7 +581,7 @@ jobs: run: bundle exec fastlane ios build_hybrid - name: Debug paths - run: ls -laR . + run: ls -laR ../ # - name: Upload release build to TestFlight # if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} From a32b86650486b068729fb5f7e286b5dee318b53d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 4 Nov 2024 10:39:30 -0700 Subject: [PATCH 10/12] Remove debug --- .github/workflows/deploy.yml | 1416 +++++++++++++++++----------------- 1 file changed, 705 insertions(+), 711 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7a2c66b11218..22ee78749382 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy code to staging or production on: push: - branches: [staging, production, andrew-fetch-depth2] + branches: [staging, production] env: SHOULD_DEPLOY_PRODUCTION: ${{ github.ref == 'refs/heads/production' }} @@ -53,122 +53,122 @@ jobs: id: getAppVersion run: echo "VERSION=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT" -# - name: Create and push tag -# if: ${{ github.ref == 'refs/heads/staging' }} -# run: | -# git tag ${{ steps.getAppVersion.outputs.VERSION }} -# git push origin --tags - -# # Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform -# deployChecklist: -# name: Create or update deploy checklist -# uses: ./.github/workflows/createDeployChecklist.yml -# if: ${{ github.ref == 'refs/heads/staging' }} -# needs: prep -# secrets: inherit -# -# buildAndroid: -# name: Build Android app -# uses: ./.github/workflows/buildAndroid.yml -# if: ${{ github.ref == 'refs/heads/staging' }} -# needs: prep -# secrets: inherit -# with: -# type: release -# ref: staging -# -# uploadAndroid: -# name: Upload Android build to Google Play Store -# needs: buildAndroid -# runs-on: ubuntu-latest -# env: -# RUBYOPT: '-rostruct' -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Setup Ruby -# uses: ruby/setup-ruby@v1.190.0 -# 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 -# -# - 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: Upload Android app to Google Play -# run: bundle exec fastlane android upload_google_play_internal -# env: -# aabPath: /tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }} -# -# - name: Upload Android build to Browser Stack -# run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }}" -# env: -# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} -# -# submitAndroid: -# name: Submit Android app for production review -# needs: prep -# if: ${{ github.ref == 'refs/heads/production' }} -# runs-on: ubuntu-latest -# env: -# RUBYOPT: '-rostruct' -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Setup Ruby -# uses: ruby/setup-ruby@v1.190.0 -# 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: ``, -# text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + - name: Create and push tag + if: ${{ github.ref == 'refs/heads/staging' }} + run: | + git tag ${{ steps.getAppVersion.outputs.VERSION }} + git push origin --tags + + # Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform + deployChecklist: + name: Create or update deploy checklist + uses: ./.github/workflows/createDeployChecklist.yml + if: ${{ github.ref == 'refs/heads/staging' }} + needs: prep + secrets: inherit + + buildAndroid: + name: Build Android app + uses: ./.github/workflows/buildAndroid.yml + if: ${{ github.ref == 'refs/heads/staging' }} + needs: prep + secrets: inherit + with: + type: release + ref: staging + + uploadAndroid: + name: Upload Android build to Google Play Store + needs: buildAndroid + runs-on: ubuntu-latest + env: + RUBYOPT: '-rostruct' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1.190.0 + 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 + + - 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: Upload Android app to Google Play + run: bundle exec fastlane android upload_google_play_internal + env: + aabPath: /tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }} + + - name: Upload Android build to Browser Stack + run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/tmp/artifacts/${{ needs.buildAndroid.outputs.AAB_FILE_NAME }}" + env: + BROWSERSTACK: ${{ secrets.BROWSERSTACK }} + + submitAndroid: + name: Submit Android app for production review + needs: prep + if: ${{ github.ref == 'refs/heads/production' }} + runs-on: ubuntu-latest + env: + RUBYOPT: '-rostruct' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1.190.0 + 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: ``, + text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} android_hybrid: name: Build and deploy Android HybridApp needs: prep runs-on: ubuntu-latest-xl # Only deploy HybridApp to staging -# if: ${{ github.ref == 'refs/heads/staging' }} + if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native @@ -259,213 +259,210 @@ jobs: ANDROID_UPLOAD_KEYSTORE_ALIAS: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} ANDROID_UPLOAD_KEY_PASSWORD: ${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }} - - name: Debug paths - run: ls -laR ../ - -# - name: Upload Android app to Google Play -# run: bundle exec fastlane android upload_google_play_internal_hybrid -# env: -# VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} -# -# - name: Upload Android 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=@${{ env.aabPath }}" -# env: -# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} -# -# - name: Upload Android build artifact -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: actions/upload-artifact@v4 -# with: -# name: android-hybrid-build-artifact -# path: ${{ env.aabPath }} -# -# - name: Set current App version in Env -# run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" -# -# - name: Warn deployers if Android production deploy failed -# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: "#DB4545", -# pretext: ``, -# text: `💥 Android HybridApp production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - -# desktop: -# name: Build and deploy Desktop -# needs: prep -# runs-on: macos-14-large -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Setup Node -# uses: ./.github/actions/composite/setupNode -# -# - name: Decrypt Developer ID Certificate -# run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg -# env: -# DEVELOPER_ID_SECRET_PASSPHRASE: ${{ secrets.DEVELOPER_ID_SECRET_PASSPHRASE }} -# -# - name: Build desktop app -# run: | -# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then -# npm run desktop-build -# else -# npm run desktop-build-staging -# fi -# env: -# CSC_LINK: ${{ secrets.CSC_LINK }} -# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} -# APPLE_ID: ${{ secrets.APPLE_ID }} -# APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }} -# -# - name: Upload desktop sourcemaps artifact -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-sourcemaps-artifact' || 'desktop-staging-sourcemaps-artifact' }} -# path: ./desktop/dist/www/merged-source-map.js.map -# -# - name: Upload desktop build artifact -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-build-artifact' || 'desktop-staging-build-artifact' }} -# path: ./desktop-build/NewExpensify.dmg -# -# iOS: -# name: Build and deploy iOS -# needs: prep -# env: -# DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer -# runs-on: macos-13-xlarge -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Configure MapBox SDK -# run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} -# -# - name: Setup Node -# id: setup-node -# uses: ./.github/actions/composite/setupNode -# -# - name: Setup Ruby -# uses: ruby/setup-ruby@v1.190.0 -# with: -# bundler-cache: true -# -# - name: Cache Pod dependencies -# uses: actions/cache@v4 -# id: pods-cache -# with: -# path: ios/Pods -# key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }} -# -# - name: Compare Podfile.lock and Manifest.lock -# id: compare-podfile-and-manifest -# run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT" -# -# - name: Install cocoapods -# uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 -# if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true' -# with: -# timeout_minutes: 10 -# max_attempts: 5 -# command: scripts/pod-install.sh -# -# - name: Decrypt AppStore profile -# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore.mobileprovision NewApp_AppStore.mobileprovision.gpg -# env: -# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} -# -# - name: Decrypt AppStore Notification Service profile -# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore_Notification_Service.mobileprovision NewApp_AppStore_Notification_Service.mobileprovision.gpg -# env: -# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} -# -# - name: Decrypt certificate -# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg -# env: -# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} -# -# - name: Decrypt App Store Connect API key -# run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output ios-fastlane-json-key.json ios-fastlane-json-key.json.gpg -# env: -# LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} -# -# - name: Get iOS native version -# id: getIOSVersion -# run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_OUTPUT" -# -# - name: Build iOS release app -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# run: bundle exec fastlane ios build -# -# - name: Upload release build to TestFlight -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# run: bundle exec fastlane ios upload_testflight -# env: -# APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} -# APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} -# 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" -# env: -# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} -# -# - name: Upload iOS sourcemaps artifact -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: actions/upload-artifact@v4 -# with: -# name: ios-sourcemaps-artifact -# path: ./main.jsbundle.map -# -# - name: Upload iOS build artifact -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: actions/upload-artifact@v4 -# with: -# name: ios-build-artifact -# path: /Users/runner/work/App/App/New\ Expensify.ipa -# -# - name: Warn deployers if iOS production deploy failed -# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: "#DB4545", -# pretext: ``, -# text: `💥 iOS production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + - name: Upload Android app to Google Play + run: bundle exec fastlane android upload_google_play_internal_hybrid + env: + VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }} + + - name: Upload Android 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=@${{ env.aabPath }}" + env: + BROWSERSTACK: ${{ secrets.BROWSERSTACK }} + + - name: Upload Android build artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: android-hybrid-build-artifact + path: ${{ env.aabPath }} + + - name: Set current App version in Env + run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" + + - name: Warn deployers if Android production deploy failed + if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: "#DB4545", + pretext: ``, + text: `💥 Android HybridApp production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the . 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + desktop: + name: Build and deploy Desktop + needs: prep + runs-on: macos-14-large + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: ./.github/actions/composite/setupNode + + - name: Decrypt Developer ID Certificate + run: cd desktop && gpg --quiet --batch --yes --decrypt --passphrase="$DEVELOPER_ID_SECRET_PASSPHRASE" --output developer_id.p12 developer_id.p12.gpg + env: + DEVELOPER_ID_SECRET_PASSPHRASE: ${{ secrets.DEVELOPER_ID_SECRET_PASSPHRASE }} + + - name: Build desktop app + run: | + if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then + npm run desktop-build + else + npm run desktop-build-staging + fi + env: + CSC_LINK: ${{ secrets.CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }} + + - name: Upload desktop sourcemaps artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-sourcemaps-artifact' || 'desktop-staging-sourcemaps-artifact' }} + path: ./desktop/dist/www/merged-source-map.js.map + + - name: Upload desktop build artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'desktop-build-artifact' || 'desktop-staging-build-artifact' }} + path: ./desktop-build/NewExpensify.dmg + + iOS: + name: Build and deploy iOS + needs: prep + env: + DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer + runs-on: macos-13-xlarge + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure MapBox SDK + run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} + + - name: Setup Node + id: setup-node + uses: ./.github/actions/composite/setupNode + + - name: Setup Ruby + uses: ruby/setup-ruby@v1.190.0 + with: + bundler-cache: true + + - name: Cache Pod dependencies + uses: actions/cache@v4 + id: pods-cache + with: + path: ios/Pods + key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }} + + - name: Compare Podfile.lock and Manifest.lock + id: compare-podfile-and-manifest + run: echo "IS_PODFILE_SAME_AS_MANIFEST=${{ hashFiles('ios/Podfile.lock') == hashFiles('ios/Pods/Manifest.lock') }}" >> "$GITHUB_OUTPUT" + + - name: Install cocoapods + uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847 + if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true' + with: + timeout_minutes: 10 + max_attempts: 5 + command: scripts/pod-install.sh + + - name: Decrypt AppStore profile + run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore.mobileprovision NewApp_AppStore.mobileprovision.gpg + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Decrypt AppStore Notification Service profile + run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output NewApp_AppStore_Notification_Service.mobileprovision NewApp_AppStore_Notification_Service.mobileprovision.gpg + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Decrypt certificate + run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Decrypt App Store Connect API key + run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output ios-fastlane-json-key.json ios-fastlane-json-key.json.gpg + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Get iOS native version + id: getIOSVersion + run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_OUTPUT" + + - name: Build iOS release app + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: bundle exec fastlane ios build + + - name: Upload release build to TestFlight + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: bundle exec fastlane ios upload_testflight + env: + APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} + APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} + 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" + env: + BROWSERSTACK: ${{ secrets.BROWSERSTACK }} + + - name: Upload iOS sourcemaps artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: ios-sourcemaps-artifact + path: ./main.jsbundle.map + + - name: Upload iOS build artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: ios-build-artifact + path: /Users/runner/work/App/App/New\ Expensify.ipa + + - name: Warn deployers if iOS production deploy failed + if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: "#DB4545", + pretext: ``, + text: `💥 iOS production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} iOS_hybrid: name: Build and deploy iOS HybridApp @@ -474,7 +471,7 @@ jobs: env: DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer # Only deploy HybridApp to staging -# if: ${{ github.ref == 'refs/heads/staging' }} + if: ${{ github.ref == 'refs/heads/staging' }} defaults: run: working-directory: Mobile-Expensify/react-native @@ -580,395 +577,392 @@ jobs: if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} run: bundle exec fastlane ios build_hybrid - - name: Debug paths - run: ls -laR ../ - -# - name: Upload release build to TestFlight -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# run: bundle exec fastlane ios upload_testflight_hybrid -# env: -# APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} -# APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} -# APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} -# APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} -# -# - 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=@${{ env.ipaPath }}" -# env: -# BROWSERSTACK: ${{ secrets.BROWSERSTACK }} -# -# - name: Upload iOS build artifact -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: actions/upload-artifact@v4 -# with: -# name: ios-hybrid-build-artifact -# path: ${{ env.ipaPath }} - -# - name: Warn deployers if iOS production deploy failed -# if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: "#DB4545", -# pretext: ``, -# text: `💥 iOS HybridApp production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - -# web: -# name: Build and deploy Web -# needs: prep -# runs-on: ubuntu-latest-xl -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Setup Node -# uses: ./.github/actions/composite/setupNode -# -# - name: Setup Cloudflare CLI -# run: pip3 install cloudflare==2.19.0 -# -# - 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: Build web -# run: | -# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then -# npm run build -# else -# npm run build-staging -# fi -# -# - name: Build storybook docs -# continue-on-error: true -# run: | -# if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then -# npm run storybook-build -# else -# npm run storybook-build-staging -# fi -# -# - name: Deploy to S3 -# run: | -# aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist ${{ env.S3_URL }}/ -# aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{ env.S3_URL }}/.well-known/apple-app-site-association -# aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{env.S3_URL }}/apple-app-site-association -# env: -# S3_URL: s3://${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging-' || '' }}expensify-cash -# -# - name: Purge Cloudflare cache -# run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging.' || '' }}new.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache -# env: -# CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }} -# -# - name: Verify staging deploy -# if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# run: ./.github/scripts/verifyDeploy.sh staging ${{ needs.prep.outputs.APP_VERSION }} -# -# - name: Verify production deploy -# if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# run: ./.github/scripts/verifyDeploy.sh production ${{ needs.prep.outputs.APP_VERSION }} -# -# - name: Upload web sourcemaps artifact -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-sourcemaps-artifact -# path: ./dist/merged-source-map.js.map -# -# - name: Compress web build .tar.gz and .zip -# run: | -# tar -czvf webBuild.tar.gz dist -# zip -r webBuild.zip dist -# -# - name: Upload .tar.gz web build artifact -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-tar-gz-artifact -# path: ./webBuild.tar.gz -# -# - name: Upload .zip web build artifact -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-zip-artifact -# path: ./webBuild.zip -# -# postSlackMessageOnFailure: -# name: Post a Slack message when any platform fails to build or deploy -# runs-on: ubuntu-latest -# if: ${{ failure() }} -# needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# -# - name: Post Slack message on failure -# uses: ./.github/actions/composite/announceFailedWorkflowInSlack -# with: -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# -# checkDeploymentSuccess: -# runs-on: ubuntu-latest -# 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, 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 [ ${{ 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" ] || \ -# [ "${{ needs.iOS_hybrid.result }}" == "success" ] || \ -# [ "${{ needs.android_hybrid.result }}" == "success" ] || \ -# [ "${{ needs.desktop.result }}" == "success" ] || \ -# [ "${{ needs.web.result }}" == "success" ]; then -# isAtLeastOnePlatformDeployed="true" -# fi -# echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED=$isAtLeastOnePlatformDeployed" >> "$GITHUB_OUTPUT" -# echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED is $isAtLeastOnePlatformDeployed" -# -# - name: Check deployment success on all platforms -# id: checkDeploymentSuccessOnAllPlatforms -# run: | -# isAllPlatformsDeployed="false" -# if [ "${{ needs.iOS.result }}" == "success" ] && \ -# [ "${{ needs.iOS_hybrid.result }}" == "success" ] && \ -# [ "${{ needs.android_hybrid.result }}" == "success" ] && \ -# [ "${{ needs.desktop.result }}" == "success" ] && \ -# [ "${{ needs.web.result }}" == "success" ]; then -# isAllPlatformsDeployed="true" -# fi -# -# 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" -# echo "IS_ALL_PLATFORMS_DEPLOYED is $isAllPlatformsDeployed" -# -# createPrerelease: -# runs-on: ubuntu-latest -# if: ${{ always() && github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} -# needs: [prep, checkDeploymentSuccess] -# steps: -# - name: Download all workflow run artifacts -# uses: actions/download-artifact@v4 -# -# - name: 🚀 Create prerelease 🚀 -# run: | -# gh release create ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --title ${{ needs.prep.outputs.APP_VERSION }} --generate-notes --prerelease --target staging -# RETRIES=0 -# MAX_RETRIES=10 -# until [[ $(gh release view ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }}) || $RETRIES -ge $MAX_RETRIES ]]; do -# echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times" -# sleep 1 -# done -# env: -# GITHUB_TOKEN: ${{ github.token }} -# -# - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name -# continue-on-error: true -# run: | -# mv ./desktop-staging-sourcemaps-artifact/merged-source-map.js.map ./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map -# mv ./web-staging-sourcemaps-artifact/merged-source-map.js.map ./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map -# -# - name: Upload artifacts to GitHub Release -# continue-on-error: true -# run: | -# # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] -# files=( -# "./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map" -# "./android-aab-artifact/app-production-release.aab#android.aab" -# "./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab" -# "./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map" -# "./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg" -# "./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map" -# "./ios-build-artifact/New Expensify.ipa#ios.ipa" -# "./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa" -# "./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map" -# "./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz" -# "./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip" -# ) -# -# # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) -# for file_entry in "${files[@]}"; do -# gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" -# done -# env: -# GITHUB_TOKEN: ${{ github.token }} -# -# - name: Warn deployers if staging deploy failed -# if: ${{ failure() }} -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: "#DB4545", -# pretext: ``, -# text: `💥 NewDot staging deploy failed. 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} -# -# finalizeRelease: -# runs-on: ubuntu-latest -# if: ${{ always() && github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} -# needs: [prep, checkDeploymentSuccess] -# steps: -# - name: Download all workflow run artifacts -# uses: actions/download-artifact@v4 -# -# - name: 🚀 Edit the release to be no longer a prerelease 🚀 -# run: | -# LATEST_RELEASE="$(gh release list --repo ${{ github.repository }} --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')" -# gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ needs.prep.outputs.APP_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md -# gh release edit ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --prerelease=false --latest --notes-file releaseNotes.md -# env: -# GITHUB_TOKEN: ${{ github.token }} -# -# - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name -# continue-on-error: true -# run: | -# mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map -# mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map -# -# - name: Upload artifacts to GitHub Release -# continue-on-error: true -# run: | -# # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] -# files=( -# "./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map" -# "./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg" -# "./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map" -# "./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz" -# "./web-build-zip-artifact/webBuild.zip#web-production.zip" -# ) -# -# # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) -# for file_entry in "${files[@]}"; do -# gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" -# done -# env: -# GITHUB_TOKEN: ${{ github.token }} -# -# - name: Warn deployers if production deploy failed -# if: ${{ failure() }} -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: "#DB4545", -# pretext: ``, -# text: `💥 NewDot production deploy failed. 💥`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} -# -# postSlackMessageOnSuccess: -# 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, 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 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#announce', -# attachments: [{ -# color: 'good', -# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} -# -# - name: 'Announces the deploy in the #deployer Slack room' -# uses: 8398a7/action-slack@v3 -# with: -# status: custom -# custom_payload: | -# { -# channel: '#deployer', -# attachments: [{ -# color: 'good', -# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} -# -# - name: 'Announces a production deploy in the #expensify-open-source Slack room' -# uses: 8398a7/action-slack@v3 -# if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} -# with: -# status: custom -# custom_payload: | -# { -# channel: '#expensify-open-source', -# attachments: [{ -# color: 'good', -# text: `🎉️ Successfully deployed ${process.env.AS_REPO} to production 🎉️`, -# }] -# } -# env: -# GITHUB_TOKEN: ${{ github.token }} -# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} -# -# postGithubComments: -# uses: ./.github/workflows/postDeployComments.yml -# if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} -# 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.submitAndroid.result || needs.uploadAndroid.result }} -# android_hybrid: ${{ needs.android_hybrid.result }} -# ios: ${{ needs.iOS.result }} -# ios_hybrid: ${{ needs.iOS_hybrid.result }} -# web: ${{ needs.web.result }} -# desktop: ${{ needs.desktop.result }} + - name: Upload release build to TestFlight + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: bundle exec fastlane ios upload_testflight_hybrid + env: + APPLE_CONTACT_EMAIL: ${{ secrets.APPLE_CONTACT_EMAIL }} + APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }} + APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }} + APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }} + + - 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=@${{ env.ipaPath }}" + env: + BROWSERSTACK: ${{ secrets.BROWSERSTACK }} + + - name: Upload iOS build artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: ios-hybrid-build-artifact + path: ${{ env.ipaPath }} + + - name: Warn deployers if iOS production deploy failed + if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: "#DB4545", + pretext: ``, + text: `💥 iOS HybridApp production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the . 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + web: + name: Build and deploy Web + needs: prep + runs-on: ubuntu-latest-xl + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: ./.github/actions/composite/setupNode + + - name: Setup Cloudflare CLI + run: pip3 install cloudflare==2.19.0 + + - 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: Build web + run: | + if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then + npm run build + else + npm run build-staging + fi + + - name: Build storybook docs + continue-on-error: true + run: | + if [[ ${{ env.SHOULD_DEPLOY_PRODUCTION }} == 'true' ]]; then + npm run storybook-build + else + npm run storybook-build-staging + fi + + - name: Deploy to S3 + run: | + aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist ${{ env.S3_URL }}/ + aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{ env.S3_URL }}/.well-known/apple-app-site-association + aws s3 cp --acl public-read --content-type 'application/json' --metadata-directive REPLACE ${{ env.S3_URL }}/.well-known/apple-app-site-association ${{env.S3_URL }}/apple-app-site-association + env: + S3_URL: s3://${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging-' || '' }}expensify-cash + + - name: Purge Cloudflare cache + run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging.' || '' }}new.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache + env: + CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }} + + - name: Verify staging deploy + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: ./.github/scripts/verifyDeploy.sh staging ${{ needs.prep.outputs.APP_VERSION }} + + - name: Verify production deploy + if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + run: ./.github/scripts/verifyDeploy.sh production ${{ needs.prep.outputs.APP_VERSION }} + + - name: Upload web sourcemaps artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-sourcemaps-artifact + path: ./dist/merged-source-map.js.map + + - name: Compress web build .tar.gz and .zip + run: | + tar -czvf webBuild.tar.gz dist + zip -r webBuild.zip dist + + - name: Upload .tar.gz web build artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-tar-gz-artifact + path: ./webBuild.tar.gz + + - name: Upload .zip web build artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'web' || 'web-staging' }}-build-zip-artifact + path: ./webBuild.zip + + postSlackMessageOnFailure: + name: Post a Slack message when any platform fails to build or deploy + runs-on: ubuntu-latest + if: ${{ failure() }} + needs: [buildAndroid, uploadAndroid, submitAndroid, android_hybrid, desktop, iOS, iOS_hybrid, web] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Post Slack message on failure + uses: ./.github/actions/composite/announceFailedWorkflowInSlack + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + checkDeploymentSuccess: + runs-on: ubuntu-latest + 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, 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 [ ${{ 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" ] || \ + [ "${{ needs.iOS_hybrid.result }}" == "success" ] || \ + [ "${{ needs.android_hybrid.result }}" == "success" ] || \ + [ "${{ needs.desktop.result }}" == "success" ] || \ + [ "${{ needs.web.result }}" == "success" ]; then + isAtLeastOnePlatformDeployed="true" + fi + echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED=$isAtLeastOnePlatformDeployed" >> "$GITHUB_OUTPUT" + echo "IS_AT_LEAST_ONE_PLATFORM_DEPLOYED is $isAtLeastOnePlatformDeployed" + + - name: Check deployment success on all platforms + id: checkDeploymentSuccessOnAllPlatforms + run: | + isAllPlatformsDeployed="false" + if [ "${{ needs.iOS.result }}" == "success" ] && \ + [ "${{ needs.iOS_hybrid.result }}" == "success" ] && \ + [ "${{ needs.android_hybrid.result }}" == "success" ] && \ + [ "${{ needs.desktop.result }}" == "success" ] && \ + [ "${{ needs.web.result }}" == "success" ]; then + isAllPlatformsDeployed="true" + fi + + 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" + echo "IS_ALL_PLATFORMS_DEPLOYED is $isAllPlatformsDeployed" + + createPrerelease: + runs-on: ubuntu-latest + if: ${{ always() && github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} + needs: [prep, checkDeploymentSuccess] + steps: + - name: Download all workflow run artifacts + uses: actions/download-artifact@v4 + + - name: 🚀 Create prerelease 🚀 + run: | + gh release create ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --title ${{ needs.prep.outputs.APP_VERSION }} --generate-notes --prerelease --target staging + RETRIES=0 + MAX_RETRIES=10 + until [[ $(gh release view ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }}) || $RETRIES -ge $MAX_RETRIES ]]; do + echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times" + sleep 1 + done + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name + continue-on-error: true + run: | + mv ./desktop-staging-sourcemaps-artifact/merged-source-map.js.map ./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map + mv ./web-staging-sourcemaps-artifact/merged-source-map.js.map ./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map + + - name: Upload artifacts to GitHub Release + continue-on-error: true + run: | + # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] + files=( + "./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map" + "./android-aab-artifact/app-production-release.aab#android.aab" + "./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab" + "./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map" + "./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg" + "./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map" + "./ios-build-artifact/New Expensify.ipa#ios.ipa" + "./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa" + "./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map" + "./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz" + "./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip" + ) + + # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) + for file_entry in "${files[@]}"; do + gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" + done + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Warn deployers if staging deploy failed + if: ${{ failure() }} + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: "#DB4545", + pretext: ``, + text: `💥 NewDot staging deploy failed. 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + finalizeRelease: + runs-on: ubuntu-latest + if: ${{ always() && github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} + needs: [prep, checkDeploymentSuccess] + steps: + - name: Download all workflow run artifacts + uses: actions/download-artifact@v4 + + - name: 🚀 Edit the release to be no longer a prerelease 🚀 + run: | + LATEST_RELEASE="$(gh release list --repo ${{ github.repository }} --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')" + gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ needs.prep.outputs.APP_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md + gh release edit ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --prerelease=false --latest --notes-file releaseNotes.md + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name + continue-on-error: true + run: | + mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map + mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map + + - name: Upload artifacts to GitHub Release + continue-on-error: true + run: | + # Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension] + files=( + "./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map" + "./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg" + "./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map" + "./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz" + "./web-build-zip-artifact/webBuild.zip#web-production.zip" + ) + + # Loop through each file and upload individually (so if one fails, we still have other platforms uploaded) + for file_entry in "${files[@]}"; do + gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber "$file_entry" + done + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Warn deployers if production deploy failed + if: ${{ failure() }} + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: "#DB4545", + pretext: ``, + text: `💥 NewDot production deploy failed. 💥`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + postSlackMessageOnSuccess: + 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, 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 + with: + status: custom + custom_payload: | + { + channel: '#announce', + attachments: [{ + color: 'good', + text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + - name: 'Announces the deploy in the #deployer Slack room' + uses: 8398a7/action-slack@v3 + with: + status: custom + custom_payload: | + { + channel: '#deployer', + attachments: [{ + color: 'good', + text: `🎉️ Successfully deployed ${process.env.AS_REPO} to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + - name: 'Announces a production deploy in the #expensify-open-source Slack room' + uses: 8398a7/action-slack@v3 + if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + with: + status: custom + custom_payload: | + { + channel: '#expensify-open-source', + attachments: [{ + color: 'good', + text: `🎉️ Successfully deployed ${process.env.AS_REPO} to production 🎉️`, + }] + } + env: + GITHUB_TOKEN: ${{ github.token }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + + postGithubComments: + uses: ./.github/workflows/postDeployComments.yml + if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }} + 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.submitAndroid.result || needs.uploadAndroid.result }} + android_hybrid: ${{ needs.android_hybrid.result }} + ios: ${{ needs.iOS.result }} + ios_hybrid: ${{ needs.iOS_hybrid.result }} + web: ${{ needs.web.result }} + desktop: ${{ needs.desktop.result }} From 020487edcb28c103631519d45d111e31241902e0 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 4 Nov 2024 10:49:31 -0700 Subject: [PATCH 11/12] Upload Android and iOS sourcemaps --- .github/workflows/deploy.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 22ee78749382..ba9ec1043ab1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -277,6 +277,13 @@ jobs: name: android-hybrid-build-artifact path: ${{ env.aabPath }} + - name: Upload Android sourcemap artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: android-hybrid-sourcemap-artifact + path: /Users/runner/work/App/App/Mobile-Expensify/Android/build/generated/sourcemaps/react/release/index.android.bundle.map + - name: Set current App version in Env run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" @@ -599,6 +606,13 @@ jobs: name: ios-hybrid-build-artifact path: ${{ env.ipaPath }} + - name: Upload iOS sourcemap artifact + if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} + uses: actions/upload-artifact@v4 + with: + name: ios-hybrid-sourcemap-artifact + path: /Users/runner/work/App/App/Mobile-Expensify/main.jsbundle.map + - name: Warn deployers if iOS production deploy failed if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} uses: 8398a7/action-slack@v3 @@ -804,11 +818,13 @@ jobs: "./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map" "./android-aab-artifact/app-production-release.aab#android.aab" "./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab" + "./android-hybrid-sourcemap-artifact/index.android.bundle.map#android-hybrid-sourcemap.js.map" "./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map" "./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg" "./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map" "./ios-build-artifact/New Expensify.ipa#ios.ipa" "./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa" + "./ios-hybrid-sourcemap-artifact/main.jsbundle.map#ios-hybrid-sourcemap.js.map" "./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map" "./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz" "./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip" From e24415865f2422529c68d68b0bd924b76af7ec3d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 4 Nov 2024 10:56:28 -0700 Subject: [PATCH 12/12] Update setup-node to match all other versions --- .github/workflows/deployNewHelp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployNewHelp.yml b/.github/workflows/deployNewHelp.yml index 2d2f551482d2..8e455979a50e 100644 --- a/.github/workflows/deployNewHelp.yml +++ b/.github/workflows/deployNewHelp.yml @@ -53,7 +53,7 @@ jobs: # Install Node for _scripts/*.js - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '20.18.0'