Skip to content

Commit

Permalink
fix(deployment): Mac updates breaking change
Browse files Browse the repository at this point in the history
Close #2276
  • Loading branch information
develar committed Nov 7, 2017
1 parent d88236b commit f664497
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 34 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"7zip-bin": "^2.2.7",
"archiver": "^2.1.0",
"async-exit-hook": "^2.0.1",
"aws-sdk": "^2.145.0",
"aws-sdk": "^2.146.0",
"bluebird-lst": "^1.0.5",
"chalk": "^2.3.0",
"chromium-pickle-js": "^0.2.0",
Expand Down Expand Up @@ -100,7 +100,7 @@
"globby": "^6.1.0",
"jest-cli": "^21.2.1",
"jest-junit": "^3.1.0",
"jsdoc-to-markdown": "^3.0.0",
"jsdoc-to-markdown": "^3.0.1",
"path-sort": "^0.1.0",
"ts-babel": "^4.1.8",
"ts-jsdoc": "^2.0.6",
Expand Down
41 changes: 28 additions & 13 deletions packages/electron-builder/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,32 @@ export class PublishManager implements PublishContext {
}
})

packager.artifactCreated(event => this.taskManager.addTask(this.artifactCreated(event)))
packager.artifactCreated(event => {
const publishConfiguration = event.publishConfig
if (publishConfiguration == null) {
this.taskManager.addTask(this.artifactCreated(event))
}
else if (this.isPublish) {
if (debug.enabled) {
debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set(["packager"]))},\n publishConfig: ${safeStringifyJson(publishConfiguration)}`)
}
this.scheduleUpload(publishConfiguration, event)
}
})
}

private scheduleUpload(publishConfig: PublishConfiguration, event: ArtifactCreated): void {
if (publishConfig.provider === "generic") {
return
}

const publisher = this.getOrCreatePublisher(publishConfig, event.packager)
if (publisher == null) {
debug(`${event.file} is not published: publisher is null, ${safeStringifyJson(publishConfig)}`)
return
}

this.taskManager.addTask(publisher.upload(event))
}

private async artifactCreated(event: ArtifactCreated) {
Expand All @@ -111,22 +136,12 @@ export class PublishManager implements PublishContext {

if (this.isPublish) {
for (const publishConfig of publishConfigs) {
if (publishConfig.provider === "generic") {
continue
}

if (this.cancellationToken.cancelled) {
debug(`${eventFile} is not published: cancelled`)
debug(`${event.file} is not published: cancelled`)
break
}

const publisher = this.getOrCreatePublisher(publishConfig, packager)
if (publisher == null) {
debug(`${eventFile} is not published: publisher is null, ${safeStringifyJson(publishConfig)}`)
continue
}

this.taskManager.addTask(publisher.upload(event))
this.scheduleUpload(publishConfig, event)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/publish/updateUnfoBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export async function createUpdateInfoTasks(event: ArtifactCreated, _publishConf
}

for (const channel of computeChannelNames(packager, publishConfiguration)) {
if (isMac && isElectronUpdater1xCompatibility) {
if (isMac && isElectronUpdater1xCompatibility && event.file.endsWith(".zip")) {
// write only for first channel (generateUpdatesFilesForAllChannels is a new functionality, no need to generate old mac update info file)
isElectronUpdater1xCompatibility = false
await writeOldMacInfo(publishConfiguration, outDir, dir, channel, createdFiles, version, packager)
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-publisher-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"fs-extra-p": "^4.4.4",
"aws-sdk": "^2.145.0",
"aws-sdk": "^2.146.0",
"mime": "^2.0.3",
"electron-publish": "~0.0.0-semantic-release",
"builder-util": "^0.0.0-semantic-release",
Expand Down
6 changes: 6 additions & 0 deletions packages/electron-updater/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.16.2

### Features

* [Use the only HTTP request to download all changed blocks](https://github.com/electron-userland/electron-builder/releases/tag/v19.45.1).

## 2.16.0

### Features
Expand Down
3 changes: 0 additions & 3 deletions test/out/mac/__snapshots__/macPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ Object {
Object {
"file": "latest-mac.json",
},
Object {
"file": "latest-mac.json",
},
Object {
"file": "latest-mac.yml",
"fileContent": Object {
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"

aws-sdk@^2.145.0:
version "2.145.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.145.0.tgz#085bb4553231defd93b96b0d95023717c9c3c093"
aws-sdk@^2.146.0:
version "2.146.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.146.0.tgz#e2d75585a030dae116ae32cbf42c496688d04efb"
dependencies:
buffer "4.9.1"
crypto-browserify "1.0.9"
Expand Down Expand Up @@ -1110,7 +1110,7 @@ [email protected]:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"

config-master@^3.0.0:
config-master@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/config-master/-/config-master-3.1.0.tgz#667663590505a283bf26a484d68489d74c5485da"
dependencies:
Expand Down Expand Up @@ -1408,7 +1408,7 @@ [email protected]:
version "0.1.5"
resolved "https://registry.yarnpkg.com/direction/-/direction-0.1.5.tgz#ce5d797f97e26f8be7beff53f7dc40e1c1a9ec4c"

dmd@^3.0.0:
dmd@^3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/dmd/-/dmd-3.0.6.tgz#94c0e0fb88d1cb6b82837595053de7919c753c25"
dependencies:
Expand Down Expand Up @@ -2875,20 +2875,20 @@ jsdoc-parse@^3.0.0:
sort-array "^1.1.1"
test-value "^2.1.0"

jsdoc-to-markdown@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-to-markdown/-/jsdoc-to-markdown-3.0.0.tgz#cc8a94f1f412ac1da4bac1657475b0975ee8161a"
jsdoc-to-markdown@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/jsdoc-to-markdown/-/jsdoc-to-markdown-3.0.1.tgz#115962a20ec345d7dbe8327056bf7e965687a92f"
dependencies:
array-back "^1.0.4"
array-back "^2.0.0"
command-line-tool "^0.7.0"
config-master "^3.0.0"
dmd "^3.0.0"
config-master "^3.1.0"
dmd "^3.0.6"
jsdoc-api "^3.0.0"
jsdoc-parse "^3.0.0"
jsdoc2md-stats "^2.0.0"
walk-back "^2.0.1"
jsdoc2md-stats "^2.0.1"
walk-back "^3.0.0"

jsdoc2md-stats@^2.0.0:
jsdoc2md-stats@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/jsdoc2md-stats/-/jsdoc2md-stats-2.0.1.tgz#bd8343734cfe69ea8050a17931251293f0d9047b"
dependencies:
Expand Down

0 comments on commit f664497

Please sign in to comment.