Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc - Release using channels #2595

Merged
merged 10 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
* [Loading App Dependencies Manually](tutorials/loading-app-dependencies-manually.md)
* [Two package.json Structure](tutorials/two-package-structure.md)
* [macOS Kernel Extensions](tutorials/macos-kernel-extensions.md)
* [Release using channels](tutorials/release-using-channels.md)

* Programmatic API
* [electron-builder](api/electron-builder.md)

* [Donate](donate.md)
* [Donate](donate.md)
63 changes: 63 additions & 0 deletions docs/tutorials/release-using-channels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
> !!! This documentation is in "beta" and needed to be tested !!!

# Release using channels / Auto-updates with channels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please in the future use form "Header Must Use Capital Case".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, I've change this.


## Description
Channels are useful to distribute "beta" or "alpha" releases of your application to a choosen set of users. This allow to test an application before release it as "stable".

Users which receive "beta" version will get "stable" versions too. Otherwise users who doesn't wanna "beta" will only get "stable" releases.

They are tree channels level ordered by stability :
1. "stable", your application is stable and this is the default one (example: 1.3.2)
2. "beta" which mean your application works, but should have some bugs (example: 1.3.2-beta)
3. "alpha" which mean your application is not stable and in active development (example: 1.3.2-alpha)


## Configuration
To release using channels, you should config electron-builder and define the channels to use in client side.

### Electron-Builder
By default (without using channels), all application releases use the "stable" channel.

If you want to use channels, you should add this to your package.json:

```
"version": "x.x.x-beta",
...
"build": {
"generateUpdatesFilesForAllChannels": true,
...
}
```

> Note: `allowDowngrade` is automatically set to `true` when `generateUpdatesFilesForAllChannels = true`, so you doesn't need to set it.

All you have to do to release using channels is to define the channel in the version tag of the `package.json`. Add "-beta" or "-alpha" (nothing for stable) to automatically build for the related channel.


### Your application
All you need to do here is to define which channel the user will receive.

`autoUpdater.setFeedURL({url: 'https://www.yoursite.com', channel: 'beta'});`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now user can set channel, setFeedURL not required, right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. Where do we set channel ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this:

set channel(value: string | null) {
. Needs to be documented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwent and @develar Thanks for feedback. I've remove the "old" setFeedURL and replace it with autoUpdater.channel(). I will add the doc for channel() too.


> note: remove the need to define url !

The following versions will be distributed to the users according to the channel you set in `setFeedURL()` :
- "stable": users will only get "stable" versions
- "beta": users will get "beta" and "stable" version
- "alpha": users will get "alpha", "beta" and "stable" version


### Advanced (optional)
todo:
- allow downgrade
-

## How to use it / Example
Imagine your application version is 1.0.1 (stable).

If you want to release a beta for the 1.1.0 version, you only need to update the package.json "version" with "1.1.0-beta".

And when your application is stable enouth and you want to release it to all users, only remove the "-beta" tag from the package.json "version" tag.