Skip to content

Commit

Permalink
feat: Code signing for windows and mac in macOS
Browse files Browse the repository at this point in the history
Closes #822
  • Loading branch information
develar committed Oct 17, 2016
1 parent b1ae7d5 commit d238635
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
10 changes: 2 additions & 8 deletions nsis-auto-updater/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-auto-updater",
"version": "0.0.2",
"version": "0.0.3",
"description": "NSIS Auto Updater",
"main": "out/nsis-auto-updater/src/main.js",
"author": "Vladimir Krivosheev",
Expand All @@ -16,14 +16,8 @@
"fs-extra-p": "^1.1.10",
"ini": "^1.3.4",
"semver": "^5.3.0",
"source-map-support": "^0.4.4",
"tunnel-agent": "^0.4.3"
},
"bundledDependencies": [
"bluebird",
"fs-extra-p",
"ini",
"semver",
"tunnel-agent"
],
"typings": "./out/electron-auto-updater.d.ts"
}
10 changes: 10 additions & 0 deletions nsis-auto-updater/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ semver@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"

source-map-support:
version "0.4.4"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.4.tgz#0df5765a05a560c91bc8f8641cf79f2affc0322e"
dependencies:
source-map "^0.5.3"

source-map@^0.5.3:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"

tunnel-agent@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"read-installed": "^4.0.3",
"sanitize-filename": "^1.6.1",
"semver": "^5.3.0",
"source-map-support": "^0.4.3",
"source-map-support": "^0.4.4",
"tunnel-agent": "^0.4.3",
"update-notifier": "^1.0.2",
"uuid-1345": "^0.99.6",
Expand Down
4 changes: 3 additions & 1 deletion src/publish/gitHubPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export class GitHubPublisher implements Publisher {
let token = info.token
if (isEmptyOrSpaces(token)) {
token = process.env.GH_TOKEN
throw new Error(`GitHub Personal Access Token is not set, neither programmatically, nor using env "GH_TOKEN"`)
if (isEmptyOrSpaces(token)) {
throw new Error(`GitHub Personal Access Token is not set, neither programmatically, nor using env "GH_TOKEN"`)
}
}

this.token = token!
Expand Down
24 changes: 13 additions & 11 deletions src/winPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,27 @@ export class WinPackager extends PlatformPackager<WinBuildOptions> {
const subjectName = this.platformSpecificBuildOptions.certificateSubjectName
if (subjectName == null) {
const certificateFile = this.platformSpecificBuildOptions.certificateFile
const cscLink = this.options.cscLink
if (certificateFile != null) {
const certificatePassword = this.platformSpecificBuildOptions.certificatePassword || this.getCscPassword()
this.cscInfo = BluebirdPromise.resolve({
file: certificateFile,
password: certificatePassword == null ? null : certificatePassword.trim(),
})
}
else if (cscLink != null) {
this.cscInfo = downloadCertificate(cscLink, info.tempDirManager)
.then(path => {
return {
file: path,
password: this.getCscPassword(),
}
})
}
else {
this.cscInfo = BluebirdPromise.resolve(null)
const cscLink = process.env.WIN_CSC_LINK || this.options.cscLink
if (cscLink != null) {
this.cscInfo = downloadCertificate(cscLink, info.tempDirManager)
.then(path => {
return {
file: path,
password: this.getCscPassword(),
}
})
}
else {
this.cscInfo = BluebirdPromise.resolve(null)
}
}
}
else {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ async-each@^1.0.0:
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"

async@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.1.tgz#e11b6d10043f2254efb61a21163d840ccddb8d28"
version "2.1.2"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.2.tgz#612a4ab45ef42a70cde806bad86ee6db047e8385"
dependencies:
lodash "^4.14.0"

Expand Down Expand Up @@ -3943,8 +3943,8 @@ yargs-parser@^4.0.2:
camelcase "^3.0.0"

yargs@^6.0.0:
version "6.1.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.1.1.tgz#95968cdd9bda89d973215b43969b2c82ce0c8032"
version "6.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.2.0.tgz#9001048953def85495a2ce1dcfa690b7ab060fd1"
dependencies:
camelcase "^3.0.0"
cliui "^3.2.0"
Expand Down

0 comments on commit d238635

Please sign in to comment.