Skip to content

Commit 4c54937

Browse files
Merge branch 'main' of github.com:callstack-internal/Expensify-App into improve-import-onyx-performance
2 parents a0a25ee + 4016070 commit 4c54937

File tree

210 files changed

+3866
-2083
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+3866
-2083
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ EXPENSIFY_ACCOUNT_ID_RECEIPTS=-1
3030
EXPENSIFY_ACCOUNT_ID_REWARDS=-1
3131
EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR=-1
3232
EXPENSIFY_ACCOUNT_ID_SVFG=-1
33+
EXPENSIFY_ACCOUNT_ID_MANAGER_MCTEST=-1
3334

3435
FB_API_KEY=YOUR_API_KEY
3536
FB_APP_ID=YOUR_APP_ID

.github/workflows/cherryPick.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
with:
4040
ref: staging
4141
token: ${{ secrets.OS_BOTIFY_TOKEN }}
42+
submodules: true
4243

4344
- name: Set up git for OSBotify
4445
id: setupGitForOSBotify

.github/workflows/commentOnNativeFileChanged.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build and profile Android apps
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
buildHybridAppAndroid:
8+
name: Build HybridApp Android
9+
runs-on: ubuntu-latest-xl
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
submodules: true
15+
token: ${{ secrets.OS_BOTIFY_TOKEN }}
16+
17+
- name: Update submodule to match main
18+
run: |
19+
git submodule update --init --remote
20+
cd Mobile-Expensify
21+
git fetch
22+
git checkout main
23+
24+
- name: Configure MapBox SDK
25+
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
26+
27+
- name: Setup Node
28+
id: setup-node
29+
uses: ./.github/actions/composite/setupNode
30+
with:
31+
IS_HYBRID_BUILD: 'true'
32+
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/[email protected]
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+
75+
- name: Build Android Release
76+
working-directory: Mobile-Expensify/Android
77+
run: |
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"
88+
89+
buildStandaloneAndroid:
90+
name: Build Standalone Android
91+
runs-on: ubuntu-latest-xl
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v4
95+
with:
96+
token: ${{ secrets.OS_BOTIFY_TOKEN }}
97+
98+
- name: Configure MapBox SDK
99+
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
100+
101+
- name: Setup Node
102+
id: setup-node
103+
uses: ./.github/actions/composite/setupNode
104+
with:
105+
IS_HYBRID_BUILD: 'false'
106+
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+
111+
- name: Build Android Release
112+
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 }}
116+
run: |
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"

.github/workflows/createNewVersion.yml

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
uses: actions/checkout@v4
6666
with:
6767
ref: main
68+
submodules: true
6869
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
6970
# This is a workaround to allow pushes to a protected branch
7071
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
@@ -75,70 +76,24 @@ jobs:
7576
with:
7677
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
7778

78-
- name: Generate version
79+
- name: Generate new E/App version
7980
id: bumpVersion
8081
uses: ./.github/actions/javascript/bumpVersion
8182
with:
8283
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
8384
SEMVER_LEVEL: ${{ inputs.SEMVER_LEVEL }}
8485

85-
- name: Commit new version
86-
run: |
87-
git add \
88-
./package.json \
89-
./package-lock.json \
90-
./android/app/build.gradle \
91-
./ios/NewExpensify/Info.plist \
92-
./ios/NewExpensifyTests/Info.plist \
93-
./ios/NotificationServiceExtension/Info.plist
94-
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
95-
96-
- name: Update main branch
97-
run: git push origin main
98-
99-
- name: Announce failed workflow in Slack
100-
if: ${{ failure() }}
101-
uses: ./.github/actions/composite/announceFailedWorkflowInSlack
102-
with:
103-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
104-
105-
createNewHybridVersion:
106-
runs-on: macos-latest
107-
needs: [validateActor, createNewVersion]
108-
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
109-
steps:
110-
- name: Run turnstyle
111-
uses: softprops/turnstyle@49108bdfa571e62371bd2c3094893c547ab3fc03
112-
with:
113-
poll-interval-seconds: 10
114-
env:
115-
GITHUB_TOKEN: ${{ github.token }}
116-
117-
- name: Check out `App` repo
118-
uses: actions/checkout@v4
119-
with:
120-
ref: main
121-
submodules: true
122-
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
123-
# This is a workaround to allow pushes to a protected branch
124-
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
125-
126-
- name: Update submodule and checkout the main branch
86+
- name: Update Mobile-Expensify submodule with the latest state of the Mobile-Expensify main branch
12787
run: |
128-
git submodule update --init
12988
cd Mobile-Expensify
89+
git fetch --depth=1 origin main
13090
git checkout main
131-
git pull origin main
132-
133-
- name: Setup git for OSBotify
134-
uses: ./.github/actions/composite/setupGitForOSBotify
135-
id: setupGitForOSBotify
136-
with:
137-
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
91+
git reset --hard origin/main
13892
13993
- name: Generate HybridApp version
14094
run: |
14195
cd Mobile-Expensify
96+
14297
# Generate all flavors of the version
14398
SHORT_APP_VERSION=$(echo "$NEW_VERSION" | awk -F'-' '{print $1}')
14499
BUILD_NUMBER=$(echo "$NEW_VERSION" | awk -F'-' '{print $2}')
@@ -167,9 +122,9 @@ jobs:
167122
# Update JS HybridApp Version
168123
sed -i .bak -E "s/\"version\": \"([0-9\.]*)\"/\"version\": \"$FULL_APP_VERSION\"/" $JS_CONFIG_FILE
169124
env:
170-
NEW_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }}
125+
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
171126

