Skip to content

Commit

Permalink
fix(mac): Update mac notarize keychain env var to be optional. Fixes: #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta committed Jan 31, 2024
1 parent 04f5784 commit c568d79
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-glasses-smell.md
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix(mac): Update mac notarize keychain env var to be optional
16 changes: 13 additions & 3 deletions packages/app-builder-lib/src/macPackager.ts
Expand Up @@ -21,7 +21,13 @@ import { isMacOsHighSierra } from "./util/macosVersion"
import { getTemplatePath } from "./util/pathManager"
import * as fs from "fs/promises"
import { notarize, NotarizeOptions } from "@electron/notarize"
import { LegacyNotarizePasswordCredentials, LegacyNotarizeStartOptions, NotaryToolStartOptions, NotaryToolCredentials } from "@electron/notarize/lib/types"
import {
LegacyNotarizePasswordCredentials,
LegacyNotarizeStartOptions,
NotaryToolStartOptions,
NotaryToolCredentials,
NotaryToolKeychainCredentials,
} from "@electron/notarize/lib/types"

export type CustomMacSignOptions = SignOptions
export type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>
Expand Down Expand Up @@ -533,8 +539,12 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
// option 3: keychain
const keychain = process.env.APPLE_KEYCHAIN
const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE
if (keychain && keychainProfile) {
return this.generateNotarizeOptions(appPath, undefined, { keychain, keychainProfile })
if (keychainProfile) {
let args: NotaryToolKeychainCredentials = { keychainProfile }
if (keychain) {
args = { ...args, keychain }
}
return this.generateNotarizeOptions(appPath, undefined, args)
}

// if no credentials provided, skip silently
Expand Down

0 comments on commit c568d79

Please sign in to comment.