certificate.rs 627 B

12345678910111213141516171819202122
  1. use crate::Result;
  2. use tauri_bundler::bundle::macos_sign::{delete_keychain, setup_keychain};
  3. pub fn setup() -> Result<()> {
  4. if let (Some(certificate_encoded), Some(certificate_password)) = (
  5. std::env::var_os("APPLE_CERTIFICATE"),
  6. std::env::var_os("APPLE_CERTIFICATE_PASSWORD"),
  7. ) {
  8. // setup keychain allow you to import your certificate
  9. // for CI build
  10. setup_keychain(certificate_encoded, certificate_password)?;
  11. Ok(())
  12. } else {
  13. Err(anyhow::anyhow!(
  14. "Missing APPLE_CERTIFICATE and APPLE_CERTIFICATE_PASSWORD environment variables"
  15. ))
  16. }
  17. }
  18. pub fn delete() {
  19. delete_keychain();
  20. }