@@ -20,6 +20,8 @@ const appleTeamId = process.env.APPLE_TEAM_ID;
2020const appleNotarizationKey = process . env . APPLE_NOTARIZATION_KEY ;
2121const appleNotarizationKeyId = process . env . APPLE_NOTARIZATION_KEY_ID ;
2222const appleNotarizationIssuer = process . env . APPLE_NOTARIZATION_ISSUER ;
23+ const skipNotarize =
24+ isTruthy ( process . env . INLINE_SKIP_NOTARIZE ) || isTruthy ( process . env . SKIP_NOTARIZE ) ;
2325const defaultTargets = [
2426 "aarch64-apple-darwin" ,
2527 "x86_64-apple-darwin" ,
@@ -58,6 +60,10 @@ function trimSlash(value: string): string {
5860 return value . replace ( / ^ \/ + | \/ + $ / g, "" ) ;
5961}
6062
63+ function isTruthy ( value : string | undefined ) : boolean {
64+ return [ "1" , "true" , "yes" ] . includes ( value ?. toLowerCase ( ) ?? "" ) ;
65+ }
66+
6167function getR2Context ( ) {
6268 const accessKeyId = requireEnv ( "PUBLIC_RELEASES_R2_ACCESS_KEY_ID" ) ;
6369 const secretAccessKey = requireEnv ( "PUBLIC_RELEASES_R2_SECRET_ACCESS_KEY" ) ;
@@ -361,7 +367,7 @@ async function signAndNotarize(context: ReleaseContext) {
361367 Boolean ( appleNotarizationKeyId ) &&
362368 Boolean ( appleNotarizationIssuer ) ;
363369 const hasAppleId = Boolean ( appleId ) && Boolean ( applePassword ) && Boolean ( appleTeamId ) ;
364- if ( ! hasApiKey && ! hasAppleId ) {
370+ if ( ! skipNotarize && ! hasApiKey && ! hasAppleId ) {
365371 throw new Error (
366372 "Missing notarization env vars: provide APPLE_NOTARIZATION_KEY, APPLE_NOTARIZATION_KEY_ID, APPLE_NOTARIZATION_ISSUER or APPLE_ID, APPLE_PASSWORD, APPLE_TEAM_ID" ,
367373 ) ;
@@ -380,7 +386,8 @@ async function signAndNotarize(context: ReleaseContext) {
380386 10 ,
381387 ) ;
382388
383- const keyPath = hasApiKey ? join ( context . releaseDir , "notarization-key.p8" ) : null ;
389+ const keyPath =
390+ ! skipNotarize && hasApiKey ? join ( context . releaseDir , "notarization-key.p8" ) : null ;
384391 if ( keyPath && appleNotarizationKey ) {
385392 await writeFile ( keyPath , appleNotarizationKey , { mode : 0o600 } ) ;
386393 }
@@ -405,6 +412,15 @@ async function signAndNotarize(context: ReleaseContext) {
405412 { cwd : cliDir } ,
406413 ) ;
407414
415+ await runCommand ( "codesign" , [ "--verify" , "--strict" , "--verbose=2" , binaryPath ] , {
416+ cwd : cliDir ,
417+ } ) ;
418+
419+ if ( skipNotarize ) {
420+ console . log ( `Skipping notarization for ${ target } (INLINE_SKIP_NOTARIZE=1).` ) ;
421+ continue ;
422+ }
423+
408424 await runCommand ( "zip" , [ "-j" , "-X" , zipPath , binaryPath ] , { cwd : cliDir } ) ;
409425
410426 const args = notarytoolSubmitArgs ( zipPath , keyPath ) ;
@@ -440,9 +456,6 @@ async function signAndNotarize(context: ReleaseContext) {
440456 await sleep ( delay ) ;
441457 }
442458
443- await runCommand ( "codesign" , [ "--verify" , "--strict" , "--verbose=2" , binaryPath ] , {
444- cwd : cliDir ,
445- } ) ;
446459 }
447460 } finally {
448461 if ( keyPath ) {
0 commit comments