Skip to content

Commit 8864fb4

Browse files
bz2steren
authored andcommitted
Simplify new version release steps (#61)
* Simplify new version release steps Suggest use of npm version command to bump version and create new new git tag and commit. Use version script to update CDN url referenced in README.md file. Add more pre-step scripts for basic workflows. * Add clean script and use before publication Also limit packaged files to the common ones and newly generated files under dist/ folder.
1 parent db5fec3 commit 8864fb4

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ the one above, the [Software Grant and Corporate Contributor License Agreement].
4848

4949
## Creating a new release
5050

51-
* find and replace the version number package.json and commit
52-
* create a new git tag: `git tag v0.0.x`
53-
* push tag `git push --tags`
54-
* Create a [GitHub Release]
55-
* update on npm: `npm publish`
56-
* update the README to use this new published version in setup instructions and commit
51+
From master branch with all required changes landed and pulled:
52+
53+
* Run `npm version minor -m 'Release %s'` with semver component as needed.
54+
* Push commit and new tag with `git push --tags`.
55+
* Create a [GitHub Release].
56+
* Publish new package to npm registry with `npm publish`.
5757

5858

5959
[npm]: https://www.npmjs.com/

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
"description": "Experimental client-side JavaScript library to report errors to Stackdriver Error Reporting",
55
"main": "stackdriver-errors.js",
66
"scripts": {
7+
"clean": "rimraf dist/",
78
"dist": "gulp dist",
89
"lint": "eslint --ignore-path .gitignore .",
10+
"prebuild": "npm run test",
911
"prepare": "npm run dist",
12+
"prepublish": "npm run clean",
13+
"pretest": "npm run lint",
1014
"start": "gulp demo && http-server ./dist -o",
11-
"test": "npm run lint && mocha -r test/setup.js test/test.js"
15+
"test": "mocha -r test/setup.js test/test.js",
16+
"version": "sed -i s/@[0-9.]\\\\{5,\\\\}/@${npm_package_version}/g README.md && git add README.md"
1217
},
1318
"repository": {
1419
"type": "git",
1520
"url": "https://github.com/GoogleCloudPlatform/stackdriver-errors-js"
1621
},
22+
"files": [
23+
"dist/"
24+
],
1725
"keywords": [
1826
"stackdriver",
1927
"error",
@@ -37,6 +45,7 @@
3745
"gulp-uglify": "^3.0.1",
3846
"http-server": "^0.11.1",
3947
"mocha": "^5.2.0",
48+
"rimraf": "^2.6.2",
4049
"sinon": "^7.1.1"
4150
},
4251
"dependencies": {

0 commit comments

Comments
 (0)