An example app for electron-updater-gh-releases.
- Download the app package (e.g. example-win32-ia32-v1.0.0.zip) from releases page. You must choose OLD VERSION.
- Extract zip file and execute an executable file (example or example.exe) of the app.
- The example app will start, and it will check a updating.
- It's a happy ending! The app has been updated to latest version.
Firstly please fork a project from https://github.com/mugifly/electron-updater-gh-releases-example/.
Then execute git clone command for your forked repository. Then install the dependency modules with using npm install command.
$ git clone https://github.com/YOUR-NAME/electron-updater-gh-releases-example.git
$ cd electron-updater-gh-releases-example/
$ npm install -g grunt-cli
$ npm install
Open app.js in your text editor. Then replace the value of "ghAccountName" to Your GitHub account name.
// Make an instance of Updater
var updater = new Updater({
execFileName: 'example',
appVersion: manifest.version,
releaseFileNamePrefix: 'example-',
ghAccountName: 'YOUR-NAME',
ghRepoName: 'electron-updater-gh-releases-example'
});
Then commit it to the repository.
$ git commit -a -m "Change: Example update"
The grunt command makes an distribution files of the Electron app.
$ grunt
After executed it, you can found the distribution files in dist/ directory as follows.
- example-linux-ia32/
- example-linux-x64/
- example-win32-ia32/
Nextly, please make a zip file by to compress each directory. That zip file becomes an release file.
$ zip -r example-linux-ia32-v1.0.0.zip example-linux-ia32/
$ zip -r example-linux-x64-v1.0.0.zip example-linux-x64/
$ zip -r example-win32-ia32-v1.0.0.zip example-linux-ia32/
Firstly, make a tag to GitHub on your project. The tag name is should follow to semantic versioning (e.g. v1.1.0).
$ git tag v1.1.0
$ git push origin v1.1.0
Nextly, open your project page in your browser, and access to "Releases" page. Then click "Tags" tab. It will show your pushed tags.
Well then, please click the "Add release notes" of just pushed tag. And fill to following fields:
- Release title: Same as tag name
- Description this release: Something is ok
- Attach binaries: Drag & drop the release file (zip file) into here
After that, click the "Publish release" button.
Now, your app was uploaded on Releases pages on GitHub. If you download and execute the app, it says it's latest version.
- Make an something changes.
- Change a version in package.json (e.g. 1.0.0 -> 1.2.0).
- Make a release file (zip file); See step-3.
- Make a tag as vX.Y.Z (e.g. v1.2.0) and upload the release file in Releases page; See step-4.
Public Domain