@@ -80,28 +80,53 @@ yarn webdriver-sauce-test
80
80
Releasing
81
81
---------
82
82
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 .
84
84
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
86
89
87
90
```
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
90
97
```
91
98
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.
93
102
94
103
```
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"
97
105
```
98
106
99
- - deploy to npm
107
+ If everything looks good commit the changes and push them to your origin to create a PR.
100
108
101
- To make a ` dry-run ` , run the following commands.
102
109
```
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}"
105
114
```
106
115
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
+ ```
0 commit comments