docs(zone.js): update release docs instructions (#32128)

PR Close #32128
This commit is contained in:
Miško Hevery 2019-08-13 16:15:55 -07:00 committed by Kara Erickson
parent b9dfe66028
commit 466f5c67d6
3 changed files with 40 additions and 15 deletions

View File

@ -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-<version>`, 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=<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.
#### 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}
```

View File

@ -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"
}
}
}

View File

@ -23,7 +23,7 @@ module.exports = (gulp) => () => {
extendedRegexp: true,
grep: '^[^(]+\\(zone\\.js\\)',
from: ptag,
to: tag,
to: 'HEAD',
}))
.pipe(gulp.dest('./packages/zone.js/'));
};