From 466f5c67d62e7bee2c333f70d164cc43cc8cc78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=A1ko=20Hevery?= Date: Tue, 13 Aug 2019 16:15:55 -0700 Subject: [PATCH] docs(zone.js): update release docs instructions (#32128) PR Close #32128 --- packages/zone.js/DEVELOPER.md | 49 +++++++++++++++++++++------- packages/zone.js/package.json | 4 +-- tools/gulp-tasks/changelog-zonejs.js | 2 +- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/packages/zone.js/DEVELOPER.md b/packages/zone.js/DEVELOPER.md index b2f1f8b73b..5f544eaff0 100644 --- a/packages/zone.js/DEVELOPER.md +++ b/packages/zone.js/DEVELOPER.md @@ -80,28 +80,53 @@ yarn webdriver-sauce-test Releasing --------- -For example, the current version is `0.9.1`, and we want to release a new version `0.10.0`. +Releasing `zone.js` is a two step process. -- create a new tag in `angular` repo. The `tag` must be `zone.js-`, so in this example we need to create the tag `zone.js-0.10.0`. +1. Create a PR which updates the changelog, and get it merged using normal merge process. +2. Once the PR is merged check out the merge SHA of the PR and release `zone.js` from that SHA and tag it. + +#### 1. Creating a PR for release ``` -$ export TAG=zone.js-0.10.0 -$ git tag $TAG +export PREVIOUS_ZONE_TAG=`git tag -l 'zone.js-*' | tail -n1` +export VERSION=`(cd packages/zone.js; npm version patch --no-git-tag-version)` +export VERSION=${VERSION#v} +export TAG="zone.js-${VERSION}" +echo "Releasing zone.js version ${TAG}. Last release was ${PREVIOUS_ZONE_TAG}." +yarn gulp changelog:zonejs ``` -- Create PR to update `changelog` of zone.js, we need to define the previous tag which will be the current version. +Inspect the `packages/zone.js/CHANGELOG.md` for any issues and than commit it with this command. + +Create a dry run build to make sure everything is ready. ``` -$ export PREVIOUS_ZONE_TAG=zone.js-0.9.1 -$ yarn gulp changelog:zonejs +yarn bazel --output_base=$(mktemp -d) run //packages/zone.js:npm_package.pack --workspace_status_command="echo BUILD_SCM_VERSION $VERSION" ``` -- deploy to npm +If everything looks good commit the changes and push them to your origin to create a PR. -To make a `dry-run`, run the following commands. ``` -$ VERSION= -$ yarn bazel --output_base=$(mktemp -d) run //packages/zone.js:npm_package.pack --workspace_status_command="echo BUILD_SCM_VERSION $VERSION" +git co -b "release_${TAG}" +git add packages/zone.js/CHANGELOG.md packages/zone.js/package.json +git ci -m "release: cut the ${TAG} release" +git push origin "release_${TAG}" ``` -If everything looks fine, replace `.pack` with `.publish` to push to the npm registry. \ No newline at end of file + +#### 2. Cutting a release + +Check out the SHA on master which has the changelog commit of the zone.js + +``` +git fetch upstream +export VERSION=`(node -e "console.log(require('./packages/zone.js/package.json').version)")` +export TAG="zone.js-${VERSION}" +export SHA=`git log upstream/master --oneline -n 1000 | grep "release: cut the ${TAG} release" | cut -f 1 -d " "` +git co ${SHA} +yarn bazel \ + --output_base=$(mktemp -d) run //packages/zone.js:npm_package.publish \ + --workspace_status_command="echo BUILD_SCM_VERSION $VERSION" +git tag ${TAG} ${SHA} +git push upstream ${TAG} +``` \ No newline at end of file diff --git a/packages/zone.js/package.json b/packages/zone.js/package.json index bdcbf79ba8..05083131aa 100644 --- a/packages/zone.js/package.json +++ b/packages/zone.js/package.json @@ -1,6 +1,6 @@ { "name": "zone.js", - "version": "0.0.0-PLACEHOLDER", + "version": "0.10.1", "description": "Zones for JavaScript", "main": "dist/zone-node.js", "browser": "dist/zone.js", @@ -36,4 +36,4 @@ "bugs": { "url": "https://github.com/angular/angular/issues" } -} +} \ No newline at end of file diff --git a/tools/gulp-tasks/changelog-zonejs.js b/tools/gulp-tasks/changelog-zonejs.js index b653ab475d..9cfb642a69 100644 --- a/tools/gulp-tasks/changelog-zonejs.js +++ b/tools/gulp-tasks/changelog-zonejs.js @@ -23,7 +23,7 @@ module.exports = (gulp) => () => { extendedRegexp: true, grep: '^[^(]+\\(zone\\.js\\)', from: ptag, - to: tag, + to: 'HEAD', })) .pipe(gulp.dest('./packages/zone.js/')); };