From f5c8b6599817cdef4cd830fe43f5f7dd6355d5fe Mon Sep 17 00:00:00 2001 From: bithighlander Date: Tue, 16 Apr 2024 21:33:53 -0500 Subject: [PATCH] debug build --- .pnp.cjs | 50 ++++--------------- ...tarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip | 3 -- packages/keepkey-desktop/package.json | 2 +- packages/keepkey-desktop/scripts/afterSign.js | 30 ++++++++++- yarn.lock | 42 ++++++---------- 5 files changed, 55 insertions(+), 72 deletions(-) delete mode 100644 .yarn/cache/electron-notarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip diff --git a/.pnp.cjs b/.pnp.cjs index 07a839c68..d268b2d02 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -3115,33 +3115,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["@bithighlander/electron-builder-notarize", [\ - ["npm:0.0.11", {\ - "packageLocation": "./.yarn/cache/@bithighlander-electron-builder-notarize-npm-0.0.11-8e4ce7141e-99532e3d05.zip/node_modules/@bithighlander/electron-builder-notarize/",\ - "packageDependencies": [\ - ["@bithighlander/electron-builder-notarize", "npm:0.0.11"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:15149eb01efe6dae21a27159fdeb7f62cca0f4e19d09d3abd4eb0cc76d89fd1a64d234276982b5e754aae438c4679864c2b8ee064ff74d60a47dfedc442fd25f#npm:0.0.11", {\ - "packageLocation": "./.yarn/__virtual__/@bithighlander-electron-builder-notarize-virtual-07a1317064/0/cache/@bithighlander-electron-builder-notarize-npm-0.0.11-8e4ce7141e-99532e3d05.zip/node_modules/@bithighlander/electron-builder-notarize/",\ - "packageDependencies": [\ - ["@bithighlander/electron-builder-notarize", "virtual:15149eb01efe6dae21a27159fdeb7f62cca0f4e19d09d3abd4eb0cc76d89fd1a64d234276982b5e754aae438c4679864c2b8ee064ff74d60a47dfedc442fd25f#npm:0.0.11"],\ - ["@types/electron-builder", null],\ - ["builder-util", "npm:24.13.1"],\ - ["dotenv", "npm:8.6.0"],\ - ["electron-builder", "npm:24.13.3"],\ - ["electron-notarize", "npm:1.2.2"],\ - ["js-yaml", "npm:3.14.1"],\ - ["read-pkg-up", "npm:7.0.1"]\ - ],\ - "packagePeers": [\ - "@types/electron-builder",\ - "electron-builder"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@chakra-ui/accordion", [\ ["npm:2.1.3", {\ "packageLocation": "./.yarn/cache/@chakra-ui-accordion-npm-2.1.3-41f02bcb91-87f30ad537.zip/node_modules/@chakra-ui/accordion/",\ @@ -6403,6 +6376,16 @@ const RAW_RUNTIME_STATE = ["promise-retry", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:2.3.0", {\ + "packageLocation": "./.yarn/cache/@electron-notarize-npm-2.3.0-5dca3415c9-7725617389.zip/node_modules/@electron/notarize/",\ + "packageDependencies": [\ + ["@electron/notarize", "npm:2.3.0"],\ + ["debug", "virtual:aa122e5b13a7ba613e8b9a1170012a02d11b187c0a178ff2ef2d2c9298b7fcf1baa21041ea52dd886ed859e3c879fe22fa65d9399272a0b454c8fe055fc87b84#npm:4.3.4"],\ + ["fs-extra", "npm:9.1.0"],\ + ["promise-retry", "npm:2.0.1"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@electron/osx-sign", [\ @@ -19200,17 +19183,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["electron-notarize", [\ - ["npm:1.2.2", {\ - "packageLocation": "./.yarn/cache/electron-notarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip/node_modules/electron-notarize/",\ - "packageDependencies": [\ - ["electron-notarize", "npm:1.2.2"],\ - ["debug", "virtual:aa122e5b13a7ba613e8b9a1170012a02d11b187c0a178ff2ef2d2c9298b7fcf1baa21041ea52dd886ed859e3c879fe22fa65d9399272a0b454c8fe055fc87b84#npm:4.3.4"],\ - ["fs-extra", "npm:9.1.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["electron-publish", [\ ["npm:24.13.1", {\ "packageLocation": "./.yarn/cache/electron-publish-npm-24.13.1-40acfab2ad-60133b51bf.zip/node_modules/electron-publish/",\ @@ -24807,7 +24779,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/keepkey-desktop/",\ "packageDependencies": [\ ["keepkey-desktop", "workspace:packages/keepkey-desktop"],\ - ["@bithighlander/electron-builder-notarize", "virtual:15149eb01efe6dae21a27159fdeb7f62cca0f4e19d09d3abd4eb0cc76d89fd1a64d234276982b5e754aae438c4679864c2b8ee064ff74d60a47dfedc442fd25f#npm:0.0.11"],\ + ["@electron/notarize", "npm:2.3.0"],\ ["@ethersproject/contracts", "npm:5.7.0"],\ ["@keepkey/common-esbuild-bits", "workspace:packages/common-esbuild-bits"],\ ["@keepkey/device-protocol", "npm:7.10.2"],\ diff --git a/.yarn/cache/electron-notarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip b/.yarn/cache/electron-notarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip deleted file mode 100644 index 0a95cdfce..000000000 --- a/.yarn/cache/electron-notarize-npm-1.2.2-8e8b3da845-c66b175b6f.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e5066592b4a49adda123dc8d7d529767c1bce7fb4a6dc777b3c4eeb051dbc381 -size 21665 diff --git a/packages/keepkey-desktop/package.json b/packages/keepkey-desktop/package.json index 005904d33..43424643f 100644 --- a/packages/keepkey-desktop/package.json +++ b/packages/keepkey-desktop/package.json @@ -73,6 +73,7 @@ } }, "dependencies": { + "@electron/notarize": "^2.3.0", "@ethersproject/contracts": "^5.7.0", "@keepkey/device-protocol": "^7.10.2", "@keepkey/hdwallet-core": "^1.53.9", @@ -132,7 +133,6 @@ "web3": "^4.0.1" }, "devDependencies": { - "@bithighlander/electron-builder-notarize": "0.0.11", "@keepkey/common-esbuild-bits": "workspace:*", "@shapeshiftoss/eslint-plugin-logger": "^1.1.0", "@shapeshiftoss/hdwallet-keepkey": "^1.52.11", diff --git a/packages/keepkey-desktop/scripts/afterSign.js b/packages/keepkey-desktop/scripts/afterSign.js index 65b1e22f7..23ccbaeaf 100644 --- a/packages/keepkey-desktop/scripts/afterSign.js +++ b/packages/keepkey-desktop/scripts/afterSign.js @@ -1 +1,29 @@ -module.exports = require('@bithighlander/electron-builder-notarize') +require('dotenv').config() +const { notarize } = require('@electron/notarize') + +const isSet = (value) => value && value !== 'false' + +// electron-build hook to be used in electron-build pipeline in the future +// =========================================================================== +// Note: for now we don't use this at the moment. +// Run ./notarize-cli.js instead +exports.default = async function notarizing (context) { + const { electronPlatformName, appOutDir } = context + if (electronPlatformName !== 'darwin') return + // skip notarization if secrets are not present in env + if (!process.env.APPLE_ID_PASSWORD || !process.env.APPLE_ID) { + console.log('Skipping notarizing, since secrets are not present in env.') + return + } + + const appName = context.packager.appInfo.productFilename + const appPath = `${appOutDir}/mac-arm64/${appName}.app`; // Correct the path based on actual output directory + return notarize({ + appBundleId: 'com.keepkey.desktop', + appPath, + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_ID_PASSWORD, + tool: 'notarytool', + teamId: 'DR57X8Z394' + }) +} diff --git a/yarn.lock b/yarn.lock index 7d4643fc0..0fa0eca92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1752,21 +1752,6 @@ __metadata: languageName: node linkType: hard -"@bithighlander/electron-builder-notarize@npm:0.0.11": - version: 0.0.11 - resolution: "@bithighlander/electron-builder-notarize@npm:0.0.11" - dependencies: - builder-util: "npm:24.13.1" - dotenv: "npm:^8.2.0" - electron-notarize: "npm:^1.2.2" - js-yaml: "npm:^3.14.0" - read-pkg-up: "npm:^7.0.0" - peerDependencies: - electron-builder: ">= 24.13.3" - checksum: 10/99532e3d05835ee7abe5729735ca6f113dcb642a9ed5995af2d15eaaabce3d1a91ee3501d268af6b49a22914bfdfe40cb74a61692bc6677539826d4bd3b7201f - languageName: node - linkType: hard - "@chakra-ui/accordion@npm:2.1.3": version: 2.1.3 resolution: "@chakra-ui/accordion@npm:2.1.3" @@ -3714,6 +3699,17 @@ __metadata: languageName: node linkType: hard +"@electron/notarize@npm:^2.3.0": + version: 2.3.0 + resolution: "@electron/notarize@npm:2.3.0" + dependencies: + debug: "npm:^4.1.1" + fs-extra: "npm:^9.0.1" + promise-retry: "npm:^2.0.1" + checksum: 10/7725617389d78b65fb9b2a616330af2abaa0aa496e2ebc5cf8f6df40a4e746e78c6ed7d2373fa1efcdceca1ff28670d304af1f9be1d905516da642546378f88f + languageName: node + linkType: hard + "@electron/osx-sign@npm:1.0.5": version: 1.0.5 resolution: "@electron/osx-sign@npm:1.0.5" @@ -14257,16 +14253,6 @@ __metadata: languageName: node linkType: hard -"electron-notarize@npm:^1.2.2": - version: 1.2.2 - resolution: "electron-notarize@npm:1.2.2" - dependencies: - debug: "npm:^4.1.1" - fs-extra: "npm:^9.0.1" - checksum: 10/c66b175b6f584d7bfc67a83eb56c2f4ec0264aab0f693d0a0b4cc2d825b05ada8d119bec4a2ac0fcc1add93dca3282a57bc3dbeb805b0c546e013149905efc40 - languageName: node - linkType: hard - "electron-osx-sign@npm:^0.6.0": version: 0.6.0 resolution: "electron-osx-sign@npm:0.6.0" @@ -18833,7 +18819,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.10.0, js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.0": +"js-yaml@npm:^3.10.0, js-yaml@npm:^3.13.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" dependencies: @@ -19419,7 +19405,7 @@ __metadata: version: 0.0.0-use.local resolution: "keepkey-desktop@workspace:packages/keepkey-desktop" dependencies: - "@bithighlander/electron-builder-notarize": "npm:0.0.11" + "@electron/notarize": "npm:^2.3.0" "@ethersproject/contracts": "npm:^5.7.0" "@keepkey/common-esbuild-bits": "workspace:*" "@keepkey/device-protocol": "npm:^7.10.2" @@ -23839,7 +23825,7 @@ __metadata: languageName: node linkType: hard -"read-pkg-up@npm:^7.0.0, read-pkg-up@npm:^7.0.1": +"read-pkg-up@npm:^7.0.1": version: 7.0.1 resolution: "read-pkg-up@npm:7.0.1" dependencies: