@@ -3,11 +3,12 @@ import util from 'util';
3
3
import codesign from 'node-codesign' ;
4
4
import { notarize as nodeNotarize } from 'electron-notarize' ;
5
5
import Config from './config' ;
6
+ import zip from './zip' ;
6
7
7
- const notarize = ( bundleId : string , executable : string , user : string , password : string ) => {
8
+ const notarize = ( bundleId : string , artifact : string , user : string , password : string ) => {
8
9
return nodeNotarize ( {
9
10
appBundleId : bundleId ,
10
- appPath : executable ,
11
+ appPath : artifact ,
11
12
appleId : user ,
12
13
appleIdPassword : password
13
14
} ) ;
@@ -25,22 +26,19 @@ const sign = (executable: string, identity: string) => {
25
26
} ) ;
26
27
} ;
27
28
28
- const publish = async ( executable : string , artifact : string , config : Config ) => {
29
- // Remove the zip that was created since the notarize process will create a
30
- // new zip.
29
+ const publish = async ( executable : string , artifact : string , platform : string , config : Config ) => {
31
30
console . log ( 'mongosh: removing unsigned zip:' , artifact ) ;
32
31
await util . promisify ( fs . unlink ) ( artifact ) ;
33
32
console . log ( 'mongosh: signing:' , executable ) ;
34
33
await sign ( executable , config . appleAppIdentity ) .
35
34
catch ( ( e ) => { console . error ( e ) ; throw e ; } ) ;
36
35
console . log ( 'mongosh: notarizing and zipping:' , executable ) ;
36
+ await zip ( executable , config . outputDir , platform , config . version ) ;
37
37
await notarize (
38
38
config . bundleId ,
39
- executable ,
39
+ artifact ,
40
40
config . appleUser ,
41
41
config . applePassword ) . catch ( ( e ) => { console . error ( e ) ; throw e ; } ) ;
42
- console . log ( 'mongosh: renaming notarized zip:' , artifact ) ;
43
- await util . promisify ( fs . rename ) ( `${ executable } .zip` , artifact ) ;
44
42
} ;
45
43
46
44
export default publish ;
0 commit comments