Merge pull request #10614 from electron/upload-overwrite

Document how to fix a published release
This commit is contained in:
Zeke Sikelianos 2017-09-26 21:56:37 -07:00 committed by GitHub
commit 494000114c
2 changed files with 50 additions and 11 deletions

View file

@ -4,8 +4,8 @@ This document describes the process for releasing a new version of Electron.
## Create a backport branch
If you're about release a new major or minor version of Electron like `1.8.0`,
`1.9.0`, or `2.0.0`, first create a branch from the most recent minor release
If you're about release a new major or minor version of Electron like `1.8.0`,
`1.9.0`, or `2.0.0`, first create a branch from the most recent minor release
for later backports:
Assuming you're about to publish `1.8.0`, and the highest `1.7` release was
@ -136,7 +136,7 @@ This release is published to [npm](https://www.npmjs.com/package/electron) under
1. Edit the release and add release notes.
1. Ensure the `prerelease` checkbox is checked. This should happen automatically for Electron versions >=1.7
1. Click 'Save draft'. **Do not click 'Publish release'!**
1. Wait for all builds to pass before proceeding.
1. Wait for all builds to pass before proceeding.
## Merge temporary branch
@ -201,9 +201,9 @@ git push origin :release # delete remote branch
[this bump commit]: https://github.com/electron/electron/commit/78ec1b8f89b3886b856377a1756a51617bc33f5a
[electron-versioning]: /docs/tutorial/electron-versioning.md
## Promoting a release on npm
## Promote a release on npm
New releases are published to npm with the `beta` tag. Every release should
New releases are published to npm with the `beta` tag. Every release should
eventually get promoted to stable unless there's a good reason not to.
Releases are normally given around two weeks in the wild before being promoted.
@ -215,7 +215,7 @@ It's also good to ask users in Slack if they're using the beta versions successf
To see what's beta and stable at any given time:
```
$ npm dist-tag ls electron
$ npm dist-tag ls electron
beta: 1.7.5
latest: 1.6.11
```
@ -230,4 +230,35 @@ Then edit the release on GitGub:
1. Remove `beta` from the release name: electron v1.7.5 ~~beta~~
1. Uncheck the `prerelease` checkbox.
1. Click "Update release"
1. Click "Update release"
## Fix missing binaries of a release manually
In the case of a corrupted release with broken CI machines, we might have to
re-upload the binaries for an already published release.
The first step is to go to the
[Releases](https://github.com/electron/electron/releases) page and delete the
corrupted binaries with the `SHASUMS256.txt` checksum file.
Then manually create distributions for each platform and upload them:
```sh
# Checkout the version to re-upload.
git checkout vTHE.RELEASE.VERSION
# Do release build, specifying one target architecture.
./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
```
After re-uploading all distributions, publish again to upload the checksum
file:
```sh
npm run release
```

View file

@ -51,13 +51,18 @@ def main():
github = GitHub(auth_token())
releases = github.repos(ELECTRON_REPO).releases.get()
tag_exists = False
for release in releases:
if not release['draft'] and release['tag_name'] == args.version:
for r in releases:
if not r['draft'] and r['tag_name'] == args.version:
release = r
tag_exists = True
break
release = create_or_get_release_draft(github, releases, args.version,
tag_exists)
assert tag_exists == args.overwrite, \
'You have to pass --overwrite to overwrite a published release'
if not args.overwrite:
release = create_or_get_release_draft(github, releases, args.version,
tag_exists)
if args.publish_release:
# Upload the Node SHASUMS*.txt.
@ -112,6 +117,9 @@ def parse_args():
parser = argparse.ArgumentParser(description='upload distribution file')
parser.add_argument('-v', '--version', help='Specify the version',
default=ELECTRON_VERSION)
parser.add_argument('-o', '--overwrite',
help='Overwrite a published release',
action='store_true')
parser.add_argument('-p', '--publish-release',
help='Publish the release',
action='store_true')