From 2f08a6d98e6237300b4c199f3702dbdb55311add Mon Sep 17 00:00:00 2001
From: Andrew Gable <andrew@expensify.com>
Date: Mon, 28 Jul 2025 14:38:16 -0600
Subject: [PATCH 1/4] Add upload of iOS and Android to Applause

---
 .github/workflows/deploy.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index f2f1aa1075b7..b8ab28869e5e 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -151,6 +151,7 @@ jobs:
           ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
           ANDROID_UPLOAD_KEYSTORE_ALIAS: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
           ANDROID_UPLOAD_KEY_PASSWORD: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD
+          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Repository-Secrets/APPLAUSE_API_KEY
 
       - name: Get Android native version
         id: getAndroidVersion
@@ -229,6 +230,10 @@ jobs:
           # Unzip just the universal apk
           unzip -p Expensify.apks universal.apk > Expensify.apk
 
+      - name: Upload Android build to Applause
+        if: ${{ fromJSON(env.IS_APP_REPO) && (github.ref == 'refs/heads/staging' || fromJSON(needs.prep.outputs.IS_CHERRY_PICK)) }}
+        run: curl -F "file=@Expensify.apk" "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36008" -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
+
       - name: Upload Android APK build artifact
         if: ${{ fromJSON(env.SHOULD_BUILD_APP) }}
         # v4
@@ -395,6 +400,15 @@ jobs:
           op read "op://${{ vars.OP_VAULT }}/ios-fastlane-json-key.json/ios-fastlane-json-key.json" --force --out-file ./ios-fastlane-json-key.json
           op read "op://${{ vars.OP_VAULT }}/New Expensify Distribution Certificate/Certificates.p12" --force --out-file ./Certificates.p12
 
+      - name: Load iOS credentials from 1Password
+        id: load-credentials
+        # v2
+        uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
+        with:
+          export-env: false
+        env:
+          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Repository-Secrets/APPLAUSE_API_KEY
+
       - name: Set current App version in Env
         run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
 
@@ -446,6 +460,10 @@ jobs:
         env:
           BROWSERSTACK: ${{ secrets.BROWSERSTACK }}
 
+      - name: Upload iOS build to Applause
+        if: ${{ fromJSON(env.IS_APP_REPO) && fromJSON(env.SHOULD_BUILD_APP) }}
+        run: curl -F "file=@${{ env.ipaPath }}" "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36005" -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
+
       - name: Upload iOS build artifact
         if: ${{ fromJSON(env.SHOULD_BUILD_APP) }}
         # v4

From 913750fb8fe004912c4f7081a0c123eb34f93443 Mon Sep 17 00:00:00 2001
From: Andrew Gable <andrew@expensify.com>
Date: Mon, 28 Jul 2025 14:43:37 -0600
Subject: [PATCH 2/4] Fix password path in 1P

---
 .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 b8ab28869e5e..2a32c1e67813 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -151,7 +151,7 @@ jobs:
           ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
           ANDROID_UPLOAD_KEYSTORE_ALIAS: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
           ANDROID_UPLOAD_KEY_PASSWORD: op://${{ vars.OP_VAULT }}/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD
-          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Repository-Secrets/APPLAUSE_API_KEY
+          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Applause-API-Key/password
 
       - name: Get Android native version
         id: getAndroidVersion
@@ -407,7 +407,7 @@ jobs:
         with:
           export-env: false
         env:
-          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Repository-Secrets/APPLAUSE_API_KEY
+          APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Applause-API-Key/password
 
       - name: Set current App version in Env
         run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"

From 27d2e896709ce455d21df3fb5c42319a0239b2c8 Mon Sep 17 00:00:00 2001
From: Andrew Gable <andrew@expensify.com>
Date: Mon, 28 Jul 2025 14:47:21 -0600
Subject: [PATCH 3/4] Fix syntax error

---
 .github/workflows/deploy.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 2a32c1e67813..f0fd5e0632c0 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -407,6 +407,7 @@ jobs:
         with:
           export-env: false
         env:
+          OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
           APPLAUSE_API_KEY: op://${{ vars.OP_VAULT }}/Applause-API-Key/password
 
       - name: Set current App version in Env

From 6bcde924e3628df2f8ee4069526ff84d018e38e0 Mon Sep 17 00:00:00 2001
From: Andrew Gable <andrew@expensify.com>
Date: Mon, 28 Jul 2025 14:52:12 -0600
Subject: [PATCH 4/4] Use multi line curl

---
 .github/workflows/deploy.yml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index f0fd5e0632c0..67fcd94a58bb 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -232,7 +232,10 @@ jobs:
 
       - name: Upload Android build to Applause
         if: ${{ fromJSON(env.IS_APP_REPO) && (github.ref == 'refs/heads/staging' || fromJSON(needs.prep.outputs.IS_CHERRY_PICK)) }}
-        run: curl -F "file=@Expensify.apk" "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36008" -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
+        run: |
+          curl -F "file=@Expensify.apk" \
+            "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36008" \
+            -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
 
       - name: Upload Android APK build artifact
         if: ${{ fromJSON(env.SHOULD_BUILD_APP) }}
@@ -463,7 +466,10 @@ jobs:
 
       - name: Upload iOS build to Applause
         if: ${{ fromJSON(env.IS_APP_REPO) && fromJSON(env.SHOULD_BUILD_APP) }}
-        run: curl -F "file=@${{ env.ipaPath }}" "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36005" -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
+        run: |
+          curl -F "file=@${{ env.ipaPath }}" \
+            "https://api.applause.com/v2/builds?name=Expensify_${{ needs.prep.outputs.TAG }}&productId=36005" \
+            -H "X-Api-Key: ${{ steps.load-credentials.outputs.APPLAUSE_API_KEY }}"
 
       - name: Upload iOS build artifact
         if: ${{ fromJSON(env.SHOULD_BUILD_APP) }}
