Browse Source

chore: Updates for release process (2-0-x)

* Fix Appveyor URL

* Update docs to reflect current process

Also added troubleshooting steps.

(cherry picked from commit 6b5ccec0c6e574b6f810dde1566c98e03daa2c46)
John Kleinschmidt 6 years ago
parent
commit
6030146b45
2 changed files with 96 additions and 18 deletions
  1. 95 17
      docs/development/releasing.md
  2. 1 1
      script/ci-release-build.js

+ 95 - 17
docs/development/releasing.md

@@ -2,11 +2,31 @@
 
 This document describes the process for releasing a new version of Electron.
 
+## Set your tokens and environment variables
+You'll need Electron S3 credentials in order to create and
+upload an Electron release. Contact a team member for more
+information.
+
+There are a handful of `*_TOKEN` environment variables needed by the release
+scripts. Once you've generated these per-user tokens, you may want to keep
+them in a local file that you can `source` when starting a release.
+* `ELECTRON_GITHUB_TOKEN`:
+Create as described at https://github.com/settings/tokens/new,
+giving the token repo access scope.
+* `APPVEYOR_TOKEN`:
+Create a token from https://windows-ci.electronjs.org/api-token
+If you don't have an account, ask a team member to add you.
+* `CIRCLE_TOKEN`:
+Create a token from "Personal API Tokens" at https://circleci.com/account/api
+* `VSTS_TOKEN`:
+Create a Personal Access Token at https://github.visualstudio.com/_usersSettings/tokens
+with the scope of `Build (read and execute)`.
+
 ## Determine which branch to release from
 
 - **If releasing beta,** run the scripts below from `master`.
-- **If releasing a stable version,** run the scripts below from `1-7-x` or
-`1-6-x`, depending on which version you are releasing for.
+- **If releasing a stable version,** run the scripts below from the branch
+  you're stabilizing.
 
 ## Find out what version change is needed
 Run `npm run prepare-release -- --notesOnly` to view auto generated release
