From b4704f4912a3728c0b21352d3f726a2eb1a2913d Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Thu, 14 Nov 2019 13:47:47 +0100 Subject: [PATCH] chore(project): skip notarization for non-release --- tasks/after-sign/notarize.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/tasks/after-sign/notarize.js b/tasks/after-sign/notarize.js index a0c346672b..5ae7ebbe30 100644 --- a/tasks/after-sign/notarize.js +++ b/tasks/after-sign/notarize.js @@ -15,7 +15,8 @@ const { isPullRequest } = require('builder-util'); module.exports = async function(context) { const { electronPlatformName, - appOutDir + appOutDir, + packager } = context; if (electronPlatformName !== 'darwin') { @@ -23,24 +24,34 @@ module.exports = async function(context) { } if (isPullRequest()) { - console.log(' • skipping notarization for pull request'); + console.log(' • skipped notarization for pull request'); return; } const { - APPLE_DEVELOPER_ID: appleId, - APPLE_DEVELOPER_ID_PASSWORD: appleIdPassword - } = process.env; - - const { - productFilename: appName, info: { - config: { - appId + options: { + publish } } - } = context.packager.appInfo; + } = packager; + + if (publish !== 'always') { + console.log(' • skipped notarization for non-release'); + + return; + } + + const { + appId, + productName: appName + } = packager.config; + + const { + APPLE_DEVELOPER_ID: appleId, + APPLE_DEVELOPER_ID_PASSWORD: appleIdPassword + } = process.env; const appPath = `${appOutDir}/${appName}.app`;