Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.76 KB

File metadata and controls

52 lines (39 loc) · 1.76 KB

GitHub

The GitHub target publishes all your artifacts to GitHub releases, this allows your users to download the files straight from your repository. If your repository is open source you can use update.electronjs.org and get a free hosted update service.

Installation

npm install --save-dev @electron-forge/publisher-github

Usage

To use @electron-forge/publisher-github, add it to the publishers array in your Forge configuration:

{% code title="forge.config.js" %}

module.exports = {
  // ...
  publishers: [
    {
      name: '@electron-forge/publisher-github',
      config: {
        repository: {
          owner: 'me',
          name: 'awesome-thing'
        },
        prerelease: true
      }
    }
  ]
};

{% endcode %}

Configuration options are documented in PublisherGitHubConfig.

Uploading to GitHub Enterprise instances

You can use this target to publish to GitHub Enterprise using the host configuration options of octokitOptions. Check out the configuration options linked above.

Auto updating from GitHub

Updating from a GitHub release for a public repository is as simple as adding the update-electron-app module to your app's main process.

{% code title="main.js" %}

const { updateElectronApp } = require('update-electron-app');
updateElectronApp(); // additional configuration options available

{% endcode %}

If your GitHub release is in a private repository, you should check our Auto Update guide for alternative solutions.