@@ -221,7 +221,7 @@ impl BundleContext<'_> {
221221 bail ! ( "ditto failed to create zip for notarization" ) ;
222222 }
223223
224- match notarize ( & zip_path) . await {
224+ match notarize ( & zip_path, & app_dir ) . await {
225225 Ok ( ( ) ) => {
226226 let _ = fs:: remove_file ( & zip_path) ;
227227 }
@@ -356,7 +356,7 @@ impl BundleContext<'_> {
356356 std:: env:: var ( "APPLE_ID" ) . is_ok ( ) || std:: env:: var ( "APPLE_API_KEY" ) . is_ok ( ) ;
357357
358358 if should_notarize {
359- notarize ( & dmg_path) . await ?;
359+ notarize ( & dmg_path, & dmg_path ) . await ?;
360360 }
361361 }
362362
@@ -853,7 +853,7 @@ async fn sign_path(
853853}
854854
855855/// Notarize a .app or .dmg with Apple's notary service.
856- async fn notarize ( app_path : & Path ) -> Result < ( ) > {
856+ async fn notarize ( notarize_path : & Path , staple_path : & Path ) -> Result < ( ) > {
857857 let apple_id = std:: env:: var ( "APPLE_ID" ) . ok ( ) ;
858858 let apple_password = std:: env:: var ( "APPLE_PASSWORD" ) . ok ( ) ;
859859 let apple_team_id = std:: env:: var ( "APPLE_TEAM_ID" ) . ok ( ) ;
@@ -863,7 +863,7 @@ async fn notarize(app_path: &Path) -> Result<()> {
863863
864864 let mut cmd = Command :: new ( "xcrun" ) ;
865865 cmd. args ( [ "notarytool" , "submit" ] ) ;
866- cmd. arg ( app_path ) ;
866+ cmd. arg ( notarize_path ) ;
867867
868868 if let ( Some ( key) , Some ( issuer) , Some ( key_path) ) = ( & api_key, & api_issuer, & api_key_path) {
869869 cmd. args ( [ "--key" , key_path] ) ;
@@ -883,15 +883,15 @@ async fn notarize(app_path: &Path) -> Result<()> {
883883
884884 cmd. arg ( "--wait" ) ;
885885
886- tracing:: info!( "Submitting {} for notarization..." , app_path . display( ) ) ;
886+ tracing:: info!( "Submitting {} for notarization..." , notarize_path . display( ) ) ;
887887 run_command ( & mut cmd, "xcrun notarytool submit" ) . await ?;
888888
889889 tracing:: info!( "Stapling notarization ticket..." ) ;
890890 let mut staple_cmd = Command :: new ( "xcrun" ) ;
891- staple_cmd. args ( [ "stapler" , "staple" ] ) . arg ( app_path ) ;
891+ staple_cmd. args ( [ "stapler" , "staple" ] ) . arg ( staple_path ) ;
892892 run_command ( & mut staple_cmd, "xcrun stapler staple" ) . await ?;
893893
894- tracing:: info!( "Notarization complete for {}" , app_path . display( ) ) ;
894+ tracing:: info!( "Notarization complete for {}" , staple_path . display( ) ) ;
895895 Ok ( ( ) )
896896}
897897
0 commit comments