add script for notarizing macOS

This commit is contained in:
2022-12-10 14:15:58 -06:00
parent 4068199a03
commit 934dd89b21
3 changed files with 86 additions and 2 deletions
+41
View File
@@ -0,0 +1,41 @@
const notarize = require('@electron/notarize');
const fs = require('fs')
const path = require('path')
module.exports = async function (params) {
if (process.platform !== 'darwin') {
console.log('Only need to notarize MacOS, skipping')
return
}
console.log(params)
const appId = 'com.stagehacks.cueview'
const appPath = path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
)
if (!fs.existsSync(appPath)) {
console.log('App file not found skipping notarization.');
return;
}
console.log(
`Notarizing ${appId} found at ${appPath}`
)
if(process.env.APPLE_ID === undefined || process.env.APPLE_ID_PASSWORD === undefined){
console.log('Apple ID and Password must be set in order to notarize.')
return;
}
try {
await notarize.notarize({
appBundleId: appId,
appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
})
console.log(`Done notarizing ${appId}`)
} catch (error) {
console.error(error)
}
}
+41 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cue-view",
"version": "0.9.6-pre",
"version": "0.9.8-pre",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -37,6 +37,46 @@
"sumchecker": "^3.0.1"
}
},
"@electron/notarize": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.3.tgz",
"integrity": "sha512-9oRzT56rKh5bspk3KpAVF8lPKHYQrBnRwcgiOeR0hdilVEQmszDaAu0IPCPrwwzJN0ugNs0rRboTreHMt/6mBQ==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"fs-extra": "^9.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"
}
},
"jsonfile": {
"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"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
}
}
},
"@electron/universal": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.2.1.tgz",
+4 -1
View File
@@ -1,7 +1,7 @@
{
"name": "cue-view",
"productName": "Cue View",
"version": "0.9.7-pre",
"version": "0.9.8-pre",
"description": "A dashboard for everything in your show",
"main": "main.js",
"scripts": {
@@ -19,6 +19,7 @@
"homepage": "https://github.com/stagehacks/Cue-View",
"repository": "https://github.com/stagehacks/Cue-View",
"devDependencies": {
"@electron/notarize": "^1.2.3",
"electron": "^21.3.0",
"electron-builder": "^23.6.0",
"eslint": "^8.27.0",
@@ -40,9 +41,11 @@
"appId": "com.stagehacks.cueview",
"icon": "./src/img/",
"artifactName": "${name}.${os}.v${version}.${ext}",
"afterSign": "notarize.js",
"mac": {
"category": "Utilities",
"icon": "./src/img/icon.icns",
"hardenedRuntime": true,
"electronLanguages": [
"en"
],