Skip to content

Commit

Permalink
fix(deployment): another fix for "only first artifact is uploaded to …
Browse files Browse the repository at this point in the history
…GitHub"

Close #1133
  • Loading branch information
develar committed Jan 24, 2017
1 parent 96c8ed9 commit 93b4d59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For an app that will be shipped to production, you should sign your application.
```
Then you can run `npm run dist` (to package in a distributable format (e.g. dmg, windows installer, deb package)) or `npm run pack` (only generates the package directory without really packaging it. This is useful for testing purposes).

To ensure your native dependencies are always matched electron version, simply add `"postinstall": "install-app-deps"` to your `package.json`. [Do not use Yarn.](https://github.com/yarnpkg/yarn/issues/1749)
To ensure your native dependencies are always matched electron version, simply add `"postinstall": "install-app-deps"` to your `package.json`.

5. If you have native addons of your own that are part of the application (not as a dependency), add `"nodeGypRebuild": true` to the `build` section of your development `package.json`.
:bulb: Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use [node-gyp-rebuild](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241488783) bin instead.
Expand Down
8 changes: 5 additions & 3 deletions packages/electron-builder/src/publish/gitHubPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ interface Asset {
export class GitHubPublisher extends Publisher {
private tag: string
private _releasePromise: Promise<Release>
private readonly httpExecutor: NodeHttpExecutor = new NodeHttpExecutor()
private readonly httpExecutor = new NodeHttpExecutor()

private readonly token: string

get releasePromise(): Promise<Release | null> {
if (this._releasePromise == null) {
this._releasePromise = this.token === "__test__" ? BluebirdPromise.resolve(<any>null) : this.getOrCreateRelease()
}
return this._releasePromise
}

Expand All @@ -56,10 +59,9 @@ export class GitHubPublisher extends Publisher {
}

this.tag = info.vPrefixedTagName === false ? version : `v${version}`
this._releasePromise = this.token === "__test__" ? BluebirdPromise.resolve(<any>null) : this.init()
}

private async init(): Promise<Release | null> {
private async getOrCreateRelease(): Promise<Release | null> {
// we don't use "Get a release by tag name" because "tag name" means existing git tag, but we draft release and don't create git tag
const releases = await githubRequest<Array<Release>>(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token)
for (const release of releases) {
Expand Down

0 comments on commit 93b4d59

Please sign in to comment.