Skip to content

Commit 3bcbe5a

Browse files
authored
chore(release): add standard version & documentation (#360)
* chore(release): add standard version & documentation * docs(release): update headings per review
1 parent 69dfd40 commit 3bcbe5a

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

RELEASE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Webpack merge, tag and release process
2+
3+
Webpack standard Automatic versioning and CHANGELOG management, using GitHub's new squash button and
4+
the [recommended workflow](https://github.com/conventional-changelog/conventional-changelog-cli#recommended-workflow) for `conventional-changelog`.
5+
6+
## Pull requests into `master`
7+
8+
1. When you land commits on your `master` branch, select the _Squash and Merge_ option.
9+
2. Add a title and body that follows the [conventional-changelog-standard conventions](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md).
10+
3. Land It!
11+
12+
## Cut a standard release
13+
14+
```sh
15+
# npm run script
16+
npm run release
17+
# or global bin
18+
standard-version
19+
```
20+
21+
_This will increment the package version based on commit history from the last tag, update the changelog accordingly, commits the changes & cuts a **local tag**_
22+
23+
### When satisfied with the local tag, push it up to master.
24+
25+
```sh
26+
# commandline
27+
git push --follow-tags origin master
28+
```
29+
30+
## Cut a pre-release
31+
32+
Use the flag `--prerelease` to generate pre-releases:
33+
34+
_Example: Given the last version of the package is `1.0.0`, and your code to be committed has `semver: patch` level changes..._
35+
36+
```bash
37+
# npm run script ( name === alpha, beta, rc )
38+
npm run release -- --prerelease <name>
39+
```
40+
41+
_this will tag the version `1.0.1-alpha.0`_
42+
43+
## Cut a target release version imperatively like `npm version`
44+
45+
To forgo the automated version bump use `--release-as` with the argument `major`, `minor` or `patch`:
46+
47+
Suppose the last version of your code is `1.0.0`, you've only landed `fix:` commits, but
48+
you would like your next release to be a `minor`. Simply do:
49+
50+
```bash
51+
# npm run script
52+
npm run release -- --release-as minor
53+
```
54+
55+
_you will get version `1.1.0` rather than the auto generated version `1.0.1`._
56+
57+
> **NOTE:** you can combine `--release-as` and `--prerelease` to generate a release. This is useful when publishing experimental feature(s).
58+
59+
## Signing commits and tags
60+
61+
If you have your GPG key set up, add the `--sign` or `-s` flag to your `standard-version` command.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"mocha-lcov-reporter": "1.2.0",
2323
"raw-loader": "^0.5.1",
2424
"should": "^11.1.2",
25+
"standard-version": "^4.0.0",
2526
"style-loader": "^0.13.0",
2627
"webpack": "^2.2.0"
2728
},
@@ -35,6 +36,6 @@
3536
"test": "mocha",
3637
"travis": "npm run cover -- --report lcovonly",
3738
"cover": "istanbul cover _mocha",
38-
"publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish"
39+
"release": "standard-version"
3940
}
4041
}

0 commit comments

Comments
 (0)