From b3770a2e25377738a5e09fbf8b4867f0e63f2245 Mon Sep 17 00:00:00 2001 From: cpl121 Date: Tue, 9 Jan 2024 13:01:04 +0100 Subject: [PATCH 1/3] fix: macos notarization --- packages/desktop/electron-builder-config.js | 3 ++- packages/desktop/package.json | 2 +- packages/desktop/scripts/notarize.macos.js | 10 +++---- yarn.lock | 30 +++++++++++++++------ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/packages/desktop/electron-builder-config.js b/packages/desktop/electron-builder-config.js index d0682242a..b54d377dd 100644 --- a/packages/desktop/electron-builder-config.js +++ b/packages/desktop/electron-builder-config.js @@ -11,7 +11,7 @@ const baseConfig = () => ({ afterSign: async () => { // eslint-disable-next-line no-useless-catch try { - await notarize(getAppId(process.env.STAGE || 'alpha'), getAppName(process.env.STAGE || 'alpha')) + await notarize(getAppName(process.env.STAGE || 'alpha')) } catch (error) { // This catch is necessary or the promise rejection is swallowed throw error @@ -54,6 +54,7 @@ const baseConfig = () => ({ entitlementsInherit: './entitlements.mac.plist', hardenedRuntime: true, gatekeeperAssess: false, + notarize: false, // Disable notarize in electron builder as we use @electron/notarize instead asarUnpack: ['**/*.node'], }, }) diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 0b5711436..d21cf77f1 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -50,7 +50,7 @@ "css-loader": "^5.0.1", "electron": "12.2.3", "electron-builder": "^22.9.1", - "electron-notarize": "^1.0.0", + "@electron/notarize": "2.1.0", "lodash.merge": "^4.6.2", "mini-css-extract-plugin": "^1.3.5", "node-loader": "^1.0.2", diff --git a/packages/desktop/scripts/notarize.macos.js b/packages/desktop/scripts/notarize.macos.js index e35a2a378..5a5e8bfe4 100644 --- a/packages/desktop/scripts/notarize.macos.js +++ b/packages/desktop/scripts/notarize.macos.js @@ -1,4 +1,4 @@ -const { notarize } = require('electron-notarize') +const { notarize } = require('@electron/notarize') const path = require('path') /** @@ -6,8 +6,8 @@ const path = require('path') * @param {string} appName * @returns void */ -module.exports = async (appBundleId, appName) => { - if (process.platform !== 'darwin' || process.env.MACOS_SKIP_NOTARIZATION) { +module.exports = async (appName) => { + if (process.platform !== 'darwin' || process.env.MACOS_SKIP_NOTARIZATION === 'true') { return true } @@ -25,10 +25,10 @@ module.exports = async (appBundleId, appName) => { } await notarize({ - appBundleId: appBundleId, + tool: 'notarytool', appPath: path.resolve(__dirname, `../out/mac/${appName}.app`), appleId: APPLE_ID, appleIdPassword: APPLE_ID_PASSWORD, - ascProvider: 'UG77RJKZHH', + teamId: 'UG77RJKZHH', }) } diff --git a/yarn.lock b/yarn.lock index 18f0ac6b9..31d10015d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1145,6 +1145,15 @@ global-agent "^2.0.2" global-tunnel-ng "^2.7.1" +"@electron/notarize@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@electron/notarize/-/notarize-2.1.0.tgz#76aaec10c8687225e8d0a427cc9df67611c46ff3" + integrity sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA== + dependencies: + debug "^4.1.1" + fs-extra "^9.0.1" + promise-retry "^2.0.1" + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -4112,14 +4121,6 @@ electron-log@^4.3.1: resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.3.1.tgz#1405fef9d4e6964a5fdb8790a69163aa237ffe91" integrity sha512-S/0CMjYjgyWUsZ3d27VvErPaI5W4oILp4jfeCuN4DhDqrJW6jKRUD2PxFfTdeZEIjM7+fttGg7A61rPcAcZC1w== -electron-notarize@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.0.0.tgz#bc925b1ccc3f79e58e029e8c4706572b01a9fd8f" - integrity sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og== - dependencies: - debug "^4.1.1" - fs-extra "^9.0.1" - electron-publish@22.9.1: version "22.9.1" resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-22.9.1.tgz#7cc76ac4cc53efd29ee31c1e5facb9724329068e" @@ -4237,6 +4238,11 @@ envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.7.4.tgz#c6311cdd38a0e86808c1c9343f667e4267c4a320" integrity sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ== +err-code@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" + integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== + errno@^0.1.3: version "0.1.8" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" @@ -8316,6 +8322,14 @@ progress@^2.0.0, progress@^2.0.3: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== +promise-retry@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" + integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== + dependencies: + err-code "^2.0.2" + retry "^0.12.0" + prompts@^2.0.1: version "2.4.1" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.1.tgz#befd3b1195ba052f9fd2fde8a486c4e82ee77f61" From 9fc69a9b8b1e69ad89a051c8b33f78c4496bbe96 Mon Sep 17 00:00:00 2001 From: cpl121 Date: Tue, 9 Jan 2024 13:57:09 +0100 Subject: [PATCH 2/3] test --- packages/desktop/electron-builder-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop/electron-builder-config.js b/packages/desktop/electron-builder-config.js index b54d377dd..2be1fbed1 100644 --- a/packages/desktop/electron-builder-config.js +++ b/packages/desktop/electron-builder-config.js @@ -54,7 +54,7 @@ const baseConfig = () => ({ entitlementsInherit: './entitlements.mac.plist', hardenedRuntime: true, gatekeeperAssess: false, - notarize: false, // Disable notarize in electron builder as we use @electron/notarize instead + // notarize: false, // Disable notarize in electron builder as we use @electron/notarize instead asarUnpack: ['**/*.node'], }, }) From 9974a9605a1f307cd97dcefba0b5261797350a00 Mon Sep 17 00:00:00 2001 From: cpl121 Date: Tue, 9 Jan 2024 14:36:46 +0100 Subject: [PATCH 3/3] test 2 --- packages/desktop/electron-builder-config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/desktop/electron-builder-config.js b/packages/desktop/electron-builder-config.js index 2be1fbed1..adf019d73 100644 --- a/packages/desktop/electron-builder-config.js +++ b/packages/desktop/electron-builder-config.js @@ -54,7 +54,6 @@ const baseConfig = () => ({ entitlementsInherit: './entitlements.mac.plist', hardenedRuntime: true, gatekeeperAssess: false, - // notarize: false, // Disable notarize in electron builder as we use @electron/notarize instead asarUnpack: ['**/*.node'], }, })