diff --git a/.idea/electron-builder.iml b/.idea/electron-builder.iml index 5a0811a72be..e89b057ed9e 100644 --- a/.idea/electron-builder.iml +++ b/.idea/electron-builder.iml @@ -10,6 +10,7 @@ + diff --git a/package.json b/package.json index 5b619550efd..44403cc6e50 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "chromium-pickle-js": "^0.2.0", "cuint": "^0.2.2", "electron-download-tf": "3.2.0", - "electron-macos-sign": "~1.5.0", + "electron-macos-sign": "~1.6.0", "fs-extra-p": "^3.1.0", "hosted-git-info": "^2.1.5", "ini": "^1.3.4", diff --git a/packages/electron-builder/package.json b/packages/electron-builder/package.json index 14306239b88..2920c12b085 100644 --- a/packages/electron-builder/package.json +++ b/packages/electron-builder/package.json @@ -53,7 +53,7 @@ "electron-builder-http": "0.0.0-semantic-release", "electron-builder-util": "0.0.0-semantic-release", "electron-download-tf": "3.2.0", - "electron-macos-sign": "~1.5.0", + "electron-macos-sign": "~1.6.0", "fs-extra-p": "^3.1.0", "hosted-git-info": "^2.1.5", "ini": "^1.3.4", diff --git a/packages/electron-builder/src/macPackager.ts b/packages/electron-builder/src/macPackager.ts index 50112c61a91..9af8d767a2c 100644 --- a/packages/electron-builder/src/macPackager.ts +++ b/packages/electron-builder/src/macPackager.ts @@ -117,9 +117,12 @@ export default class MacPackager extends PlatformPackager { const qualifier = this.platformSpecificBuildOptions.identity const masQualifier = isMas ? (masOptions!!.identity || qualifier) : null - let name = await findIdentity(isMas ? "3rd Party Mac Developer Application" : "Developer ID Application", isMas ? masQualifier : qualifier, keychainName) + const explicitType = masOptions == null ? this.platformSpecificBuildOptions.type : masOptions.type + const type = explicitType || "distribution" + const isDevelopment = type === "development" + let name = await findIdentity(isDevelopment ? "Mac Developer" : (isMas ? "3rd Party Mac Developer Application" : "Developer ID Application"), isMas ? masQualifier : qualifier, keychainName) if (name == null) { - if (!isMas) { + if (!isMas && !isDevelopment && explicitType !== "distribution") { name = await findIdentity("Mac Developer", qualifier, keychainName) if (name != null) { warn("Mac Developer is used to sign app — it is only for development and testing, not for production") @@ -145,8 +148,9 @@ export default class MacPackager extends PlatformPackager { const appPath = path.join(appOutDir, `${this.appInfo.productFilename}.app`) const signOptions: any = { + skipIdentityValidation: true, identity: name!, - type: masOptions == null ? this.platformSpecificBuildOptions.type : masOptions.type, + type: type, platform: isMas ? "mas" : "darwin", version: this.info.electronVersion, app: appPath, diff --git a/packages/electron-builder/src/options/macOptions.ts b/packages/electron-builder/src/options/macOptions.ts index 6ff11dc6fa3..74d8b388610 100644 --- a/packages/electron-builder/src/options/macOptions.ts +++ b/packages/electron-builder/src/options/macOptions.ts @@ -58,7 +58,7 @@ export interface MacOptions extends PlatformSpecificBuildOptions { /* Whether to sign app for development or for distribution. One of `development`, `distribution`. Defaults to `distribution`. */ - readonly type?: string | null + readonly type?: "distribution" | "development" | null } /* diff --git a/yarn.lock b/yarn.lock index 03e968f0eba..e3e62710886 100644 --- a/yarn.lock +++ b/yarn.lock @@ -41,8 +41,8 @@ resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.29.tgz#29f4dd9314fbccb080d8bd84b9c23811ec5090c2" "@types/node@*": - version "7.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.4.tgz#9aabc135979ded383325749f508894c662948c8b" + version "7.0.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.5.tgz#96a0f0a618b7b606f1ec547403c00650210bfbb7" "@types/source-map-support@^0.2.28": version "0.2.28" @@ -888,9 +888,9 @@ electron-download-tf@3.2.0: semver "^5.3.0" sumchecker "^2.0.1" -electron-macos-sign@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/electron-macos-sign/-/electron-macos-sign-1.5.0.tgz#fe3a8acb755b5f568f1fe144e9e66cee44019448" +electron-macos-sign@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/electron-macos-sign/-/electron-macos-sign-1.6.0.tgz#56af59012dda368614222f9a3df2fd2fbe13ef31" dependencies: bluebird "^3.4.7" compare-version "^0.1.2"