From f55477185d90d5e9e8df47748cc0c1a814c058a7 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 30 Oct 2023 11:49:35 +0700 Subject: [PATCH 01/10] fix: 30411 --- desktop/notarize.js | 1 - 1 file changed, 1 deletion(-) diff --git a/desktop/notarize.js b/desktop/notarize.js index f6f803700a19..380df9c0b76c 100644 --- a/desktop/notarize.js +++ b/desktop/notarize.js @@ -11,7 +11,6 @@ exports.default = function notarizing(context) { return notarize({ tool: 'notarytool', - appBundleId: electron.appId, appPath: `${appOutDir}/${appName}.app`, appleId: process.env.APPLE_ID, appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, From 7da8bfebcd9fdbb7d5bc9ac3988f05590ba7cfd2 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 11:54:32 -0600 Subject: [PATCH 02/10] Use default tool and update notarize --- desktop/notarize.js | 1 - package-lock.json | 74 +++++++-------------------------------------- package.json | 4 +-- 3 files changed, 13 insertions(+), 66 deletions(-) diff --git a/desktop/notarize.js b/desktop/notarize.js index 380df9c0b76c..3ac14430f880 100644 --- a/desktop/notarize.js +++ b/desktop/notarize.js @@ -10,7 +10,6 @@ exports.default = function notarizing(context) { const appName = context.packager.appInfo.productFilename; return notarize({ - tool: 'notarytool', appPath: `${appOutDir}/${appName}.app`, appleId: process.env.APPLE_ID, appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, diff --git a/package-lock.json b/package-lock.json index d7f3ddc6653e..e0de74f83105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -137,7 +137,7 @@ "@babel/preset-typescript": "^7.21.5", "@babel/runtime": "^7.20.0", "@dword-design/eslint-plugin-import-alias": "^4.0.8", - "@electron/notarize": "^1.2.3", + "@electron/notarize": "^2.1.0", "@jest/globals": "^29.5.0", "@octokit/core": "4.0.4", "@octokit/plugin-paginate-rest": "3.1.0", @@ -3104,13 +3104,14 @@ } }, "node_modules/@electron/notarize": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.3.tgz", - "integrity": "sha512-9oRzT56rKh5bspk3KpAVF8lPKHYQrBnRwcgiOeR0hdilVEQmszDaAu0IPCPrwwzJN0ugNs0rRboTreHMt/6mBQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", + "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", "dev": true, "dependencies": { "debug": "^4.1.1", - "fs-extra": "^9.0.1" + "fs-extra": "^9.0.1", + "promise-retry": "^2.0.1" }, "engines": { "node": ">= 10.0.0" @@ -21726,35 +21727,6 @@ "node": ">=14.0.0" } }, - "node_modules/app-builder-lib/node_modules/@electron/notarize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", - "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.1", - "promise-retry": "^2.0.1" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/app-builder-lib/node_modules/@electron/notarize/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/app-builder-lib/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -55355,13 +55327,14 @@ } }, "@electron/notarize": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.3.tgz", - "integrity": "sha512-9oRzT56rKh5bspk3KpAVF8lPKHYQrBnRwcgiOeR0hdilVEQmszDaAu0IPCPrwwzJN0ugNs0rRboTreHMt/6mBQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", + "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", "dev": true, "requires": { "debug": "^4.1.1", - "fs-extra": "^9.0.1" + "fs-extra": "^9.0.1", + "promise-retry": "^2.0.1" } }, "@electron/osx-sign": { @@ -68794,31 +68767,6 @@ "temp-file": "^3.4.0" }, "dependencies": { - "@electron/notarize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", - "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "fs-extra": "^9.0.1", - "promise-retry": "^2.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - } - } - }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", diff --git a/package.json b/package.json index 01159ac08d2c..b7b4c085fd3f 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,7 @@ "@babel/preset-react": "^7.10.4", "@babel/preset-typescript": "^7.21.5", "@babel/runtime": "^7.20.0", - "@electron/notarize": "^1.2.3", + "@electron/notarize": "^2.1.0", "@jest/globals": "^29.5.0", "@octokit/core": "4.0.4", "@octokit/plugin-paginate-rest": "3.1.0", @@ -303,4 +303,4 @@ "node": "16.15.1", "npm": "8.11.0" } -} \ No newline at end of file +} From c0d54dc379dc0b65ceff7a7cb838ac96f9f10890 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 12:19:29 -0600 Subject: [PATCH 03/10] Try to notarize directly from electron-builder --- config/electronBuilder.config.js | 4 +++- desktop/notarize.js | 18 ------------------ 2 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 desktop/notarize.js diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index da87c93ee367..978f5d257d8d 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -44,6 +44,9 @@ module.exports = { entitlements: 'desktop/entitlements.mac.plist', entitlementsInherit: 'desktop/entitlements.mac.plist', type: 'distribution', + notarize: { + teamId: '368M544MTT', + }, }, dmg: { title: 'New Expensify', @@ -58,7 +61,6 @@ module.exports = { path: s3Path[process.env.ELECTRON_ENV], }, ], - afterSign: isPublishing ? './desktop/notarize.js' : undefined, files: ['dist', '!dist/www/{.well-known,favicon*}'], directories: { app: 'desktop', diff --git a/desktop/notarize.js b/desktop/notarize.js deleted file mode 100644 index 3ac14430f880..000000000000 --- a/desktop/notarize.js +++ /dev/null @@ -1,18 +0,0 @@ -const {notarize} = require('@electron/notarize'); -const electron = require('../config/electronBuilder.config'); - -exports.default = function notarizing(context) { - const {electronPlatformName, appOutDir} = context; - if (electronPlatformName !== 'darwin') { - return; - } - - const appName = context.packager.appInfo.productFilename; - - return notarize({ - appPath: `${appOutDir}/${appName}.app`, - appleId: process.env.APPLE_ID, - appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, - teamId: '368M544MTT', - }); -}; From 6b18c526160ba6f35579a6756f1eb7a546bfaad4 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:06:53 -0600 Subject: [PATCH 04/10] Do not notarize debug builds --- config/electronBuilder.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index 978f5d257d8d..35a63b1a7989 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -44,9 +44,11 @@ module.exports = { entitlements: 'desktop/entitlements.mac.plist', entitlementsInherit: 'desktop/entitlements.mac.plist', type: 'distribution', - notarize: { - teamId: '368M544MTT', - }, + notarize: isPublishing + ? { + teamId: '368M544MTT', + } + : undefined, }, dmg: { title: 'New Expensify', From fce077501ed5a5dc633ef2cbc10ef30c16944372 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:08:04 -0600 Subject: [PATCH 05/10] Remove param as it works without it --- config/electronBuilder.config.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index 35a63b1a7989..f13c3cfe68e2 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -1,6 +1,5 @@ const {version} = require('../package.json'); -const isPublishing = process.argv.includes('--publish'); const pullRequestNumber = process.env.PULL_REQUEST_NUMBER; const s3Bucket = { @@ -44,11 +43,9 @@ module.exports = { entitlements: 'desktop/entitlements.mac.plist', entitlementsInherit: 'desktop/entitlements.mac.plist', type: 'distribution', - notarize: isPublishing - ? { - teamId: '368M544MTT', - } - : undefined, + notarize: { + teamId: '368M544MTT', + }, }, dmg: { title: 'New Expensify', From 6ad54d08ac019ae9cc186f964b68a44a18a43056 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:09:30 -0600 Subject: [PATCH 06/10] Try to remove publish flag and just use env variables --- .github/workflows/testBuild.yml | 2 +- config/electronBuilder.config.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index beb5d4e2f530..c6b7d9f6fc9e 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -246,7 +246,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Build desktop app for testing - run: npm run desktop-build-adhoc -- --publish always + run: npm run desktop-build-adhoc env: CSC_LINK: ${{ secrets.CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js index f13c3cfe68e2..e4ed685f65fe 100644 --- a/config/electronBuilder.config.js +++ b/config/electronBuilder.config.js @@ -27,8 +27,7 @@ if (!isCorrectElectronEnv) { } /** - * The configuration for the production and staging Electron builds. - * It can be used to create local builds of the same, by omitting the `--publish` flag + * The configuration for the debug, production and staging Electron builds. */ module.exports = { appId: 'com.expensifyreactnative.chat', From 319fc1b545c6b4101b7e4d6878c2bfaa18151983 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:12:11 -0600 Subject: [PATCH 07/10] Tweak text on AdHoc builDs --- .../javascript/postTestBuildComment/postTestBuildComment.js | 6 +++--- .github/workflows/testBuild.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js index ea086e9657ac..ec4c3926659c 100644 --- a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js +++ b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js @@ -26,12 +26,12 @@ function getTestBuildMessage() { const iOSQRCode = iOSSuccess ? `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})` : "The QR code can't be generated, because the iOS build failed"; const webQRCode = webSuccess ? `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})` : "The QR code can't be generated, because the web build failed"; - const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube: -| android :robot: | iOS :apple: | + const message = `:test_tube::test_tube: Use the links below to test this adhoc build in Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: +| Android :robot: | iOS :apple: | | ------------- | ------------- | | ${androidLink} | ${iOSLink} | | ${androidQRCode} | ${iOSQRCode} | -| desktop :computer: | web :spider_web: | +| Desktop :computer: | Web :spider_web: | | ${desktopLink} | ${webLink} | | ${desktopQRCode} | ${webQRCode} |`; diff --git a/.github/workflows/testBuild.yml b/.github/workflows/testBuild.yml index c6b7d9f6fc9e..b79b687e638e 100644 --- a/.github/workflows/testBuild.yml +++ b/.github/workflows/testBuild.yml @@ -339,7 +339,7 @@ jobs: if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }} with: token: ${{ secrets.OS_BOTIFY_TOKEN }} - body-include: 'Use the links below to test this build in android and iOS. Happy testing!' + body-include: 'Use the links below to test this adhoc build in Android, iOS, Desktop, and Web. Happy testing!' number: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }} delete: true From 3596bb12b89ec666cfa9a97b305021c2c18be121 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:21:48 -0600 Subject: [PATCH 08/10] Remove all --always flags --- .github/workflows/platformDeploy.yml | 4 ++-- contributingGuides/APPLE_GOOGLE_SIGNIN.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index d18a0a383ed6..f30d55c4dff4 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -154,7 +154,7 @@ jobs: - name: Build production desktop app if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: npm run desktop-build -- --publish always + run: npm run desktop-build env: CSC_LINK: ${{ secrets.CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} @@ -165,7 +165,7 @@ jobs: - name: Build staging desktop app if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} - run: npm run desktop-build-staging -- --publish always + run: npm run desktop-build-staging env: CSC_LINK: ${{ secrets.CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} diff --git a/contributingGuides/APPLE_GOOGLE_SIGNIN.md b/contributingGuides/APPLE_GOOGLE_SIGNIN.md index 9032a99dfbbd..c063fb93ba45 100644 --- a/contributingGuides/APPLE_GOOGLE_SIGNIN.md +++ b/contributingGuides/APPLE_GOOGLE_SIGNIN.md @@ -233,7 +233,7 @@ If developing on MacOS, the development desktop app can't handle deeplinks corre 1. Create a "real" build of the desktop app, which can handle deep links, open the build folder, and install the dmg there: ``` -npm run desktop-build --publish=never +npm run desktop-build open desktop-build # Then double-click "NewExpensify.dmg" in Finder window ``` From 95b83955de6815ca4e6cc8d59c2a5ecd8ffbd88c Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 30 Oct 2023 13:32:03 -0600 Subject: [PATCH 09/10] Fix tests --- .../javascript/postTestBuildComment/postTestBuildComment.js | 2 +- tests/unit/postTestBuildComment.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js index ec4c3926659c..4bb43f6e5900 100644 --- a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js +++ b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.js @@ -26,7 +26,7 @@ function getTestBuildMessage() { const iOSQRCode = iOSSuccess ? `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})` : "The QR code can't be generated, because the iOS build failed"; const webQRCode = webSuccess ? `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})` : "The QR code can't be generated, because the web build failed"; - const message = `:test_tube::test_tube: Use the links below to test this adhoc build in Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: + const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: | Android :robot: | iOS :apple: | | ------------- | ------------- | | ${androidLink} | ${iOSLink} | diff --git a/tests/unit/postTestBuildComment.js b/tests/unit/postTestBuildComment.js index 23c52f934a39..fb1d1572dc34 100644 --- a/tests/unit/postTestBuildComment.js +++ b/tests/unit/postTestBuildComment.js @@ -26,12 +26,12 @@ const desktopQRCode = `![Desktop](https://api.qrserver.com/v1/create-qr-code/?si const iOSQRCode = `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})`; const webQRCode = `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})`; -const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube: -| android :robot: | iOS :apple: | +const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: +| Android :robot: | iOS :apple: | | ------------- | ------------- | | ${androidLink} | ${iOSLink} | | ${androidQRCode} | ${iOSQRCode} | -| desktop :computer: | web :spider_web: | +| Desktop :computer: | Web :spider_web: | | ${desktopLink} | ${webLink} | | ${desktopQRCode} | ${webQRCode} |`; From 9a7956263fb9cbda0434dcf8d09c29c9b9307962 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Tue, 31 Oct 2023 08:34:55 -0600 Subject: [PATCH 10/10] Build GH actions --- .github/actions/javascript/postTestBuildComment/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/javascript/postTestBuildComment/index.js b/.github/actions/javascript/postTestBuildComment/index.js index 679f6cf9508b..c2d486b325bb 100644 --- a/.github/actions/javascript/postTestBuildComment/index.js +++ b/.github/actions/javascript/postTestBuildComment/index.js @@ -35,12 +35,12 @@ function getTestBuildMessage() { const iOSQRCode = iOSSuccess ? `![iOS](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${iOSLink})` : "The QR code can't be generated, because the iOS build failed"; const webQRCode = webSuccess ? `![Web](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${webLink})` : "The QR code can't be generated, because the web build failed"; - const message = `:test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube: -| android :robot: | iOS :apple: | + const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: +| Android :robot: | iOS :apple: | | ------------- | ------------- | | ${androidLink} | ${iOSLink} | | ${androidQRCode} | ${iOSQRCode} | -| desktop :computer: | web :spider_web: | +| Desktop :computer: | Web :spider_web: | | ${desktopLink} | ${webLink} | | ${desktopQRCode} | ${webQRCode} |`;