@@ -408,18 +408,39 @@ gulp.task('release-osx64', function(done) {
408
408
archive . directory ( src , 'INAV Configurator.app' ) ;
409
409
output . on ( 'close' , function ( ) {
410
410
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 ) ;
413
414
const notarizationUsername = getArguments ( ) [ 'notarization-username' ] ;
414
415
if ( notarizationUsername ) {
415
- notarizeArgs . push ( '-u' , notarizationUsername )
416
+ notarizeArgs . push ( '--apple-id' , notarizationUsername )
417
+ } else {
418
+ throw new Error ( 'Missing notarization username' ) ;
416
419
}
417
420
const notarizationPassword = getArguments ( ) [ 'notarization-password' ] ;
418
421
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 ) ;
420
437
}
421
- notarizeArgs . push ( zipFilename )
422
438
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 ) ;
423
444
}
424
445
done ( ) ;
425
446
} ) ;
0 commit comments