@@ -14,6 +34,11 @@ notes. The notes generated should help you determine if this is a major, minor,
 patch, or beta version change. Read the
 [Version Change Rules](../tutorial/electron-versioning.md#semver) for more information.
 
+**NB:** If releasing from a branch, e.g. 1-8-x, check out the branch with
+`git checkout 1-8-x` rather than `git checkout -b remotes/origin/1-8-x`.
+The scripts need `git rev-parse --abbrev-ref HEAD` to return a short name,
+e.g. no `remotes/origin/`
+
 ## Run the prepare-release script
 The prepare release script will do the following:
 1. Check if a release is already in process and if so it will halt.
@@ -55,10 +80,11 @@ npm run prepare-release -- --stable
 The `prepare-release` script will trigger the builds via API calls.
 To monitor the build progress, see the following pages:
 
-- [mac-ci.electronjs.org/blue/organizations/jenkins/electron-mas-x64-release/activity](https://mac-ci.electronjs.org/blue/organizations/jenkins/electron-mas-x64-release/activity) for Mac App Store
-- [mac-ci.electronjs.org/blue/organizations/jenkins/electron-osx-x64-release/activity](https://mac-ci.electronjs.org/blue/organizations/jenkins/electron-osx-x64-release/activity) for OS X
-- [circleci.com/gh/electron/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
+- [electron-release-mas-x64](https://github.visualstudio.com/electron/_build/index?context=allDefinitions&path=%5C&definitionId=19&_a=completed) for MAS builds.
+- [electron-release-osx-x64](https://github.visualstudio.com/electron/_build/index?context=allDefinitions&path=%5C&definitionId=18&_a=completed) for OSX builds.
+- [circleci.com/gh/electron/electron](https://circleci.com/gh/electron) for Linux builds.
+- [windows-ci.electronjs.org/project/AppVeyor/electron-39ng6](https://windows-ci.electronjs.org/project/AppVeyor/electron-39ng6) for Windows 32-bit builds.
+- [windows-ci.electronjs.org/project/AppVeyor/electron](https://windows-ci.electronjs.org/project/AppVeyor/electron) for Windows 64-bit builds.
 
 ## Compile release notes
 
@@ -159,14 +185,15 @@ This release is published to [npm](https://www.npmjs.com/package/electron) under
 
 ## 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.
-1. Uncheck the `prerelease` checkbox if you're publishing a stable release; leave it checked for beta releases.
-1. Click 'Save draft'. **Do not click 'Publish release'!**
-1. Wait for all builds to pass before proceeding.
-1. You can run `npm run release -- --validateRelease` to verify that all of the
-required files have been created for the release.
-
+1. Visit [the releases page] and you'll see a new draft release with placeholder
+release notes.
+2. Edit the release and add release notes.
+3. Click 'Save draft'. **Do not click 'Publish release'!**
+4. Wait for all builds to pass before proceeding.
+5. In the branch, verify that the release's files have been created:
+```sh
+$ npm run release -- --validateRelease
+```
 
 ## Publish the release
 
@@ -181,17 +208,68 @@ on Windows by node-gyp to build native modules.
 5. Validate that all of the required files are present on GitHub and S3 and have
 the correct checksums as specified in the SHASUMS files.
 6. Publish the release on GitHub
-7. Delete the `release` branch.
 
 ## Publish to npm
 
-Once the publish is successful, run `npm run publish-to-npm` to publish to
-release to npm.
+Before publishing to npm, you'll need to log into npm as Electron. Optionally,
+you may find [npmrc](https://www.npmjs.com/package/npmrc) to be a useful way
+to keep Electron's profile side-by-side with your own:
+```sh
+$ sudo npm install -g npmrc
+$ npmrc -c electron
+Removing old .npmrc (default)
+Activating .npmrc "electron"
+```
+
+The Electron account's credentials are kept by GitHub.
+"Electron - NPM" for the URL "https://www.npmjs.com/login".
+```sh
+$ npm login
+Username: electron
+Password:
+Email: (this IS public) [email protected]
+```
+
+Publish the release to npm.
+```sh
+$ npm whoami
+electron
+$ npm run publish-to-npm
+```
 
 [the releases page]: https://github.com/electron/electron/releases
 [this bump commit]: https://github.com/electron/electron/commit/78ec1b8f89b3886b856377a1756a51617bc33f5a
 [versioning]: /docs/tutorial/electron-versioning.md
 
+# Troubleshooting
+
+## Rerun broken builds
+
+If a release build fails for some reason, you can use `script/ci-release-build.js` to rerun a release build:
+
+### Rerun all linux builds:
+```sh
+node script/ci-release-build.js --ci=CircleCI --ghRelease TARGET_BRANCH
+(TARGET_BRANCH) is the branch you are releasing from.
+```
+
+### Rerun all macOS builds:
+```sh
+node script/ci-release-build.js --ci=VSTS --ghRelease TARGET_BRANCH
+(TARGET_BRANCH) is the branch you are releasing from.
+```
+
+### Rerun all Windows builds:
+```sh
+node script/ci-release-build.js --ci=AppVeyor --ghRelease TARGET_BRANCH
+(TARGET_BRANCH) is the branch you are releasing from.
+```
+
+Additionally you can pass a job name to the script to run an individual job, eg:
+````sh
+node script/ci-release-build.js --ci=AppVeyor --ghRelease --job=electron-x64 TARGET_BRANCH
+```
+
 ## Fix missing binaries of a release manually
 
 In the case of a corrupted release with broken CI machines, we might have to

+ 1 - 1
script/ci-release-build.js

@@ -120,7 +120,7 @@ async function callAppVeyor (targetBranch, job, options) {
   let appVeyorResponse = await makeRequest(requestOpts, true).catch(err => {
     console.log('Error calling AppVeyor:', err)
   })
-  const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/electron/build/${appVeyorResponse.version}`
+  const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`
   console.log(`AppVeyor release build request for ${job} successful.  Check build status at ${buildUrl}`)
 }