Skip to content

Commit 466f5c6

Browse files
mheverykara
authored andcommitted
docs(zone.js): update release docs instructions (angular#32128)
PR Close angular#32128
1 parent b9dfe66 commit 466f5c6

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed

packages/zone.js/DEVELOPER.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,53 @@ yarn webdriver-sauce-test
8080
Releasing
8181
---------
8282

83-
For example, the current version is `0.9.1`, and we want to release a new version `0.10.0`.
83+
Releasing `zone.js` is a two step process.
8484

85-
- 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`.
85+
1. Create a PR which updates the changelog, and get it merged using normal merge process.
86+
2. Once the PR is merged check out the merge SHA of the PR and release `zone.js` from that SHA and tag it.
87+
88+
#### 1. Creating a PR for release
8689

8790
```
88-
$ export TAG=zone.js-0.10.0
89-
$ git tag $TAG
91+
export PREVIOUS_ZONE_TAG=`git tag -l 'zone.js-*' | tail -n1`
92+
export VERSION=`(cd packages/zone.js; npm version patch --no-git-tag-version)`
93+
export VERSION=${VERSION#v}
94+
export TAG="zone.js-${VERSION}"
95+
echo "Releasing zone.js version ${TAG}. Last release was ${PREVIOUS_ZONE_TAG}."
96+
yarn gulp changelog:zonejs
9097
```
9198

92-
- Create PR to update `changelog` of zone.js, we need to define the previous tag which will be the current version.
99+
Inspect the `packages/zone.js/CHANGELOG.md` for any issues and than commit it with this command.
100+
101+
Create a dry run build to make sure everything is ready.
93102

94103
```
95-
$ export PREVIOUS_ZONE_TAG=zone.js-0.9.1
96-
$ yarn gulp changelog:zonejs
104+
yarn bazel --output_base=$(mktemp -d) run //packages/zone.js:npm_package.pack --workspace_status_command="echo BUILD_SCM_VERSION $VERSION"
97105
```
98106

99-
- deploy to npm
107+
If everything looks good commit the changes and push them to your origin to create a PR.
100108

101-
To make a `dry-run`, run the following commands.
102109
```
103-
$ VERSION=<version>
104-
$ yarn bazel --output_base=$(mktemp -d) run //packages/zone.js:npm_package.pack --workspace_status_command="echo BUILD_SCM_VERSION $VERSION"
110+
git co -b "release_${TAG}"
111+
git add packages/zone.js/CHANGELOG.md packages/zone.js/package.json
112+
git ci -m "release: cut the ${TAG} release"
113+
git push origin "release_${TAG}"
105114
```
106115

107-
If everything looks fine, replace `.pack` with `.publish` to push to the npm registry.
116+
117+
#### 2. Cutting a release
118+
119+
Check out the SHA on master which has the changelog commit of the zone.js
120+
121+
```
122+
git fetch upstream
123+
export VERSION=`(node -e "console.log(require('./packages/zone.js/package.json').version)")`
124+
export TAG="zone.js-${VERSION}"
125+
export SHA=`git log upstream/master --oneline -n 1000 | grep "release: cut the ${TAG} release" | cut -f 1 -d " "`
126+
git co ${SHA}
127+
yarn bazel \
128+
--output_base=$(mktemp -d) run //packages/zone.js:npm_package.publish \
129+
--workspace_status_command="echo BUILD_SCM_VERSION $VERSION"
130+
git tag ${TAG} ${SHA}
131+
git push upstream ${TAG}
132+
```

packages/zone.js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zone.js",
3-
"version": "0.0.0-PLACEHOLDER",
3+
"version": "0.10.1",
44
"description": "Zones for JavaScript",
55
"main": "dist/zone-node.js",
66
"browser": "dist/zone.js",
@@ -36,4 +36,4 @@
3636
"bugs": {
3737
"url": "https://github.com/angular/angular/issues"
3838
}
39-
}
39+
}

tools/gulp-tasks/changelog-zonejs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = (gulp) => () => {
2323
extendedRegexp: true,
2424
grep: '^[^(]+\\(zone\\.js\\)',
2525
from: ptag,
26-
to: tag,
26+
to: 'HEAD',
2727
}))
2828
.pipe(gulp.dest('./packages/zone.js/'));
2929
};

0 commit comments

Comments
 (0)