-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use notarytool instead of altool to codesign macos binaries (#1658)
- Loading branch information
1 parent
12d1a87
commit dee3597
Showing
5 changed files
with
85 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use crate::tools::Runner; | ||
use crate::utils::PKG_PROJECT_ROOT; | ||
|
||
use anyhow::Result; | ||
|
||
pub(crate) struct XcrunRunner { | ||
runner: Runner, | ||
} | ||
|
||
impl XcrunRunner { | ||
pub(crate) fn new() -> Self { | ||
let runner = Runner::new("xcrun"); | ||
|
||
XcrunRunner { runner } | ||
} | ||
|
||
pub(crate) fn notarize( | ||
&mut self, | ||
dist_zip: &str, | ||
apple_username: &str, | ||
apple_team_id: &str, | ||
notarization_password: &str, | ||
) -> Result<()> { | ||
crate::info!("Beginning notarization process..."); | ||
self.runner.set_bash_descriptor(format!("xcrun notarytool submit {dist_zip} --apple-id {apple_username} --apple-team-id {apple_team_id} --password xxxx-xxxx-xxxx-xxxx --wait --timeout 20m")); | ||
let project_root = PKG_PROJECT_ROOT.clone(); | ||
self.runner.exec( | ||
&[ | ||
"notarytool", | ||
"submit", | ||
dist_zip, | ||
"--apple-id", | ||
apple_username, | ||
"--team-id", | ||
apple_team_id, | ||
"--password", | ||
notarization_password, | ||
"--wait", | ||
"--timeout", | ||
"20m", | ||
], | ||
&project_root, | ||
None, | ||
)?; | ||
crate::info!("Notarization successful."); | ||
Ok(()) | ||
} | ||
} |