From d3bd9f5d881e447e0f68db532d404bb240edf6c9 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 15 Jan 2025 15:52:19 -0700 Subject: [PATCH 01/23] Add new workflow to validate that HybridApp builds on every commit --- .github/workflows/verifyHybridApp.yml | 114 ++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/verifyHybridApp.yml diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml new file mode 100644 index 000000000000..91e9482d505b --- /dev/null +++ b/.github/workflows/verifyHybridApp.yml @@ -0,0 +1,114 @@ +name: Verify HybridApp builds on main + +on: + workflow_call: + pull_request: + types: [opened, synchronize] + branches-ignore: [staging, production] + +concurrency: + group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-verify-main + cancel-in-progress: true + +jobs: + verify_android: + name: Verify Android HybridApp builds on main + runs-on: ubuntu-latest-xl + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + ref: ${{ github.event.pull_request.head.sha || needs.getBranchRef.outputs.REF }} + 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 match main + env: + OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} + run: | + git submodule update --init --remote + if [[ -z "$OLD_DOT_COMMIT" ]]; then + git fetch + git checkout ${{ env.OLD_DOT_COMMIT }} + fi + + - 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 + with: + IS_HYBRID_BUILD: 'true' + + - name: Run grunt build + run: | + cd Mobile-Expensify + npm run grunt:build:shared + + - name: Run Android build + run: npx react-native build-android + + verify_ios: + name: Verify iOS HybridApp builds on main + runs-on: macos-15-xlarge + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + ref: ${{ github.event.pull_request.head.sha || needs.getBranchRef.outputs.REF }} + 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 match main + env: + OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} + run: | + git submodule update --init --remote + if [[ -z "$OLD_DOT_COMMIT" ]]; then + git fetch + git checkout ${{ env.OLD_DOT_COMMIT }} + fi + + - 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 + with: + IS_HYBRID_BUILD: 'true' + + - name: Setup Ruby + uses: ruby/setup-ruby@v1.204.0 + with: + bundler-cache: true + + - name: Install New Expensify Gems + run: bundle install + + - name: Cache Pod dependencies + uses: actions/cache@v4 + id: pods-cache + with: + path: Mobile-Expensify/iOS/Pods + key: ${{ runner.os }}-pods-cache-${{ hashFiles('Mobile-Expensify/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('Mobile-Expensify/iOS/Podfile.lock') == hashFiles('Mobile-Expensify/iOS/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: npm run pod-install + + - name: Build iOS App + run: npx react-native build-ios From 45b6c986b8145930ec6b20103e695278df93d285 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 16 Jan 2025 09:38:38 -0700 Subject: [PATCH 02/23] Add flags --- .github/workflows/verifyHybridApp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index 91e9482d505b..ddc6e00fb291 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -49,7 +49,7 @@ jobs: npm run grunt:build:shared - name: Run Android build - run: npx react-native build-android + run: npx react-native build-android --mode Debug --appId org.me.mobiexpensifyg verify_ios: name: Verify iOS HybridApp builds on main @@ -111,4 +111,4 @@ jobs: command: npm run pod-install - name: Build iOS App - run: npx react-native build-ios + run: npx react-native build-ios --mode Debug --scheme Expensify From b7ad7f0c20f638c317293c4fc61099009a2df87c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 10:28:31 -0700 Subject: [PATCH 03/23] Use fastlane --- .github/workflows/verifyHybridApp.yml | 4 ++-- Mobile-Expensify | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index ddc6e00fb291..a9d79f4eb67a 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -49,7 +49,7 @@ jobs: npm run grunt:build:shared - name: Run Android build - run: npx react-native build-android --mode Debug --appId org.me.mobiexpensifyg + run: bundle exec fastlane android build_local_hybrid verify_ios: name: Verify iOS HybridApp builds on main @@ -111,4 +111,4 @@ jobs: command: npm run pod-install - name: Build iOS App - run: npx react-native build-ios --mode Debug --scheme Expensify + run: bundle exec fastlane ios build_unsigned_hybrid diff --git a/Mobile-Expensify b/Mobile-Expensify index 37873194260d..6be7b9e36f93 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 37873194260df675ca55c3f14cc41f65601e9746 +Subproject commit 6be7b9e36f93495289c84ad4fef5bea35c76e8d6 From 5a5acf5ed53a032af21fdc5ab909ab5c0cd338f4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 10:35:19 -0700 Subject: [PATCH 04/23] Install ruby on Android runner --- .github/workflows/verifyHybridApp.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index a9d79f4eb67a..25d711e074b1 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -43,6 +43,14 @@ jobs: with: IS_HYBRID_BUILD: 'true' + - name: Setup Ruby + uses: ruby/setup-ruby@v1.190.0 + with: + bundler-cache: true + + - name: Install New Expensify Gems + run: bundle install + - name: Run grunt build run: | cd Mobile-Expensify From 7f2f3ab754d425aa8114b784589e2f21cae907ec Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 10:53:21 -0700 Subject: [PATCH 05/23] Switch task --- fastlane/Fastfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 806ffe574031..3a5294033d63 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -119,9 +119,7 @@ platform :android do ENV["ENVFILE"]="Mobile-Expensify/.env.production.hybridapp.android" gradle( project_dir: 'Mobile-Expensify/Android', - task: 'assemble', - flavor: 'Production', - build_type: 'Release', + task: "bundleRelease" ) setGradleOutputsInEnv() end From 3622a01daaffccb0f56f0a4dbc9e8be0a3bd8e81 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 11:18:05 -0700 Subject: [PATCH 06/23] Use debug scheme --- fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 3a5294033d63..a003bc718cab 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -465,6 +465,7 @@ platform :ios do lane :build_unsigned_hybrid do ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp.ios" build_app( + scheme: "Debug", workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace", scheme: "Expensify" ) From 8c5b4ad8e659dbaf00ac56e28d5a914274966666 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 11:30:17 -0700 Subject: [PATCH 07/23] Use configuration instead of scheme for iOS --- fastlane/Fastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index a003bc718cab..eddc2934c1c7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -465,9 +465,9 @@ platform :ios do lane :build_unsigned_hybrid do ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp.ios" build_app( - scheme: "Debug", workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace", - scheme: "Expensify" + scheme: "Expensify", + configuration: "Debug" ) setIOSBuildOutputsInEnv() end From 05e4a29dc0a71a9555e809d0f0c63e82bac69fbe Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 14:27:18 -0700 Subject: [PATCH 08/23] Use xcodebuild and gradle manually --- .github/workflows/verifyHybridApp.yml | 34 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index 25d711e074b1..cff94ed11245 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -56,8 +56,16 @@ jobs: cd Mobile-Expensify npm run grunt:build:shared - - name: Run Android build - run: bundle exec fastlane android build_local_hybrid + - name: Build Android Debug + working-directory: Mobile-Expensify/Android + run: | + ./gradlew assembleDebug + if [ $? -eq 0 ]; then + echo "✅ Android debug build succeeded!" + else + echo "❌ Android debug build failed." + exit 1 + fi verify_ios: name: Verify iOS HybridApp builds on main @@ -118,5 +126,23 @@ jobs: max_attempts: 5 command: npm run pod-install - - name: Build iOS App - run: bundle exec fastlane ios build_unsigned_hybrid + - name: Build for iOS Simulator + run: | + # Build the app for the iOS simulator without signing + xcodebuild \ + -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ + -scheme Expensify \ + -configuration Debug \ + -sdk iphonesimulator \ + -arch x86_64 \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO \ + build + + if [ $? -eq 0 ]; then + echo "✅ iOS simulator build succeeded!" + else + echo "❌ iOS simulator build failed." + exit 1 + fi From 9fc9001e2b4178c500212c8c185bd2be56ee1877 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 14:42:44 -0700 Subject: [PATCH 09/23] Tweak commands --- .github/workflows/verifyHybridApp.yml | 14 +++----------- fastlane/Fastfile | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index cff94ed11245..e74f9c1df3db 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -43,14 +43,6 @@ jobs: with: IS_HYBRID_BUILD: 'true' - - name: Setup Ruby - uses: ruby/setup-ruby@v1.190.0 - with: - bundler-cache: true - - - name: Install New Expensify Gems - run: bundle install - - name: Run grunt build run: | cd Mobile-Expensify @@ -126,9 +118,9 @@ jobs: max_attempts: 5 command: npm run pod-install - - name: Build for iOS Simulator + - name: Build iOS HybridApp run: | - # Build the app for the iOS simulator without signing + set -o pipefail xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ -scheme Expensify \ @@ -138,7 +130,7 @@ jobs: CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ - build + build | xcpretty if [ $? -eq 0 ]; then echo "✅ iOS simulator build succeeded!" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index eddc2934c1c7..97b8f67d7d7a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -119,7 +119,7 @@ platform :android do ENV["ENVFILE"]="Mobile-Expensify/.env.production.hybridapp.android" gradle( project_dir: 'Mobile-Expensify/Android', - task: "bundleRelease" + task: "bundleDebug" ) setGradleOutputsInEnv() end From 621b112b2e3a9866f17bd4d756a84a046555ffa1 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 15:24:46 -0700 Subject: [PATCH 10/23] Add RCT_NO_LAUNCH_PACKAGER --- .github/workflows/verifyHybridApp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index e74f9c1df3db..a4eb7efb4cde 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -121,7 +121,8 @@ jobs: - name: Build iOS HybridApp run: | set -o pipefail - xcodebuild \ + # Build iOS using xcodebuild, do not start metro + RCT_NO_LAUNCH_PACKAGER=1 xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ -scheme Expensify \ -configuration Debug \ From 84fbe76ad545db5f4cfa71ac0780fbb38f84bac3 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Wed, 22 Jan 2025 16:19:39 -0700 Subject: [PATCH 11/23] Try setting differently --- .github/workflows/verifyHybridApp.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index a4eb7efb4cde..fa3f8e3098d6 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -120,9 +120,14 @@ jobs: - name: Build iOS HybridApp run: | + # Let us know if the builds fails set -o pipefail - # Build iOS using xcodebuild, do not start metro - RCT_NO_LAUNCH_PACKAGER=1 xcodebuild \ + + # Do not start metro + RCT_NO_LAUNCH_PACKAGER=1 + + # Build iOS using xcodebuild + xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ -scheme Expensify \ -configuration Debug \ From 51e148219c2b73c0ab29ce406441917117d147ae Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 11:51:21 -0700 Subject: [PATCH 12/23] Update submodule --- Mobile-Expensify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index 546553b27428..e85d2d976db2 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 546553b27428a76bf6f3a45cb7c4e0ecd081c827 +Subproject commit e85d2d976db27c549baebd7163b95697172aab09 From 182213360aee3d3cb7334757a265bb13224df8db Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 11:53:54 -0700 Subject: [PATCH 13/23] Checkout commit manually --- .github/workflows/verifyHybridApp.yml | 18 ++++-------------- Mobile-Expensify | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index fa3f8e3098d6..514d51099d22 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -25,14 +25,7 @@ jobs: fetch-depth: 0 - name: Update submodule to match main - env: - OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} - run: | - git submodule update --init --remote - if [[ -z "$OLD_DOT_COMMIT" ]]; then - git fetch - git checkout ${{ env.OLD_DOT_COMMIT }} - fi + run: git submodule update --init --remote - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -73,14 +66,11 @@ jobs: fetch-depth: 0 - name: Update submodule to match main - env: - OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} run: | git submodule update --init --remote - if [[ -z "$OLD_DOT_COMMIT" ]]; then - git fetch - git checkout ${{ env.OLD_DOT_COMMIT }} - fi + # TODO: Remove these two lines before merging + git fetch + git checkout e85d2d976db27c549baebd7163b95697172aab09 - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} diff --git a/Mobile-Expensify b/Mobile-Expensify index e85d2d976db2..99fa744e7328 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit e85d2d976db27c549baebd7163b95697172aab09 +Subproject commit 99fa744e7328b86c4e14cc9d0393bf3fa13d9de2 From 7ff0979b63b909e2e90ca62abfb2398f8eb0427d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 11:58:54 -0700 Subject: [PATCH 14/23] Use main --- .github/workflows/verifyHybridApp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index 514d51099d22..28ebb41c79e5 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -70,7 +70,7 @@ jobs: git submodule update --init --remote # TODO: Remove these two lines before merging git fetch - git checkout e85d2d976db27c549baebd7163b95697172aab09 + git checkout main - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} From c64c1f5af7804cfeafd84b78bed42cab9fae7e39 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 13:31:15 -0700 Subject: [PATCH 15/23] Install shared js --- .github/workflows/verifyHybridApp.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index 28ebb41c79e5..a5d52d012659 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -81,6 +81,11 @@ jobs: with: IS_HYBRID_BUILD: 'true' + - name: Run grunt build + run: | + cd Mobile-Expensify + npm run grunt:build:shared + - name: Setup Ruby uses: ruby/setup-ruby@v1.204.0 with: From c126731556bdca8f4b063488db8bf65379566ebf Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 13:36:01 -0700 Subject: [PATCH 16/23] Build ios code --- .github/workflows/verifyHybridApp.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index a5d52d012659..fa35f66087f0 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -121,6 +121,20 @@ jobs: # Do not start metro RCT_NO_LAUNCH_PACKAGER=1 + PROJECT_ROOT=${PROJECT_ROOT:-"$PROJECT_DIR/.."} + NEW_DOT_DIR="$PROJECT_ROOT/.." + + if [ ! -f main.jsbundle ]; then + cd $NEW_DOT_DIR + npx react-native bundle \ + --entry-file index.js \ + --platform ios \ + --dev false \ + --bundle-output "$PROJECT_ROOT/ios/main.jsbundle" \ + --assets-dest "$PROJECT_ROOT/ios" + cd $PROJECT_ROOT + fi + # Build iOS using xcodebuild xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ From dcff2a210d52ca86ac85e1b6644b750b1e05b9a4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 15:44:43 -0700 Subject: [PATCH 17/23] Remove bad iOS build code --- .github/workflows/verifyHybridApp.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index fa35f66087f0..a5d52d012659 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -121,20 +121,6 @@ jobs: # Do not start metro RCT_NO_LAUNCH_PACKAGER=1 - PROJECT_ROOT=${PROJECT_ROOT:-"$PROJECT_DIR/.."} - NEW_DOT_DIR="$PROJECT_ROOT/.." - - if [ ! -f main.jsbundle ]; then - cd $NEW_DOT_DIR - npx react-native bundle \ - --entry-file index.js \ - --platform ios \ - --dev false \ - --bundle-output "$PROJECT_ROOT/ios/main.jsbundle" \ - --assets-dest "$PROJECT_ROOT/ios" - cd $PROJECT_ROOT - fi - # Build iOS using xcodebuild xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ From ed20005db17cb0cf7fb22657610774a4d370bd41 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 16:19:34 -0700 Subject: [PATCH 18/23] Fix shell lint --- .github/workflows/verifyHybridApp.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index a5d52d012659..ca0f182910bd 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 with: submodules: true - ref: ${{ github.event.pull_request.head.sha || needs.getBranchRef.outputs.REF }} + ref: ${{ github.event.pull_request.head.sha }} token: ${{ secrets.OS_BOTIFY_TOKEN }} # fetch-depth: 0 is required in order to fetch the correct submodule branch fetch-depth: 0 @@ -60,7 +60,7 @@ jobs: uses: actions/checkout@v4 with: submodules: true - ref: ${{ github.event.pull_request.head.sha || needs.getBranchRef.outputs.REF }} + ref: ${{ github.event.pull_request.head.sha }} token: ${{ secrets.OS_BOTIFY_TOKEN }} # fetch-depth: 0 is required in order to fetch the correct submodule branch fetch-depth: 0 @@ -119,10 +119,10 @@ jobs: set -o pipefail # Do not start metro - RCT_NO_LAUNCH_PACKAGER=1 + export RCT_NO_LAUNCH_PACKAGER=1 # Build iOS using xcodebuild - xcodebuild \ + if ! xcodebuild \ -workspace Mobile-Expensify/iOS/Expensify.xcworkspace \ -scheme Expensify \ -configuration Debug \ @@ -131,11 +131,8 @@ jobs: CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ - build | xcpretty - - if [ $? -eq 0 ]; then - echo "✅ iOS simulator build succeeded!" - else + build | xcpretty + then echo "❌ iOS simulator build failed." exit 1 fi From 90e4525016654e061df1e5483cfaefa6eb74789f Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Thu, 23 Jan 2025 16:27:22 -0700 Subject: [PATCH 19/23] Fix Android shell check lint issues --- .github/workflows/verifyHybridApp.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index ca0f182910bd..46fdce89d4a9 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -44,10 +44,8 @@ jobs: - name: Build Android Debug working-directory: Mobile-Expensify/Android run: | - ./gradlew assembleDebug - if [ $? -eq 0 ]; then - echo "✅ Android debug build succeeded!" - else + if ! ./gradlew assembleDebug + then echo "❌ Android debug build failed." exit 1 fi From a30b7ed0a8b1fa12e14356be4ba7575ea15c086b Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 24 Jan 2025 09:05:37 -0700 Subject: [PATCH 20/23] Add paths for HybridApp build to limit number of builds --- .github/workflows/verifyHybridApp.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index 46fdce89d4a9..a99ae2ab5ddb 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -1,10 +1,20 @@ -name: Verify HybridApp builds on main +name: Verify HybridApp build on: workflow_call: pull_request: types: [opened, synchronize] branches-ignore: [staging, production] + paths: + - '**.kt' + - '**.java' + - '**.swift' + - '**.mm' + - '**.h' + - '**.cpp' + - 'AndroidManifest.xml' + - 'project.pbxproj' + - 'package.json' concurrency: group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-verify-main @@ -25,7 +35,10 @@ jobs: fetch-depth: 0 - name: Update submodule to match main - run: git submodule update --init --remote + run: | + git submodule update --init --remote + git fetch + git checkout main - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} @@ -66,7 +79,6 @@ jobs: - name: Update submodule to match main run: | git submodule update --init --remote - # TODO: Remove these two lines before merging git fetch git checkout main From a0b05da65cc8b5a5cbb45dd391b53617855864c6 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 24 Jan 2025 09:22:32 -0700 Subject: [PATCH 21/23] Revert unused changes --- Mobile-Expensify | 2 +- fastlane/Fastfile | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index ab739a4323aa..e8427456032e 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit ab739a4323aa88bb323e42040cc727cef818d9f9 +Subproject commit e8427456032e803863da64610f17a2ea948b9b75 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 97b8f67d7d7a..806ffe574031 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -119,7 +119,9 @@ platform :android do ENV["ENVFILE"]="Mobile-Expensify/.env.production.hybridapp.android" gradle( project_dir: 'Mobile-Expensify/Android', - task: "bundleDebug" + task: 'assemble', + flavor: 'Production', + build_type: 'Release', ) setGradleOutputsInEnv() end @@ -466,8 +468,7 @@ platform :ios do ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp.ios" build_app( workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace", - scheme: "Expensify", - configuration: "Debug" + scheme: "Expensify" ) setIOSBuildOutputsInEnv() end From 17427b38f2274adc59550ef95d3b1e56e5d5e08d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 24 Jan 2025 10:51:59 -0700 Subject: [PATCH 22/23] Clean up code --- .github/workflows/verifyHybridApp.yml | 14 ++------------ Mobile-Expensify | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index a99ae2ab5ddb..ffe2bdf6ac44 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -49,17 +49,12 @@ jobs: with: IS_HYBRID_BUILD: 'true' - - name: Run grunt build - run: | - cd Mobile-Expensify - npm run grunt:build:shared - - name: Build Android Debug working-directory: Mobile-Expensify/Android run: | if ! ./gradlew assembleDebug then - echo "❌ Android debug build failed." + echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve." exit 1 fi @@ -91,11 +86,6 @@ jobs: with: IS_HYBRID_BUILD: 'true' - - name: Run grunt build - run: | - cd Mobile-Expensify - npm run grunt:build:shared - - name: Setup Ruby uses: ruby/setup-ruby@v1.204.0 with: @@ -143,6 +133,6 @@ jobs: CODE_SIGNING_ALLOWED=NO \ build | xcpretty then - echo "❌ iOS simulator build failed." + echo "❌ iOS HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve." exit 1 fi diff --git a/Mobile-Expensify b/Mobile-Expensify index e8427456032e..a7c031acf6fa 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit e8427456032e803863da64610f17a2ea948b9b75 +Subproject commit a7c031acf6faace59e275dc9bf28366c897eae00 From 0319348d726e1659344a1c01a028249a289b451d Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 24 Jan 2025 14:37:47 -0700 Subject: [PATCH 23/23] Update paths --- .github/workflows/verifyHybridApp.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verifyHybridApp.yml b/.github/workflows/verifyHybridApp.yml index ffe2bdf6ac44..b3db2c37d4d7 100644 --- a/.github/workflows/verifyHybridApp.yml +++ b/.github/workflows/verifyHybridApp.yml @@ -12,9 +12,12 @@ on: - '**.mm' - '**.h' - '**.cpp' - - 'AndroidManifest.xml' - - 'project.pbxproj' - 'package.json' + - 'patches/**' + - 'android/build.gradle' + - 'android/AndroidManifest.xml' + - 'ios/Podfile.lock' + - 'ios/project.pbxproj' concurrency: group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-verify-main