@@ -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