diff --git a/electron/afterSignHook.js b/electron/afterSignHook.js new file mode 100644 index 00000000..ccd46c13 --- /dev/null +++ b/electron/afterSignHook.js @@ -0,0 +1,38 @@ +require('dotenv').config() +const fs = require('fs') +const path = require('path') +const electronNotarize = require('electron-notarize') + +module.exports = async function (params) { + if (process.platform !== 'darwin') { + return + } + + console.log('afterSign hook triggered', params) + + const appId = 'com.harris-braun-enterprises.acorn' + + const appPath = path.join( + params.appOutDir, + `${params.packager.appInfo.productFilename}.app` + ) + if (!fs.existsSync(appPath)) { + console.log('skip') + return + } + + console.log(`Notarizing ${appId} found at ${appPath}`) + + try { + await electronNotarize.notarize({ + appBundleId: appId, + appPath: appPath, + appleId: process.env.APPLE_ID_EMAIL, + appleIdPassword: process.env.APPLE_ID_PASSWORD, + }) + } catch (error) { + console.error(error) + } + + console.log(`Done notarizing ${appId}`) +} diff --git a/electron/build/icon.icns b/electron/build/icon.icns new file mode 100644 index 00000000..fe1a3fd5 Binary files /dev/null and b/electron/build/icon.icns differ diff --git a/electron/package-lock.json b/electron/package-lock.json index 554ab0e4..a63a1f3b 100644 --- a/electron/package-lock.json +++ b/electron/package-lock.json @@ -151,18 +151,6 @@ } } }, - "@holochain/conductor-api": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@holochain/conductor-api/-/conductor-api-0.0.4.tgz", - "integrity": "sha512-s52H+JMtiWID8wsqkKVkbjNDrHeVD88X+XWEllIi9INc7md2nBkMKBVChc/qgpRFqrpj2X8j/Es9MtvIJYnQqg==", - "requires": { - "@msgpack/msgpack": "2.4.0", - "@types/ws": "^7.2.4", - "isomorphic-ws": "^4.0.1", - "nanoid": "^3.1.9", - "ws": "^7.3.0" - } - }, "@malept/cross-spawn-promise": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz", @@ -172,11 +160,6 @@ "cross-spawn": "^7.0.1" } }, - "@msgpack/msgpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.4.0.tgz", - "integrity": "sha512-5qzv53J43V8GaYsaETs29Q0Ehw9Dog6SG18MASZRQDuZYXtA5T7pymGE2S40NL0X8sjl8+TybmRa5O8d45V7MQ==" - }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -246,7 +229,8 @@ "@types/node": { "version": "15.0.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.1.tgz", - "integrity": "sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==" + "integrity": "sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==", + "dev": true }, "@types/plist": { "version": "3.0.2", @@ -294,14 +278,6 @@ "dev": true, "optional": true }, - "@types/ws": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-PbeN0Eydl7LQl4OIav29YmkO2LxbVuz3nZD/kb19lOS+wLgIkRbWMNmU/QQR7ABpOJ7D7xDOU8co7iohObewrw==", - "requires": { - "@types/node": "*" - } - }, "@types/yargs": { "version": "15.0.13", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", @@ -645,8 +621,7 @@ "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, "balanced-match": { "version": "1.0.2", @@ -1162,7 +1137,6 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -1426,6 +1400,15 @@ "resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.3.5.tgz", "integrity": "sha512-J5Ew3axdk7W4jzzxKLSAi1sqbcAoo9CzHuBVsG0tT47j256xKulNrWFf3lZmHJ1KDXOQUcuwOngQF0jjmpEdpw==" }, + "electron-notarize": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.0.0.tgz", + "integrity": "sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og==", + "requires": { + "debug": "^4.1.1", + "fs-extra": "^9.0.1" + } + }, "electron-publish": { "version": "22.10.5", "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.10.5.tgz", @@ -1878,7 +1861,6 @@ "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", @@ -2048,8 +2030,7 @@ "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", - "dev": true + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, "graceful-readlink": { "version": "1.0.1", @@ -2331,11 +2312,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" - }, "istextorbinary": { "version": "5.12.0", "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-5.12.0.tgz", @@ -2426,7 +2402,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" @@ -2602,13 +2577,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "nanoid": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", - "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "natural-compare": { "version": "1.4.0", @@ -3552,8 +3521,7 @@ "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "update-notifier": { "version": "5.1.0", @@ -3742,11 +3710,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "ws": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", - "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==" - }, "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", diff --git a/electron/package.json b/electron/package.json index e5f0875d..94417aa8 100644 --- a/electron/package.json +++ b/electron/package.json @@ -16,6 +16,7 @@ "license": "CAL-1.0", "build": { "productName": "Acorn", + "afterSign": "./afterSignHook.js", "appId": "com.harris-braun-enterprises.acorn", "copyright": "Copyright © 2021 Harris-Braun Enterprises LLC", "asarUnpack": "binaries/**/*", @@ -42,6 +43,7 @@ }, "dependencies": { "electron-log": "^4.3.5", + "electron-notarize": "^1.0.0", "split": "^1.0.1" } }