Change Windows signing to warning when missing token

This allows Windows builds to complete when the singing token is not present.
This commit is contained in:
J. Ryan Stinnett 2020-02-26 11:54:20 +00:00
parent 4916ed0870
commit 096a828e44
2 changed files with 28 additions and 19 deletions

View File

@ -11,9 +11,10 @@ exports.default = async function(context) {
const userId = process.env.NOTARIZE_APPLE_ID; const userId = process.env.NOTARIZE_APPLE_ID;
if (userId === undefined) { if (userId === undefined) {
console.warn( console.warn(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
"! Skipping notarisation: User ID not found, set NOTARIZE_APPLE_ID. !\n" + "! Skipping macOS notarisation. !\n" +
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", "! User ID not found, set NOTARIZE_APPLE_ID. !\n" +
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
); );
return; return;
} }

View File

@ -8,23 +8,31 @@ exports.default = async function(options) {
const appOutDir = path.dirname(inPath); const appOutDir = path.dirname(inPath);
// get the token passphrase from the keychain // get the token passphrase from the keychain
const tokenPassphrase = await new Promise((resolve, reject) => { let tokenPassphrase;
execFile( try {
'security', tokenPassphrase = await new Promise((resolve, reject) => {
['find-generic-password', '-s', 'riot_signing_token', '-w'], execFile(
{}, 'security',
(err, stdout) => { ['find-generic-password', '-s', 'riot_signing_token', '-w'],
if (err) { {},
console.error("Couldn't find signing token in keychain", err); (err, stdout) => {
// electron-builder seems to print '[object Object]' on the if (err) {
// console whether you reject with an Error or a string... reject(err);
reject(err); } else {
} else { resolve(stdout.trim());
resolve(stdout.trim()); }
} },
}, );
});
} catch (err) {
console.warn(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
"! Skipping Windows signing. !\n" +
"! Signing token not found in keychain. !\n" +
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
); );
}); return;
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let cmdLine = 'osslsigncode sign '; let cmdLine = 'osslsigncode sign ';