Skip to content

Commit a32c86b

Browse files
authored
Merge pull request #55951 from software-mansion-labs/war-in/create-key-in-compare-workflow
[No QA] Fix profiling workflow by generating signing keys
2 parents 571a5ec + 65ac51d commit a32c86b

File tree

1 file changed

+67
-22
lines changed

1 file changed

+67
-22
lines changed

.github/workflows/compareNDandODbuilds.yml

+67-22
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
buildHybridAppAndroid:
88
name: Build HybridApp Android
9-
runs-on: macos-15-xlarge
9+
runs-on: ubuntu-latest-xl
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
@@ -30,23 +30,65 @@ jobs:
3030
with:
3131
IS_HYBRID_BUILD: 'true'
3232

33+
- name: Run grunt build
34+
run: |
35+
cd Mobile-Expensify
36+
npm run grunt:build:shared
37+
38+
- name: Setup Java
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: 'oracle'
42+
java-version: '17'
43+
44+
- name: Setup Ruby
45+
uses: ruby/setup-ruby@v1.190.0
46+
with:
47+
bundler-cache: true
48+
49+
- name: Install New Expensify Gems
50+
run: bundle install
51+
52+
- name: Install 1Password CLI
53+
uses: 1password/install-cli-action@v1
54+
55+
- name: Load files from 1Password
56+
env:
57+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
58+
run: |
59+
op document get --output ./upload-key.keystore upload-key.keystore
60+
op document get --output ./android-fastlane-json-key.json android-fastlane-json-key.json
61+
# Copy the keystore to the Android directory for Fullstory
62+
cp ./upload-key.keystore Mobile-Expensify/Android
63+
64+
- name: Load Android upload keystore credentials from 1Password
65+
id: load-credentials
66+
uses: 1password/load-secrets-action@v2
67+
with:
68+
export-env: false
69+
env:
70+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
71+
ANDROID_UPLOAD_KEYSTORE_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_PASSWORD
72+
ANDROID_UPLOAD_KEYSTORE_ALIAS: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEYSTORE_ALIAS
73+
ANDROID_UPLOAD_KEY_PASSWORD: op://Mobile-Deploy-CI/Repository-Secrets/ANDROID_UPLOAD_KEY_PASSWORD
74+
3375
- name: Build Android Release
3476
working-directory: Mobile-Expensify/Android
3577
run: |
36-
if ! ./gradlew --profile assembleRelease
37-
then
38-
echo "❌ Android HybridApp failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
39-
exit 1
40-
else
41-
echo "✅ Build succeeded. Printing Gradle profile report:"
42-
# Print the latest generated profile report
43-
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
44-
cat "$PROFILE_REPORT"
45-
fi
78+
./gradlew --profile assembleRelease \
79+
-Pandroid.injected.signing.store.file="./upload-key.keystore" \
80+
-Pandroid.injected.signing.store.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_PASSWORD }} \
81+
-Pandroid.injected.signing.key.alias=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEYSTORE_ALIAS }} \
82+
-Pandroid.injected.signing.key.password=${{ steps.load-credentials.outputs.ANDROID_UPLOAD_KEY_PASSWORD }}
83+
84+
echo "Printing Gradle profile report:"
85+
# Print the latest generated profile report
86+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
87+
cat "$PROFILE_REPORT"
4688
4789
buildStandaloneAndroid:
4890
name: Build Standalone Android
49-
runs-on: macos-15-xlarge
91+
runs-on: ubuntu-latest-xl
5092
steps:
5193
- name: Checkout
5294
uses: actions/checkout@v4
@@ -62,16 +104,19 @@ jobs:
62104
with:
63105
IS_HYBRID_BUILD: 'false'
64106

107+
- name: Decrypt keystore to sign the APK/AAB
108+
run: gpg --batch --yes --decrypt --passphrase="${{ secrets.LARGE_SECRET_PASSPHRASE }}" --output my-upload-key.keystore my-upload-key.keystore.gpg
109+
working-directory: android/app
110+
65111
- name: Build Android Release
66112
working-directory: android
113+
env:
114+
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
115+
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
67116
run: |
68-
if ! ./gradlew --profile assembleProductionRelease
69-
then
70-
echo "❌ Android Standalone failed to build: Please reach out to Contributor+ and/or Expensify engineers for help in #expensify-open-source to resolve."
71-
exit 1
72-
else
73-
echo "✅ Build succeeded. Printing Gradle profile report:"
74-
# Print the latest generated profile report
75-
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
76-
cat "$PROFILE_REPORT"
77-
fi
117+
./gradlew --profile assembleProductionRelease
118+
119+
echo "Printing Gradle profile report:"
120+
# Print the latest generated profile report
121+
PROFILE_REPORT=$(find build/reports/profile -maxdepth 1 -type f)
122+
cat "$PROFILE_REPORT"

0 commit comments

Comments
 (0)