notarize pkg

This commit is contained in:
Eugene Pankov
2020-05-07 17:37:39 +02:00
parent ee1d465bf6
commit 197824004e
4 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
const fs = require('fs')
const signHook = require('./afterSignHook')
module.exports = async function (params) {
// notarize the app on Mac OS only.
if (process.platform !== 'darwin' || !process.env.GITHUB_REF || !process.env.GITHUB_REF.startsWith('refs/tags/')) {
return
}
console.log('afterBuild hook triggered')
let pkgName = fs.readdirSync('dist').find(x => x.endsWith('.pkg'))
signHook({
appOutDir: 'dist',
_pathOverride: pkgName,
})
}

View File

@@ -13,7 +13,7 @@ module.exports = async function (params) {
let appId = 'org.terminus'
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`)
let appPath = path.join(params.appOutDir, params._pathOverride || `${params.packager.appInfo.productFilename}.app`)
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`)
}