From 158de252732f877078509553729c697e2b6d2f93 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 21 Nov 2024 13:45:26 +0100 Subject: [PATCH] Adjust HybridApp deployment to the added submodule --- .github/workflows/deploy.yml | 43 ++++++------------------------------ fastlane/Fastfile | 16 +++++++------- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1447bbf20c6d..84492faa8f02 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -167,18 +167,13 @@ jobs: name: Build and deploy Android HybridApp needs: prep runs-on: ubuntu-latest-xl - defaults: - run: - working-directory: Mobile-Expensify/react-native env: RUBYOPT: '-rostruct' steps: - name: Checkout uses: actions/checkout@v4 with: - repository: 'Expensify/Mobile-Expensify' 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 @@ -193,19 +188,9 @@ jobs: - name: Configure MapBox SDK run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} - - uses: actions/setup-node@v4 - with: - node-version-file: 'Mobile-Expensify/react-native/.nvmrc' - cache: npm - cache-dependency-path: 'Mobile-Expensify/react-native' - - - name: Install node modules - run: | - npm install - cd .. && npm install - - # Fixes https://github.com/Expensify/App/issues/51682 - npm run grunt:build:shared + - name: Setup Node + id: setup-node + uses: ./.github/actions/composite/setupNode - name: Setup Java uses: actions/setup-java@v4 @@ -217,7 +202,6 @@ jobs: uses: ruby/setup-ruby@v1.190.0 with: bundler-cache: true - working-directory: 'Mobile-Expensify/react-native' - name: Install New Expensify Gems run: bundle install @@ -232,7 +216,7 @@ jobs: op document get --output ./upload-key.keystore upload-key.keystore op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json # Copy the keystore to the Android directory for Fullstory - cp ./upload-key.keystore ../Android + cp ./upload-key.keystore Mobile-Expensify/Android - name: Load Android upload keystore credentials from 1Password id: load-credentials @@ -487,16 +471,11 @@ jobs: runs-on: macos-13-xlarge env: DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer - defaults: - run: - working-directory: Mobile-Expensify/react-native steps: - name: Checkout uses: actions/checkout@v4 with: - repository: 'Expensify/Mobile-Expensify' 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 @@ -512,22 +491,14 @@ jobs: run: | ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} - - uses: actions/setup-node@v4 + - name: Setup Node id: setup-node - with: - node-version-file: 'Mobile-Expensify/react-native/.nvmrc' - cache-dependency-path: 'Mobile-Expensify/react-native' - - - name: Install node modules - run: | - npm install - cd .. && npm install + uses: ./.github/actions/composite/setupNode - name: Setup Ruby uses: ruby/setup-ruby@v1.190.0 with: bundler-cache: true - working-directory: 'Mobile-Expensify/react-native' - name: Install New Expensify Gems run: bundle install @@ -549,7 +520,7 @@ jobs: with: timeout_minutes: 10 max_attempts: 5 - command: cd Mobile-Expensify/iOS && pod install + command: npm run pod-install - name: Install 1Password CLI uses: 1password/install-cli-action@v1 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1c8b62cfb579..697923dcfc30 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -71,9 +71,9 @@ platform :android do desc "Generate a production HybridApp AAB" lane :build_hybrid do - ENV["ENVFILE"]="../.env.production.hybridapp" + ENV["ENVFILE"]="Mobile-Expensify/.env.production.hybridapp" gradle( - project_dir: '../Android', + project_dir: 'Mobile-Expensify/Android', task: "bundleRelease", flags: "--refresh-dependencies", properties: { @@ -102,7 +102,7 @@ platform :android do lane :build_local_hybrid do ENV["ENVFILE"]=".env.production" gradle( - project_dir: '../Android', + project_dir: 'Mobile-Expensify/Android', task: 'assemble', flavor: 'Production', build_type: 'Release', @@ -353,7 +353,7 @@ platform :ios do desc "Build an iOS HybridApp production build" lane :build_hybrid do - ENV["ENVFILE"]="../.env.production.hybridapp" + ENV["ENVFILE"]="Mobile-Expensify/.env.production.hybridapp" setupIOSSigningCertificate() @@ -366,7 +366,7 @@ platform :ios do ) build_app( - workspace: "../iOS/Expensify.xcworkspace", + workspace: "Mobile-Expensify/iOS/Expensify.xcworkspace", scheme: "Expensify", output_name: "Expensify.ipa", export_method: "app-store", @@ -394,9 +394,9 @@ platform :ios do desc "Build an unsigned iOS HybridApp production build" lane :build_unsigned_hybrid do - ENV["ENVFILE"]="../Mobile-Expensify/.env.production.hybridapp" + ENV["ENVFILE"]="./Mobile-Expensify/.env.production.hybridapp" build_app( - workspace: "../Mobile-Expensify/iOS/Expensify.xcworkspace", + workspace: "./Mobile-Expensify/iOS/Expensify.xcworkspace", scheme: "Expensify" ) setIOSBuildOutputsInEnv() @@ -513,7 +513,7 @@ platform :ios do dsym_path: ENV[KEY_DSYM_PATH], gsp_path: "./ios/GoogleService-Info.plist", # Assuming we are running this from the react-native submodule directory for HybridApp - binary_path: "../iOS/Pods/FirebaseCrashlytics/upload-symbols" + binary_path: "./Mobile-Expensify/iOS/Pods/FirebaseCrashlytics/upload-symbols" ) end