Skip to content

Commit

Permalink
fix: add skipVerification workaround for MacOS notarize
Browse files Browse the repository at this point in the history
  • Loading branch information
filfreire committed Jan 10, 2023
1 parent 1bd574b commit 017f98d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thin-bags-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": major
---

Add skipVerification flag in Mac's notarize options
7 changes: 7 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -3716,6 +3716,13 @@
"string"
]
},
"skipVerification": {
"description": "Skip spctl verification when notarizing. Needed in some edge-cases when running electron-builder in CI",
"type": [
"null",
"boolean"
]
},
"teamId": {
"description": "The team ID you want to notarize under. Only needed if using `notarytool`",
"type": [
Expand Down
6 changes: 5 additions & 1 deletion packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,11 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
const options = this.generateOptions(appPath, appleId, appleIdPassword)
await notarize(options)
// Verify
await spawn("spctl", ["-a", "-t", "open", "--context", "context:primary-signature", "-v", `"${appPath}"`])
if (typeof notarizeOptions === "object" && notarizeOptions?.skipVerification) {
log.info({ reason: "`skipVerification` is explicitly set to true" }, "skipped spctl verification")
} else {
await spawn("spctl", ["-a", "-t", "open", "--context", "context:primary-signature", "-v", `"${appPath}"`])
}
log.info(null, "notarization successful")
}

Expand Down
5 changes: 5 additions & 0 deletions packages/app-builder-lib/src/options/macOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export interface NotarizeOptions {
* The team ID you want to notarize under. Only needed if using `notarytool`
*/
readonly teamId?: string | null

/**
* Skip spctl verification when notarizing. Needed in some edge-cases when running electron-builder in CI
*/
readonly skipVerification?: boolean | null
}

export interface DmgOptions extends TargetSpecificOptions {
Expand Down

0 comments on commit 017f98d

Please sign in to comment.