Skip to content

Commit fa8bb71

Browse files
authored
Merge pull request #289 from pretenderjs/release
Add release-it
2 parents 4974f98 + 1066329 commit fa8bb71

File tree

5 files changed

+2007
-48
lines changed

5 files changed

+2007
-48
lines changed

.release-it.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"plugins": {
3+
"release-it-lerna-changelog": {
4+
"infile": "CHANGELOG.md"
5+
}
6+
},
7+
"git": {
8+
"tagName": "v${version}"
9+
},
10+
"npm": {
11+
"publish": true
12+
},
13+
"github": {
14+
"release": true
15+
}
16+
}

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Pretender Changelog
2-
31
## 3.2.0 (2019-12-22)
42

53
#### :rocket: Enhancement

RELEASE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Release
2+
3+
Releases are mostly automated using
4+
[release-it](https://github.com/release-it/release-it/) and
5+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
6+
7+
8+
## Preparation
9+
10+
Since the majority of the actual release process is automated, the primary
11+
remaining task prior to releasing is confirming that all pull requests that
12+
have been merged since the last release have been labeled with the appropriate
13+
`lerna-changelog` labels and the titles have been updated to ensure they
14+
represent something that would make sense to our users. Some great information
15+
on why this is important can be found at
16+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
17+
guiding principles here is that changelogs are for humans, not machines.
18+
19+
When reviewing merged PR's the labels to be used are:
20+
21+
* breaking - Used when the PR is considered a breaking change.
22+
* enhancement - Used when the PR adds a new feature or enhancement.
23+
* bug - Used when the PR fixes a bug included in a previous release.
24+
* documentation - Used when the PR adds or updates documentation.
25+
* internal - Used for internal changes that still require a mention in the
26+
changelog/release notes.
27+
28+
29+
## Release
30+
31+
Once the prep work is completed, the actual release is straight forward:
32+
33+
```
34+
yarn install
35+
yarn release
36+
```
37+
38+
The `release` script leverages
39+
[release-it](https://github.com/release-it/release-it/) to do the mechanical
40+
release process. It will prompt you through the process of choosing the version
41+
number, tagging, pushing the tag and commits, etc.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"description": "Pretender is a mock server library for XMLHttpRequest and Fetch, that comes with an express/sinatra style syntax for defining routes and their handlers.",
88
"license": "MIT",
99
"scripts": {
10+
"release": "release-it",
1011
"prepublishOnly": "npm run build && npm run tests-only",
1112
"pretest": "bower install",
1213
"build": "rollup --config",
@@ -22,6 +23,9 @@
2223
"type": "git",
2324
"url": "https://github.com/pretenderjs/pretender.git"
2425
},
26+
"publishConfig": {
27+
"registry": "https://registry.npmjs.org/"
28+
},
2529
"devDependencies": {
2630
"abortcontroller-polyfill": "^1.1.9",
2731
"bower": "^1.8.2",
@@ -37,6 +41,8 @@
3741
"karma-sinon": "^1.0.5",
3842
"phantomjs": "^2.1.7",
3943
"qunit": "^2.6.1",
44+
"release-it": "^12.4.3",
45+
"release-it-lerna-changelog": "^1.0.3",
4046
"rollup": "^1.1.2",
4147
"rollup-plugin-commonjs": "^9.2.0",
4248
"rollup-plugin-multi-entry": "^2.1.0",

0 commit comments

Comments
 (0)