Skip to content

Commit fc75795

Browse files
committed
Merge branch 'main' into paulnjs-fix/73057
2 parents 5cbe800 + c37adec commit fc75795

154 files changed

Lines changed: 3082 additions & 1029 deletions

File tree

Some content is hidden

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

.github/actions/composite/setupNode/action.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ inputs:
66
description: "Indicates if node is set up for hybrid app"
77
required: false
88
default: 'false'
9+
IS_DESKTOP_BUILD:
10+
description: "Indicates if node is set up for desktop app"
11+
required: false
12+
default: 'false'
913

1014
outputs:
1115
cache-hit:
@@ -23,7 +27,9 @@ runs:
2327
with:
2428
node-version-file: '.nvmrc'
2529
cache: npm
26-
cache-dependency-path: normalized-package-lock.json
30+
cache-dependency-path: |
31+
normalized-package-lock.json
32+
desktop/package-lock.json
2733
2834
- id: cache-node-modules
2935
# v4
@@ -40,6 +46,14 @@ runs:
4046
path: Mobile-Expensify/node_modules
4147
key: ${{ runner.os }}-node-modules-${{ hashFiles('Mobile-Expensify/package-lock.json', 'Mobile-Expensify/patches/**') }}
4248

49+
- id: cache-desktop-node-modules
50+
if: inputs.IS_DESKTOP_BUILD == 'true'
51+
# v4
52+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
53+
with:
54+
path: desktop/node_modules
55+
key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json', 'desktop/patches/**') }}
56+
4357
- name: Remove ND node_modules if needed for hybrid app build
4458
if: inputs.IS_HYBRID_BUILD == 'true' && steps.cache-node-modules.outputs.cache-hit == 'true' && steps.cache-old-dot-node-modules.outputs.cache-hit != 'true'
4559
shell: bash
@@ -51,4 +65,12 @@ runs:
5165
with:
5266
timeout_minutes: 30
5367
max_attempts: 3
54-
command: npm ci
68+
command: npm ci
69+
70+
- name: Install node packages for desktop submodule
71+
if: inputs.IS_DESKTOP_BUILD == 'true' && steps.cache-desktop-node-modules.outputs.cache-hit != 'true'
72+
uses: nick-fields/retry@3f757583fb1b1f940bc8ef4bf4734c8dc02a5847
73+
with:
74+
timeout_minutes: 30
75+
max_attempts: 3
76+
command: cd desktop && npm ci

.github/actions/javascript/markPullRequestsAsDeployed/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
ANDROID:
2121
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
2222
required: true
23+
DESKTOP:
24+
description: "Desktop job result ('success', 'failure', 'cancelled', or 'skipped')"
25+
required: true
2326
IOS:
2427
description: "iOS job result ('success', 'failure', 'cancelled', or 'skipped')"
2528
required: true

.github/actions/javascript/markPullRequestsAsDeployed/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12840,6 +12840,7 @@ async function run() {
1284012840
const isProd = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', { required: true });
1284112841
const version = core.getInput('DEPLOY_VERSION', { required: true });
1284212842
const androidResult = getDeployTableMessage(core.getInput('ANDROID', { required: true }));
12843+
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', { required: true }));
1284312844
const iOSResult = getDeployTableMessage(core.getInput('IOS', { required: true }));
1284412845
const webResult = getDeployTableMessage(core.getInput('WEB', { required: true }));
1284512846
const date = core.getInput('DATE');
@@ -12851,7 +12852,7 @@ async function run() {
1285112852
message += `on ${date}`;
1285212853
}
1285312854
message += `🚀`;
12854-
message += `\n\nplatform | result\n---|---`;
12855+
message += `\n\nplatform | result\n---|---\n🖥 desktop 🖥|${desktopResult}`;
1285512856
message += `\n🕸 web 🕸|${webResult}`;
1285612857
message += `\n🤖 android 🤖|${androidResult}\n🍎 iOS 🍎|${iOSResult}`;
1285712858
if (note) {

.github/actions/javascript/markPullRequestsAsDeployed/markPullRequestsAsDeployed.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ async function run() {
103103
const version = core.getInput('DEPLOY_VERSION', {required: true});
104104

105105
const androidResult = getDeployTableMessage(core.getInput('ANDROID', {required: true}) as PlatformResult);
106+
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: true}) as PlatformResult);
106107
const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true}) as PlatformResult);
107108
const webResult = getDeployTableMessage(core.getInput('WEB', {required: true}) as PlatformResult);
108109

@@ -116,7 +117,7 @@ async function run() {
116117
message += `on ${date}`;
117118
}
118119
message += `🚀`;
119-
message += `\n\nplatform | result\n---|---`;
120+
message += `\n\nplatform | result\n---|---\n🖥 desktop 🖥|${desktopResult}`;
120121
message += `\n🕸 web 🕸|${webResult}`;
121122
message += `\n🤖 android 🤖|${androidResult}\n🍎 iOS 🍎|${iOSResult}`;
122123

.github/actions/javascript/postTestBuildComment/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ inputs:
1616
ANDROID:
1717
description: "Android job result ('success', 'failure', 'cancelled', or 'skipped')"
1818
required: false
19+
DESKTOP:
20+
description: "Desktop job result ('success', 'failure', 'cancelled', or 'skipped')"
21+
required: false
1922
IOS:
2023
description: "iOS job result ('success', 'failure', 'cancelled', or 'skipped')"
2124
required: false
@@ -25,6 +28,9 @@ inputs:
2528
ANDROID_LINK:
2629
description: "Link for the Android build"
2730
required: false
31+
DESKTOP_LINK:
32+
description: "Link for the desktop build"
33+
required: false
2834
IOS_LINK:
2935
description: "Link for the iOS build"
3036
required: false

.github/actions/javascript/postTestBuildComment/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11585,11 +11585,12 @@ const github_1 = __nccwpck_require__(5438);
1158511585
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1158611586
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
1158711587
function getTestBuildMessage(appPr, mobileExpensifyPr) {
11588-
const inputs = ['ANDROID', 'IOS', 'WEB'];
11588+
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'];
1158911589
const names = {
1159011590
[inputs[0]]: 'Android',
11591-
[inputs[1]]: 'iOS',
11592-
[inputs[2]]: 'Web',
11591+
[inputs[1]]: 'Desktop',
11592+
[inputs[2]]: 'iOS',
11593+
[inputs[3]]: 'Web',
1159311594
};
1159411595
const result = inputs.reduce((acc, platform) => {
1159511596
const input = core.getInput(platform, { required: false });
@@ -11618,17 +11619,17 @@ function getTestBuildMessage(appPr, mobileExpensifyPr) {
1161811619
};
1161911620
return acc;
1162011621
}, {});
11621-
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', and Web' : ''}. Happy testing! :test_tube::test_tube:
11622+
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', Desktop, and Web' : ''}. Happy testing! :test_tube::test_tube:
1162211623
Built from${appPr ? ` App PR Expensify/App#${appPr}` : ''}${mobileExpensifyPr ? ` Mobile-Expensify PR Expensify/Mobile-Expensify#${mobileExpensifyPr}` : ''}.
1162311624
| Android :robot: | iOS :apple: |
1162411625
| ------------- | ------------- |
1162511626
| ${result.ANDROID.link} | ${result.IOS.link} |
1162611627
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
1162711628

11628-
| Web :spider_web: |
11629-
| ------------- |
11630-
| ${result.WEB.link} |
11631-
| ${result.WEB.qrCode} |
11629+
| Desktop :computer: | Web :spider_web: |
11630+
| ------------- | ------------- |
11631+
| ${result.DESKTOP.link} | ${result.WEB.link} |
11632+
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
1163211633

1163311634
---
1163411635

.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import CONST from '@github/libs/CONST';
55
import GithubUtils from '@github/libs/GithubUtils';
66

77
function getTestBuildMessage(appPr?: number, mobileExpensifyPr?: number): string {
8-
const inputs = ['ANDROID', 'IOS', 'WEB'] as const;
8+
const inputs = ['ANDROID', 'DESKTOP', 'IOS', 'WEB'] as const;
99
const names = {
1010
[inputs[0]]: 'Android',
11-
[inputs[1]]: 'iOS',
12-
[inputs[2]]: 'Web',
11+
[inputs[1]]: 'Desktop',
12+
[inputs[2]]: 'iOS',
13+
[inputs[3]]: 'Web',
1314
};
1415

1516
const result = inputs.reduce(
@@ -46,17 +47,17 @@ function getTestBuildMessage(appPr?: number, mobileExpensifyPr?: number): string
4647
{} as Record<TupleToUnion<typeof inputs>, {link: string; qrCode: string}>,
4748
);
4849

49-
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', and Web' : ''}. Happy testing! :test_tube::test_tube:
50+
const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS${appPr ? ', Desktop, and Web' : ''}. Happy testing! :test_tube::test_tube:
5051
Built from${appPr ? ` App PR Expensify/App#${appPr}` : ''}${mobileExpensifyPr ? ` Mobile-Expensify PR Expensify/Mobile-Expensify#${mobileExpensifyPr}` : ''}.
5152
| Android :robot: | iOS :apple: |
5253
| ------------- | ------------- |
5354
| ${result.ANDROID.link} | ${result.IOS.link} |
5455
| ${result.ANDROID.qrCode} | ${result.IOS.qrCode} |
5556
56-
| Web :spider_web: |
57-
| ------------- |
58-
| ${result.WEB.link} |
59-
| ${result.WEB.qrCode} |
57+
| Desktop :computer: | Web :spider_web: |
58+
| ------------- | ------------- |
59+
| ${result.DESKTOP.link} | ${result.WEB.link} |
60+
| ${result.DESKTOP.qrCode} | ${result.WEB.qrCode} |
6061
6162
---
6263

.github/workflows/checkE2ETestCode.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
- name: Setup Node
2121
uses: ./.github/actions/composite/setupNode
22+
with:
23+
IS_DESKTOP_BUILD: 'true'
2224

2325
- name: Verify e2e tests compile correctly
2426
run: npm run e2e-test-runner-build

.github/workflows/checkSVGCompression.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626

2727
- name: Setup Node
2828
uses: ./.github/actions/composite/setupNode
29+
with:
30+
IS_DESKTOP_BUILD: true
2931

3032
- name: Compress SVG check
3133
uses: ./.github/actions/javascript/checkSVGCompression

.github/workflows/deploy.yml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,70 @@ jobs:
287287
GITHUB_TOKEN: ${{ github.token }}
288288
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
289289

290+
desktop:
291+
name: Build and deploy Desktop
292+
needs: prep
293+
runs-on: macos-14-large
294+
steps:
295+
- name: Checkout
296+
# v4
297+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
298+
299+
- name: Setup Node
300+
uses: ./.github/actions/composite/setupNode
301+
with:
302+
IS_DESKTOP_BUILD: true
303+
304+
# v6.0.0
305+
- name: Setup Python for node-gyp
306+
id: setup-python
307+
uses: actions/setup-python@18566f86b301499665bd3eb1a2247e0849c64fa5
308+
with:
309+
python-version: '3.12'
310+
cache: 'pip'
311+
cache-dependency-path: desktop/requirements.txt
312+
313+
- name: Ensure setuptools for node-gyp
314+
run: pip install --upgrade -r desktop/requirements.txt
315+
316+
- name: Load Desktop credentials from 1Password
317+
id: load-credentials
318+
# v2
319+
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
320+
with:
321+
export-env: false
322+
env:
323+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
324+
DESKTOP_CERTIFICATE_BASE64: "op://${{ vars.OP_VAULT }}/Desktop Certificates.p12/CSC_LINK"
325+
DESKTOP_CERTIFICATE_PASSWORD: "op://${{ vars.OP_VAULT }}/Desktop Certificates.p12/CSC_KEY_PASSWORD"
326+
327+
- name: Build desktop app
328+
run: ${{ github.ref == 'refs/heads/production' && 'npm run desktop-build' || 'npm run desktop-build-staging' }}
329+
env:
330+
CSC_LINK: ${{ steps.load-credentials.outputs.DESKTOP_CERTIFICATE_BASE64 }}
331+
CSC_KEY_PASSWORD: ${{ steps.load-credentials.outputs.DESKTOP_CERTIFICATE_PASSWORD }}
332+
APPLE_ID: ${{ secrets.APPLE_ID }}
333+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
334+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
335+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
336+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
337+
GCP_GEOLOCATION_API_KEY: ${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}
338+
S3_BUCKET: ${{ github.ref == 'refs/heads/production' && vars.PRODUCTION_S3_BUCKET || vars.STAGING_S3_BUCKET }}
339+
340+
- name: Upload desktop sourcemaps artifact
341+
# v4
342+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
343+
with:
344+
name: desktop-sourcemaps-artifact
345+
path: ./desktop/dist/www/merged-source-map.js.map
346+
347+
- name: Upload desktop build artifact
348+
# v4
349+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
350+
with:
351+
name: desktop-build-artifact
352+
path: ./desktop-build/NewExpensify.dmg
353+
290354
ios:
291355
name: Build and deploy iOS HybridApp
292356
needs: prep
@@ -551,7 +615,7 @@ jobs:
551615
name: Post a Slack message when any platform fails to build or deploy
552616
runs-on: ubuntu-latest
553617
if: ${{ failure() }}
554-
needs: [android, ios, web]
618+
needs: [android, desktop, ios, web]
555619
steps:
556620
- name: Checkout
557621
# v4
@@ -567,7 +631,7 @@ jobs:
567631
outputs:
568632
IS_AT_LEAST_ONE_PLATFORM_DEPLOYED: ${{ steps.checkDeploymentSuccessOnAtLeastOnePlatform.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED }}
569633
IS_ALL_PLATFORMS_DEPLOYED: ${{ steps.checkDeploymentSuccessOnAllPlatforms.outputs.IS_ALL_PLATFORMS_DEPLOYED }}
570-
needs: [android, ios, web]
634+
needs: [android, desktop, ios, web]
571635
if: ${{ always() }}
572636
steps:
573637
- name: Check deployment success on at least one platform
@@ -576,6 +640,7 @@ jobs:
576640
isAtLeastOnePlatformDeployed="false"
577641
if [ "${{ needs.iOS.result }}" == "success" ] || \
578642
[ "${{ needs.android.result }}" == "success" ] || \
643+
[ "${{ needs.desktop.result }}" == "success" ] || \
579644
[ "${{ needs.web.result }}" == "success" ]; then
580645
isAtLeastOnePlatformDeployed="true"
581646
fi
@@ -588,6 +653,7 @@ jobs:
588653
isAllPlatformsDeployed="false"
589654
if [ "${{ needs.iOS.result }}" == "success" ] && \
590655
[ "${{ needs.android.result }}" == "success" ] && \
656+
[ "${{ needs.desktop.result }}" == "success" ] && \
591657
[ "${{ needs.web.result }}" == "success" ]; then
592658
isAllPlatformsDeployed="true"
593659
fi
@@ -635,9 +701,10 @@ jobs:
635701
env:
636702
GITHUB_TOKEN: ${{ github.token }}
637703

638-
- name: Rename web sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name
704+
- name: Rename web and desktop sourcemaps artifacts before assets upload in order to have unique ReleaseAsset.name
639705
continue-on-error: true
640706
run: |
707+
mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map
641708
mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map
642709
643710
- name: Upload artifacts to GitHub Release
@@ -648,6 +715,8 @@ jobs:
648715
./android-build-artifact/Expensify-release.aab#android.aab
649716
./android-apk-artifact/Expensify.apk#android.apk
650717
./android-sourcemap-artifact/index.android.bundle.map#android-sourcemap.js.map
718+
./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap.js.map
719+
./desktop-build-artifact/NewExpensify.dmg#desktop.dmg
651720
./ios-build-artifact/Expensify.ipa#ios.ipa
652721
./ios-sourcemap-artifact/main.jsbundle.map#ios-sourcemap.js.map
653722
./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap.js.map
@@ -707,7 +776,7 @@ jobs:
707776
name: Post a Slack message when all platforms deploy successfully
708777
runs-on: ubuntu-latest
709778
if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_ALL_PLATFORMS_DEPLOYED) }}
710-
needs: [prep, android, ios, web, checkDeploymentSuccess, createRelease]
779+
needs: [prep, android, desktop, ios, web, checkDeploymentSuccess, createRelease]
711780
steps:
712781
- name: 'Announces the deploy in the #announce Slack room'
713782
# v3
@@ -764,11 +833,12 @@ jobs:
764833
postGithubComments:
765834
uses: ./.github/workflows/postDeployComments.yml
766835
if: ${{ always() && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
767-
needs: [prep, android, ios, web, checkDeploymentSuccess, createRelease]
836+
needs: [prep, android, desktop, ios, web, checkDeploymentSuccess, createRelease]
768837
secrets: inherit
769838
with:
770839
version: ${{ needs.prep.outputs.APP_VERSION }}
771840
env: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }}
772841
android: ${{ needs.android.result }}
773842
ios: ${{ needs.ios.result }}
774843
web: ${{ needs.web.result }}
844+
desktop: ${{ needs.desktop.result }}

0 commit comments

Comments
 (0)