11import BluebirdPromise from "bluebird-lst"
2- import { exec , InvalidConfigurationError , isEmptyOrSpaces , isEnvTrue , isPullRequest , log , TmpDir } from "builder-util/out/util"
2+ import { exec , InvalidConfigurationError , isEmptyOrSpaces , isEnvTrue , isPullRequest , log , TmpDir , retry } from "builder-util/out/util"
33import { copyFile , unlinkIfExists } from "builder-util/out/fs"
44import { Fields , Logger } from "builder-util/out/log"
55import { randomBytes , createHash } from "crypto"
@@ -11,6 +11,8 @@ import { getTempName } from "temp-file"
1111import { isAutoDiscoveryCodeSignIdentity } from "../util/flags"
1212import { importCertificate } from "./codesign"
1313import { Identity as _Identity } from "@electron/osx-sign/dist/cjs/util-identities"
14+ import { SignOptions } from "@electron/osx-sign/dist/cjs/types"
15+ import { signAsync } from "@electron/osx-sign"
1416
1517export const appleCertificatePrefixes = [ "Developer ID Application:" , "Developer ID Installer:" , "3rd Party Mac Developer Application:" , "3rd Party Mac Developer Installer:" ]
1618
@@ -213,13 +215,8 @@ async function importCerts(keychainFile: string, paths: Array<string>, keyPasswo
213215 }
214216}
215217
216- /** @private */
217- export function sign ( path : string , name : string , keychain : string ) : Promise < any > {
218- const args = [ "--deep" , "--force" , "--sign" , name , path ]
219- if ( keychain != null ) {
220- args . push ( "--keychain" , keychain )
221- }
222- return exec ( "/usr/bin/codesign" , args )
218+ export async function sign ( opts : SignOptions ) : Promise < void > {
219+ return retry ( ( ) => signAsync ( opts ) , 3 , 5000 , 5000 )
223220}
224221
225222export let findIdentityRawResult : Promise < Array < string > > | null = null
0 commit comments