Skip to content

Publishing Artifacts

develar edited this page Jun 22, 2016 · 5 revisions

Travis and AppVeyor support publishing artifacts. But it requires additional configuration. For each CI (since AppVeyor can build only Windows and Travis only MacOS / Linux).

electron-builder allows you to just add GH_TOKEN environment variable and that's all.

Currently, only GitHub Releases is supported.

--publish option values:

Value Description
onTag on tag push only
onTagOrDraft on tag push or if draft release exists
always always publish
never never publish

But please consider using automatic rules instead of explicitly specifying publish:

  • If CI server detected, — onTagOrDraft.

    NOTICE: This is the recommended workflow.

  1. Draft a new release. Set the "Tag version" to the value of version in your application package.json, and prefix it with v. "Release title" can be anything you want.
  • For example, if your application package.json version is 1.0, your draft's "Tag version" would be v1.0.
  1. Push some commits. Every CI build will update the artifacts attached to this draft.
  2. Once you are done, publish the release. GitHub will tag the latest commit for you.

The benefit of this workflow is that it allows you to always have the latest artifacts, and the release can be published once it is ready.

  • 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.

Add to scripts in the development package.json:

"release": "build"

and if you run npm run release, a release will be drafted (if doesn't already exist) and artifacts published.

GitHub Repository

No option to specify GitHub repository, detected automatically using:

  • repository in the application or development package.json,
  • if not set, env TRAVIS_REPO_SLUG or APPVEYOR_ACCOUNT_NAME/APPVEYOR_PROJECT_NAME or CIRCLE_PROJECT_USERNAME/CIRCLE_PROJECT_REPONAME,
  • if no env, from .git/config origin url.

Clone this wiki locally