Skip to content

Commit 284f7fe

Browse files
committed
Add release-it to simplify the release process
1 parent cecab85 commit 284f7fe

File tree

4 files changed

+2167
-55
lines changed

4 files changed

+2167
-55
lines changed

.release-it.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
plugins: {
3+
'release-it-lerna-changelog': {
4+
infile: 'CHANGELOG.md',
5+
},
6+
},
7+
git: {
8+
commitMessage: 'v${version}',
9+
tagAnnotation: 'v${version}',
10+
},
11+
github: {
12+
release: true,
13+
releaseName: 'v${version}',
14+
tokenRef: 'GITHUB_AUTH',
15+
},
16+
npm: {
17+
publish: false,
18+
},
19+
};

RELEASE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 principle 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+
* First, ensure that you have an environment variable with your GitHub token
34+
setup as `GITHUB_AUTH`. This token will be used for generating your changelog
35+
(unauthenticated requests to the GitHub API are heavily throttled) and for
36+
creating the GitHub release. Only "repo" access is needed; no "admin"
37+
or other scopes are required.
38+
39+
* Next, ensure that you have installed your projects dependencies:
40+
41+
```
42+
yarn install
43+
```
44+
45+
* And last (but not least 😁) do your release:
46+
47+
```
48+
yarn release
49+
```
50+
51+
[release-it](https://github.com/release-it/release-it/) manages the actual
52+
release process. It will prompt you to choose the version number after which
53+
you will have the chance to hand tweak the changelog to be used (for the
54+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
55+
pushing the tag and commits, etc. Finally, GitHub Actions will build the commit
56+
and push the release to npm.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"build": "tsc",
1717
"prepublish": "tsc",
1818
"lint": "tslint --project . --format stylish",
19+
"release": "release-it",
1920
"test": "jest",
2021
"test:watch": "jest --watchAll --notify"
2122
},
@@ -27,6 +28,8 @@
2728
"@types/node": "6.14.13",
2829
"igc-filename-parser": "0.1.1",
2930
"jest": "26.6.3",
31+
"release-it": "14.4.1",
32+
"release-it-lerna-changelog": "3.1.0",
3033
"ts-jest": "26.5.2",
3134
"tslint": "5.20.1",
3235
"typescript": "4.2.2"

0 commit comments

Comments
 (0)