2016-10-18 04:41:57 +00:00
# Releasing
This document describes the process for releasing a new version of Electron.
2017-10-06 15:48:09 +00:00
## Find out what version change is needed
Is this a major, minor, patch, or beta version change? Read the [Version Change Rules ](docs/tutorial/electron-versioning.md#version-change-rules ) to find out.
2017-08-10 16:26:22 +00:00
2016-10-18 05:04:52 +00:00
## Create a temporary branch
2016-10-18 04:41:57 +00:00
2017-10-06 15:48:09 +00:00
- **If releasing beta,** create a new branch from `master` .
- **If releasing a stable version,** create a new branch from the beta branch you're stablizing.
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
Name the new branch `release` or anything you like.
2016-10-18 05:04:52 +00:00
```sh
git checkout master
git pull
git checkout -b release
```
This branch is created as a precaution to prevent any merged PRs from sneaking into a release between the time the temporary release branch is created and the CI builds are complete.
2016-10-18 04:41:57 +00:00
2017-08-03 19:55:33 +00:00
## Check for extant drafts
The upload script [looks for an existing draft release ](https://github.com/electron/electron/blob/7961a97d7ddbed657c6c867cc8426e02c236c077/script/upload.py#L173-L181 ). To prevent your new release
from clobbering an existing draft, check [the releases page] and
make sure there are no drafts.
2016-10-18 04:41:57 +00:00
## Bump the version
2017-09-06 20:41:51 +00:00
Run the `bump-version` script with arguments according to your need:
2017-09-06 20:44:41 +00:00
- `--bump=[major|minor|patch|beta]` to increment one of the version numbers, or
2017-09-06 20:41:51 +00:00
- `--stable` to indicate this is a stable version, or
- `--version={version}` to set version number directly.
**Note**: you can use both `--bump` and `--stable` simultaneously.
There is also a `dry-run` flag you can use to make sure the version number generated is correct before committing.
2016-10-18 04:41:57 +00:00
```sh
2017-09-06 20:41:51 +00:00
npm run bump-version -- --bump=patch --stable
2016-10-20 02:34:51 +00:00
git push origin HEAD
2016-10-18 04:41:57 +00:00
```
2016-10-18 05:04:52 +00:00
This will bump the version number in several files. See [this bump commit] for an example.
2016-10-18 04:41:57 +00:00
2017-08-03 19:55:33 +00:00
## Wait for builds :hourglass_flowing_sand:
The presence of the word [`Bump` ](https://github.com/electron/electron/blob/7961a97d7ddbed657c6c867cc8426e02c236c077/script/cibuild-linux#L3-L6 ) in the commit message created by the `bump-version` script
will [trigger the release process ](https://github.com/electron/electron/blob/7961a97d7ddbed657c6c867cc8426e02c236c077/script/cibuild#L82-L96 ).
To monitor the build progress, see the following pages:
2017-09-29 20:11:42 +00:00
- [208.52.191.140:8080/view/All/builds ](http://208.52.191.140:8080/view/All/builds ) for Mac
- [circleci.com/gh/electron ](https://circleci.com/gh/electron ) for Linux
- [windows-ci.electronjs.org/project/AppVeyor/electron ](https://windows-ci.electronjs.org/project/AppVeyor/electron ) for Windows
2017-08-03 19:55:33 +00:00
## Compile release notes
Writing release notes is a good way to keep yourself busy while the builds are running.
For prior art, see existing releases on [the releases page].
Tips:
- Each listed item should reference a PR on electron/electron, not an issue, nor a PR from another repo like libcc.
- No need to use link markup when referencing PRs. Strings like `#123` will automatically be converted to links on github.com.
- To see the version of Chromium, V8, and Node in every version of Electron, visit [atom.io/download/electron/index.json ](https://atom.io/download/electron/index.json ).
### Patch releases
For a `patch` release, use the following format:
```
## Bug Fixes
* Fixed a cross-platform thing. #123
### Linux
* Fixed a Linux thing. #123
### macOS
* Fixed a macOS thing. #123
### Windows
* Fixed a Windows thing. #1234
2017-10-06 15:48:09 +00:00
```
### Minor releases
For a `minor` release, e.g. `1.8.0` , use this format:
```
## Upgrades
- Upgraded from Node `oldVersion` to `newVersion` . #123
2017-08-03 19:55:33 +00:00
## API Changes
* Changed a thing. #123
### Linux
* Changed a Linux thing. #123
### macOS
* Changed a macOS thing. #123
### Windows
* Changed a Windows thing. #123
```
2017-10-06 15:48:09 +00:00
### Major releases
```
## Upgrades
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
- Upgraded from Chromium `oldVersion` to `newVersion` . #123
- Upgraded from Node `oldVersion` to `newVersion` . #123
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
## Breaking API changes
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
* Changed a thing. #123
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
### Linux
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
* Changed a Linux thing. #123
2017-08-03 19:55:33 +00:00
2017-10-06 15:48:09 +00:00
### macOS
* Changed a macOS thing. #123
### Windows
* Changed a Windows thing. #123
2017-08-03 19:55:33 +00:00
## Other Changes
- Some other change. #123
```
2017-10-06 15:48:09 +00:00
### Beta releases
Use the same formats as the ones suggested above, but add the following note at the beginning of the changelog:
```
**Note:** This is a beta release and most likely will have have some instability and/or regressions.
Please file new issues for any bugs you find in it.
This release is published to [npm ](https://www.npmjs.com/package/electron ) under the `beta` tag and can be installed via `npm install electron@beta` .
```
2016-10-18 04:41:57 +00:00
## Edit the release draft
1. Visit [the releases page] and you'll see a new draft release with placeholder release notes.
1. Edit the release and add release notes.
2017-10-06 15:48:09 +00:00
1. Uncheck the `prerelease` checkbox if you're publishing a stable release; leave it checked for beta releases.
2016-10-18 04:41:57 +00:00
1. Click 'Save draft'. **Do not click 'Publish release'!**
2017-09-26 01:18:38 +00:00
1. Wait for all builds to pass before proceeding.
2016-10-18 04:41:57 +00:00
## Merge temporary branch
2017-08-10 16:26:22 +00:00
Merge the temporary branch back into master, without creating a merge commit:
2016-10-18 04:41:57 +00:00
```sh
2017-08-10 16:26:22 +00:00
git checkout master
git merge release --no-commit
2016-10-20 02:19:18 +00:00
git push origin master
2016-10-18 04:41:57 +00:00
```
2016-10-18 05:04:52 +00:00
If this fails, rebase with master and rebuild:
```sh
git pull
git checkout release
git rebase master
git push origin HEAD
```
2016-10-18 04:41:57 +00:00
## Run local debug build
Run local debug build to verify that you are actually building the version you want. Sometimes you thought you were doing a release for a new version, but you're actually not.
```sh
npm run build
npm start
```
Verify the window is displaying the current updated version.
2016-10-20 02:22:32 +00:00
## Set environment variables
2016-10-20 02:19:18 +00:00
2016-10-20 02:22:32 +00:00
You'll need to set the following environment variables to publish a release. Ask another team member for these credentials.
2016-10-20 02:30:36 +00:00
- `ELECTRON_S3_BUCKET`
- `ELECTRON_S3_ACCESS_KEY`
- `ELECTRON_S3_SECRET_KEY`
- `ELECTRON_GITHUB_TOKEN` - A personal access token with "repo" scope.
2016-10-20 02:19:18 +00:00
You will only need to do this once.
2016-10-18 04:41:57 +00:00
## Publish the release
This script will download the binaries and generate the node headers and the .lib linker used on Windows by node-gyp to build native modules.
```sh
npm run release
```
2016-10-20 02:29:02 +00:00
Note: Many distributions of Python still ship with old HTTPS certificates. You may see a `InsecureRequestWarning` , but it can be disregarded.
2016-10-18 05:04:52 +00:00
## Delete the temporary branch
```sh
git checkout master
git branch -D release # delete local branch
git push origin :release # delete remote branch
```
2016-10-18 04:41:57 +00:00
[the releases page]: https://github.com/electron/electron/releases
[this bump commit]: https://github.com/electron/electron/commit/78ec1b8f89b3886b856377a1756a51617bc33f5a
[electron-versioning]: /docs/tutorial/electron-versioning.md
2017-08-03 20:24:18 +00:00
2017-09-26 01:30:42 +00:00
## Fix missing binaries of a release manually
In the case of a corrupted release with broken CI machines, we might have to
2017-09-26 18:10:29 +00:00
re-upload the binaries for an already published release.
2017-09-26 01:30:42 +00:00
2017-09-29 20:11:42 +00:00
The first step is to go to the
[Releases ](https://github.com/electron/electron/releases ) page and delete the
2017-09-26 18:10:29 +00:00
corrupted binaries with the `SHASUMS256.txt` checksum file.
2017-09-26 01:30:42 +00:00
Then manually create distributions for each platform and upload them:
```sh
# Checkout the version to re-upload.
git checkout vTHE.RELEASE.VERSION
2017-09-27 04:55:56 +00:00
# Do release build, specifying one target architecture.
2017-09-26 01:30:42 +00:00
./script/bootstrap.py --target_arch [arm|x64|ia32]
./script/build.py -c R
./script/create-dist.py
# Explicitly allow overwritting a published release.
./script/upload.py --overwrite
```
2017-09-26 18:10:29 +00:00
After re-uploading all distributions, publish again to upload the checksum
2017-09-26 01:30:42 +00:00
file:
```sh
npm run release
2017-09-29 20:11:42 +00:00
```