Skip to content

Commit

Permalink
WIP: Testing MAS builds locally #1196
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Feb 4, 2017
1 parent 09cb5ea commit c19e32e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .idea/electron-builder.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions packages/electron-builder/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ export default class MacPackager extends PlatformPackager<MacOptions> {
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")
Expand All @@ -145,8 +148,9 @@ export default class MacPackager extends PlatformPackager<MacOptions> {

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,
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/options/macOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/*
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -888,9 +888,9 @@ [email protected]:
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"
Expand Down

0 comments on commit c19e32e

Please sign in to comment.