Skip to content

Commit eb2bb1a

Browse files
committed
Add release-it setup
1 parent 03820e0 commit eb2bb1a

4 files changed

Lines changed: 1980 additions & 1 deletion

File tree

.release-it.js

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

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+
pnpm install
43+
```
44+
45+
* And last (but not least 😁) do your release:
46+
47+
```
48+
pnpm 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
@@ -20,6 +20,7 @@
2020
"lint:hbs:fix": "ember-template-lint . --fix",
2121
"lint:js": "eslint . --cache",
2222
"lint:js:fix": "eslint . --fix",
23+
"release": "release-it",
2324
"start": "ember serve",
2425
"test": "ember test"
2526
},
@@ -33,6 +34,7 @@
3334
"@embroider/test-setup": "1.8.3",
3435
"@glimmer/component": "1.1.2",
3536
"@glimmer/tracking": "1.1.2",
37+
"@release-it-plugins/lerna-changelog": "5.0.0",
3638
"babel-eslint": "10.1.0",
3739
"broccoli-asset-rev": "3.0.0",
3840
"ember-auto-import": "2.4.3",
@@ -63,6 +65,7 @@
6365
"prettier": "2.7.1",
6466
"qunit": "2.19.3",
6567
"qunit-dom": "2.0.0",
68+
"release-it": "15.5.0",
6669
"webpack": "5.74.0"
6770
},
6871
"engines": {

0 commit comments

Comments
 (0)