Skip to content

Commit

Permalink
feat(deployment): Only first artifact is uploaded to GitHub
Browse files Browse the repository at this point in the history
Close #1133
  • Loading branch information
develar committed Jan 19, 2017
1 parent 248855c commit e3ab55b
Show file tree
Hide file tree
Showing 18 changed files with 5,184 additions and 4,524 deletions.
9 changes: 8 additions & 1 deletion docs/Publishing Artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Travis and AppVeyor support publishing artifacts. But it requires additional con

Currently, [GitHub Releases](https://help.github.com/articles/about-releases/) and [Bintray](https://bintray.com) are supported.

## CLI Flags
```
Publishing:
--publish, -p [choices: "onTag", "onTagOrDraft", "always", "never"]
--draft Create a draft (unpublished) releas [boolean]
--prerelease Identify the release as a prerelease [boolean]
```
CLI `--publish` option values:

| Value | Description
Expand All @@ -28,7 +35,7 @@ But please consider using automatic rules instead of explicitly specifying `publ

* If CI server reports that tag was pushed, — `onTag`.

Release will be drafted (if doesn't already exist) and artifacts published only if tag was pushed.
Release will be drafted (if doesn't already exist) and artifacts published only if tag was pushed.

* If [npm script](https://docs.npmjs.com/misc/scripts) named `release`, — `always`.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
"7zip-bin": "^2.0.4",
"archiver": "^1.3.0",
"asar-electron-builder": "^0.13.5",
"bluebird-lst-c": "^1.0.5",
"bluebird-lst-c": "^1.0.6",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
"cuint": "^0.2.2",
"electron-download-tf": "3.1.0",
"electron-macos-sign": "~1.4.0",
"fs-extra-p": "^3.0.3",
"electron-macos-sign": "~1.5.0",
"fs-extra-p": "^3.1.0",
"hosted-git-info": "^2.1.5",
"ini": "^1.3.4",
"is-ci": "^1.0.10",
Expand Down Expand Up @@ -71,8 +71,8 @@
"jest-cli": "^18.1.0",
"jest-environment-node-debug": "^0.0.2",
"path-sort": "^0.1.0",
"source-map-support": "^0.4.9",
"ts-babel": "^1.3.4",
"source-map-support": "^0.4.10",
"ts-babel": "^1.3.5",
"tslint": "^4.3.1",
"typescript": "^2.1.5",
"whitespace": "^2.1.0"
Expand Down
1 change: 0 additions & 1 deletion packages/electron-auto-updater/.yarnclean

This file was deleted.

6 changes: 3 additions & 3 deletions packages/electron-auto-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"out"
],
"dependencies": {
"bluebird-lst-c": "^1.0.5",
"fs-extra-p": "^3.0.3",
"bluebird-lst-c": "^1.0.6",
"fs-extra-p": "^3.1.0",
"js-yaml": "^3.7.0",
"semver": "^5.3.0",
"source-map-support": "^0.4.9",
"source-map-support": "^0.4.10",
"electron-builder-http": "0.0.0-semantic-release"
},
"typings": "./out/electron-auto-updater.d.ts"
Expand Down
89 changes: 0 additions & 89 deletions packages/electron-auto-updater/yarn.lock

This file was deleted.

42 changes: 0 additions & 42 deletions packages/electron-builder-http/.yarnclean

This file was deleted.

2 changes: 1 addition & 1 deletion packages/electron-builder-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"//": "client can also install js-yaml to load yaml",
"dependencies": {
"debug": "2.6.0",
"fs-extra-p": "^3.0.3"
"fs-extra-p": "^3.1.0"
},
"typings": "./out/electron-builder-http.d.ts"
}
7 changes: 0 additions & 7 deletions packages/electron-builder-http/yarn.lock

This file was deleted.

4 changes: 2 additions & 2 deletions packages/electron-builder-squirrel-windows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"electron-builder-util": "~0.0.0-semantic-release",
"electron-builder-core": "~0.0.0-semantic-release",
"bluebird-lst-c": "^1.0.5",
"fs-extra-p": "^3.0.3",
"bluebird-lst-c": "^1.0.6",
"fs-extra-p": "^3.1.0",
"archiver": "^1.3.0"
},
"typings": "./out/electron-builder-squirrel-windows.d.ts"
Expand Down
6 changes: 3 additions & 3 deletions packages/electron-builder-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"out"
],
"dependencies": {
"fs-extra-p": "^3.0.3",
"fs-extra-p": "^3.1.0",
"is-ci": "^1.0.10",
"stat-mode": "^0.2.2",
"bluebird-lst-c": "^1.0.5",
"bluebird-lst-c": "^1.0.6",
"chalk": "^1.1.3",
"debug": "2.6.0",
"node-emoji": "^1.5.1",
"electron-builder-http": "~0.0.0-semantic-release",
"source-map-support": "^0.4.9",
"source-map-support": "^0.4.10",
"7zip-bin": "^2.0.4"
},
"typings": "./out/electron-builder-util.d.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder-util/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function copyFile(src: string, dest: string, stats?: Stats | null, isUseH
readStream.pipe(writeStream)
})

writeStream.once("finish", resolve)
writeStream.once("close", resolve)
})
}

Expand Down
6 changes: 3 additions & 3 deletions packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"dependencies": {
"7zip-bin": "^2.0.4",
"asar-electron-builder": "^0.13.5",
"bluebird-lst-c": "^1.0.5",
"bluebird-lst-c": "^1.0.6",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
"cuint": "^0.2.2",
"electron-builder-core": "0.0.0-semantic-release",
"electron-builder-http": "0.0.0-semantic-release",
"electron-builder-util": "0.0.0-semantic-release",
"electron-download-tf": "3.1.0",
"electron-macos-sign": "~1.4.0",
"fs-extra-p": "^3.0.3",
"electron-macos-sign": "~1.5.0",
"fs-extra-p": "^3.1.0",
"hosted-git-info": "^2.1.5",
"ini": "^1.3.4",
"is-ci": "^1.0.10",
Expand Down
15 changes: 6 additions & 9 deletions packages/electron-builder/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Packager } from "../packager"
import { PlatformPackager } from "../platformPackager"
import { debug, isEmptyOrSpaces, asArray} from "electron-builder-util"
import { Publisher, PublishOptions, getResolvedPublishConfig } from "./publisher"
import { Publisher, PublishOptions, getResolvedPublishConfig, getCiTag } from "./publisher"
import BluebirdPromise from "bluebird-lst-c"
import { GitHubPublisher } from "./gitHubPublisher"
import { PublishConfiguration, GithubOptions, BintrayOptions, GenericServerOptions, VersionInfo, UpdateInfo } from "electron-builder-http/out/publishOptions"
Expand Down Expand Up @@ -34,8 +34,8 @@ export class PublishManager {
publishOptions.publish = "always"
}
else if (isAuthTokenSet() ) {
const tag = process.env.TRAVIS_TAG || process.env.APPVEYOR_REPO_TAG_NAME || process.env.CIRCLE_TAG
if (!isEmptyOrSpaces(tag)) {
const tag = getCiTag()
if (tag != null) {
log(`Tag ${tag} is defined, so artifacts will be published`)
publishOptions.publish = "onTag"
this.isPublishOptionGuessed = true
Expand All @@ -49,12 +49,9 @@ export class PublishManager {
}

if (publishOptions.publish != null && publishOptions.publish !== "never") {
// todo if token set as option
if (isAuthTokenSet()) {
this.isPublish = true
}
else if (isCi) {
log(`CI detected, publish is set to ${publishOptions.publish}, but neither GH_TOKEN nor BT_TOKEN is not set, so artifacts will be not published`)
this.isPublish = publishOptions.publish !== "onTag" || getCiTag() != null
if (this.isPublish && !isAuthTokenSet()) {
throw new Error(`Publish is set to ${publishOptions.publish}, but neither GH_TOKEN nor BT_TOKEN is not set`)

This comment has been minimized.

Copy link
@adamgoose

adamgoose Jan 27, 2017

Adding this seems to cause builds with publish to fail while using the generic provider in development.

}
}

Expand Down
Loading

0 comments on commit e3ab55b

Please sign in to comment.