172-
- name: Commit new version
127+
- name: Commit new Mobile-Expensify version
173128
run: |
174129
cd Mobile-Expensify
175130
git add \
@@ -178,16 +133,21 @@ jobs:
178133
./iOS/Expensify/Expensify-Info.plist\
179134
./iOS/SmartScanExtension/Info.plist \
180135
./iOS/NotificationServiceExtension/Info.plist
181-
git commit -m "Update version to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
136+
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
137+
git push origin main
182138
183-
- name: Update main branch on Mobile-Expensify and App
139+
- name: Commit new E/App version
184140
run: |
185-
cd Mobile-Expensify
141+
git add \
142+
./Mobile-Expensify \
143+
./package.json \
144+
./package-lock.json \
145+
./android/app/build.gradle \
146+
./ios/NewExpensify/Info.plist \
147+
./ios/NewExpensifyTests/Info.plist \
148+
./ios/NotificationServiceExtension/Info.plist
149+
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
186150
git push origin main
187-
cd ..
188-
git add Mobile-Expensify
189-
git commit -m "Update Mobile-Expensify to ${{ needs.createNewVersion.outputs.NEW_VERSION }}"
190-
git push origin main
191151
192152
- name: Announce failed workflow in Slack
193153
if: ${{ failure() }}

.github/workflows/testBuildHybrid.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
const pullRequest = await github.rest.pulls.get({
7878
owner: context.repo.owner,
7979
repo: context.repo.repo,
80-
pull_number: '${{ env.PULL_REQUEST_NUMBER }}'',
80+
pull_number: '${{ env.PULL_REQUEST_NUMBER }}',
8181
});
8282
8383
const body = pullRequest.data.body;
@@ -89,7 +89,6 @@ jobs:
8989
getOldDotBranchRef:
9090
runs-on: ubuntu-latest
9191
needs: getOldDotPR
92-
if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }}
9392
outputs:
9493
OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }}
9594
steps:
@@ -100,9 +99,13 @@ jobs:
10099
id: getHeadRef
101100
run: |
102101
set -e
103-
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R 'Expensify/Mobile-Expensify' --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
102+
if [[ ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} == '' ]]; then
103+
echo "REF=" >> "$GITHUB_OUTPUT"
104+
else
105+
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R Expensify/Mobile-Expensify --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
106+
fi
104107
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
106109

107110

108111
postGitHubCommentBuildStarted:
@@ -148,7 +151,7 @@ jobs:
148151
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
149152
run: |
150153
cd Mobile-Expensify
151-
git fetch
154+
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
152155
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
153156
154157
- name: Configure MapBox SDK
@@ -259,7 +262,7 @@ jobs:
259262
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
260263
run: |
261264
cd Mobile-Expensify
262-
git fetch
265+
git fetch origin ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
263266
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
264267
265268
- name: Configure MapBox SDK
@@ -311,9 +314,9 @@ jobs:
311314
env:
312315
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
313316
run: |
314-
op document get --output ./OldApp_AdHoc.mobileprovision OldApp_AdHoc
315-
op document get --output ./OldApp_AdHoc_Share_Extension.mobileprovision OldApp_AdHoc_Share_Extension
316-
op document get --output ./OldApp_AdHoc_Notification_Service.mobileprovision OldApp_AdHoc_Notification_Service
317+
op read op://Mobile-Deploy-CI/OldApp_AdHoc/OldApp_AdHoc.mobileprovision --force --out-file ./OldApp_AdHoc.mobileprovision
318+
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Share_Extension/OldApp_AdHoc_Share_Extension.mobileprovision --force --out-file ./OldApp_AdHoc_Share_Extension.mobileprovision
319+
op read op://Mobile-Deploy-CI/OldApp_AdHoc_Notification_Service/OldApp_AdHoc_Notification_Service.mobileprovision --force --out-file ./OldApp_AdHoc_Notification_Service.mobileprovision
317320
318321
- name: Decrypt certificate
319322
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output Certificates.p12 Certificates.p12.gpg

Mobile-Expensify

0 commit comments

Comments
 (0)