Skip to content

Commit 15a3e50

Browse files
authored
Merge pull request #1965 from erstec/osx64-zip-notarization-fix
osx64 .zip notarization fix
2 parents 500b853 + ad4eea1 commit 15a3e50

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

gulpfile.js

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,39 @@ gulp.task('release-osx64', function(done) {
408408
archive.directory(src, 'INAV Configurator.app');
409409
output.on('close', function() {
410410
if (getArguments().notarize) {
411-
console.log('Notarizing DMG file: ' + zipFilename);
412-
const notarizeArgs = ['macapptool', '-v', '1', 'notarize'];
411+
console.log('Notarizing ZIP file: ' + zipFilename);
412+
const notarizeArgs = ['xcrun', 'notarytool', 'submit'];
413+
notarizeArgs.push(zipFilename);
413414
const notarizationUsername = getArguments()['notarization-username'];
414415
if (notarizationUsername) {
415-
notarizeArgs.push('-u', notarizationUsername)
416+
notarizeArgs.push('--apple-id', notarizationUsername)
417+
} else {
418+
throw new Error('Missing notarization username');
416419
}
417420
const notarizationPassword = getArguments()['notarization-password'];
418421
if (notarizationPassword) {
419-
notarizeArgs.push('-p', notarizationPassword)
422+
notarizeArgs.push('--password', notarizationPassword)
423+
} else {
424+
throw new Error('Missing notarization password');
425+
}
426+
const notarizationTeamId = getArguments()['notarization-team-id'];
427+
if (notarizationTeamId) {
428+
notarizeArgs.push('--team-id', notarizationTeamId)
429+
} else {
430+
throw new Error('Missing notarization Team ID');
431+
}
432+
notarizeArgs.push('--wait');
433+
434+
const notarizationWebhook = getArguments()['notarization-webhook'];
435+
if (notarizationWebhook) {
436+
notarizeArgs.push('--webhook', notarizationWebhook);
420437
}
421-
notarizeArgs.push(zipFilename)
422438
execSync.apply(this, notarizeArgs);
439+
440+
console.log('Stapling ZIP file: ' + zipFilename);
441+
const stapleArgs = ['macapptool', '-v', '1', 'staple'];
442+
stapleArgs.push(zipFilename)
443+
execSync.apply(this, stapleArgs);
423444
}
424445
done();
425446
});

0 commit comments

Comments
 (0)