Skip to content

Commit fb40c8d

Browse files
author
Robert Jackson
authored
Merge pull request #301 from tildeio/automated-release-setup
Add automated release setup.
2 parents 49cc073 + ac417d2 commit fb40c8d

File tree

4 files changed

+1724
-89
lines changed

4 files changed

+1724
-89
lines changed

CHANGELOG.md

Whitespace-only changes.

RELEASE.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 installed your projects dependencies:
34+
35+
```
36+
yarn install
37+
```
38+
39+
* Second, ensure that you have obtained a
40+
[GitHub personal access token][generate-token] with the `repo` scope (no
41+
other permissions are needed). Make sure the token is available as the
42+
`GITHUB_AUTH` environment variable.
43+
44+
For instance:
45+
46+
```bash
47+
export GITHUB_AUTH=abc123def456
48+
```
49+
50+
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
51+
52+
* And last (but not least 😁) do your release.
53+
54+
```
55+
npx release-it
56+
```
57+
58+
[release-it](https://github.com/release-it/release-it/) manages the actual
59+
release process. It will prompt you to to choose the version number after which
60+
you will have the chance to hand tweak the changelog to be used (for the
61+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
62+
pushing the tag and commits, etc.

package.json

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
"bugs": {
1111
"url": "https://github.com/tildeio/router.js/issues"
1212
},
13-
"license": "MIT",
14-
"author": "Tilde, Inc.",
15-
"main": "dist/cjs/index.js",
16-
"module": "dist/modules/index.js",
1713
"repository": {
1814
"type": "git",
1915
"url": "https://github.com/tildeio/router.js.git"
2016
},
17+
"license": "MIT",
18+
"author": "Tilde, Inc.",
19+
"main": "dist/cjs/index.js",
20+
"module": "dist/modules/index.js",
21+
"files": [
22+
"dist/cjs",
23+
"dist/modules"
24+
],
2125
"scripts": {
2226
"lint": "npm-run-all lint:*",
2327
"lint:ts": "eslint --cache .",
2428
"lint:types": "tsc -p tsconfig.json --noEmit",
25-
"prepublish": "ember build",
29+
"prepare": "ember build",
2630
"problems": "tsc -p tsconfig.json --noEmit",
2731
"start": "ember server",
2832
"test": "ember test"
2933
},
30-
"files": [
31-
"dist/cjs",
32-
"dist/modules"
33-
],
3434
"dependencies": {},
3535
"devDependencies": {
3636
"@babel/plugin-transform-modules-amd": "^7.10.5",
@@ -54,6 +54,8 @@
5454
"npm-run-all": "^4.1.5",
5555
"prettier": "2.0.5",
5656
"qunit": "^2.10.1",
57+
"release-it": "^13.6.5",
58+
"release-it-lerna-changelog": "^2.3.0",
5759
"route-recognizer": "^0.3.4",
5860
"rsvp": "^4.8.5"
5961
},
@@ -64,5 +66,23 @@
6466
"engines": {
6567
"node": ">= 10"
6668
},
67-
"namespace": "Router"
69+
"publishConfig": {
70+
"registry": "https://registry.npmjs.org"
71+
},
72+
"namespace": "Router",
73+
"release-it": {
74+
"plugins": {
75+
"release-it-lerna-changelog": {
76+
"infile": "CHANGELOG.md",
77+
"launchEditor": true
78+
}
79+
},
80+
"git": {
81+
"tagName": "v${version}"
82+
},
83+
"github": {
84+
"release": true,
85+
"tokenRef": "GITHUB_AUTH"
86+
}
87+
}
6888
}

0 commit comments

Comments
 (0)