Skip to content

Commit

Permalink
fix: Getting AppVeyor to Generate an Installer (Build Artifacts)
Browse files Browse the repository at this point in the history
Closes #674
  • Loading branch information
develar committed Aug 22, 2016
1 parent b7121c5 commit bc9d437
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ NSIS only, [in progress](/~https://github.com/electron-userland/electron-builder/i

| Name | Description
| --- | ---
| **ext** | <a name="FileAssociation-ext"></a>The extension (minus the leading period). e.g. `png`
| **name** | <a name="FileAssociation-name"></a>The name. e.g. `PNG`
| **ext** | <a name="FileAssociation-ext"></a>The extension (minus the leading period). e.g. `png`.
| **name** | <a name="FileAssociation-name"></a>The name. e.g. `PNG`.
| description | <a name="FileAssociation-description"></a>*windows-only.* The description.
| icon | <a name="FileAssociation-icon"></a>*windows-only.* The path to icon (`.ico`), relative to `build` (build resources directory). Defaults to `${ext}.ico`.

Expand All @@ -180,8 +180,8 @@ macOS only.

| Name | Description
| --- | ---
| **name** | <a name="Protocol-name"></a>The name. e.g. `IRC server URL`
| **schemes** | <a name="Protocol-schemes"></a>The schemes. e.g. `["irc", "ircs"]`
| **name** | <a name="Protocol-name"></a>The name. e.g. `IRC server URL`.
| **schemes** | <a name="Protocol-schemes"></a>The schemes. e.g. `["irc", "ircs"]`.

<a name="MetadataDirectories"></a>
## `.directories`
Expand Down
18 changes: 13 additions & 5 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PublishOptions, Publisher } from "./publish/publisher"
import { GitHubPublisher } from "./publish/gitHubPublisher"
import { executeFinally } from "./util/promise"
import { Promise as BluebirdPromise } from "bluebird"
import { isEmptyOrSpaces } from "./util/util"
import { isEmptyOrSpaces, isCi } from "./util/util"
import { log, warn } from "./util/log"
import { Platform, Arch, archFromString } from "./metadata"
import { getRepositoryInfo } from "./repositoryInfo"
Expand Down Expand Up @@ -230,12 +230,20 @@ export async function build(rawOptions?: CliOptions): Promise<void> {
options.publish = "onTag"
isPublishOptionGuessed = true
}
else if ((process.env.CI || "").toLowerCase() === "true") {
log("CI detected, so artifacts will be published if draft release exists")
options.publish = "onTagOrDraft"
isPublishOptionGuessed = true
else {if (isCi()) {
log("CI detected, so artifacts will be published if draft release exists")
options.publish = "onTagOrDraft"
isPublishOptionGuessed = true
}
}
}
else {
log("CI detected, so artifacts will be published if draft release exists")
}
}

if (options.publish !== "never" && options.githubToken == null && isCi()) {
log(`CI detected, publish is set to ${options.publish}, but GH_TOKEN is not set, so artifacts will be not published`)
}

const publishTasks: Array<BluebirdPromise<any>> = []
Expand Down
1 change: 0 additions & 1 deletion src/packager/dirPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { emptyDir } from "fs-extra-p"
import { warn } from "../util/log"
import { AppInfo } from "../appInfo"
import { PlatformPackager } from "../platformPackager"
import { Protocol } from "../metadata"

const downloadElectron: (options: any) => Promise<any> = BluebirdPromise.promisify(require("electron-download"))
const extract: any = BluebirdPromise.promisify(require("extract-zip"))
Expand Down
3 changes: 3 additions & 0 deletions src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,7 @@ export function asArray<T>(v: n | T | Array<T>): Array<T> {
else {
return [v]
}
}
export function isCi(): boolean {
return (process.env.CI || "").toLowerCase() === "true"
}

0 comments on commit bc9d437

Please sign in to comment.