Skip to content

Commit

Permalink
fix(deployment): Artifacts still get pushed to github releases marked…
Browse files Browse the repository at this point in the history
… as published

Close #1197
  • Loading branch information
develar committed Feb 1, 2017
1 parent b4941dd commit 3987b06
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/electron-builder/src/publish/gitHubPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,17 @@ export class GitHubPublisher extends Publisher {
const releases = await this.githubRequest<Array<Release>>(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token)
for (const release of releases) {
if (release.tag_name === this.tag || release.tag_name === this.version) {
if (release.draft || release.prerelease) {
if (release.draft) {
return release
}

// https://github.com/electron-userland/electron-builder/issues/1197
// https://electron-builder.slack.com/archives/general/p1485961449000202
if (this.options.draft == null || this.options.draft) {
warn(`Release with tag ${this.tag} already exists`)
return null
}

// https://github.com/electron-userland/electron-builder/issues/1133
// if release created < 2 hours — allow to upload
const publishedAt = release.published_at == null ? null : new Date(release.published_at)
Expand Down

0 comments on commit 3987b06

Please sign in to comment.