Skip to content

Commit 3688116

Browse files
author
Robert Jackson
committed
Add automated release setup.
* Automatically publishes all packages in `packages/*` * Updates the version and dependency versions of all packages in `test-packages/*` * Adds `RELEASE.md` to document release process
1 parent b723a43 commit 3688116

File tree

6 files changed

+806
-91
lines changed

6 files changed

+806
-91
lines changed

RELEASE.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Releases are mostly automated using
44
[release-it](https://github.com/release-it/release-it/) and
5-
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
5+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
66

77

88
## Preparation
@@ -14,7 +14,7 @@ have been merged since the last release have been labeled with the appropriate
1414
represent something that would make sense to our users. Some great information
1515
on why this is important can be found at
1616
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
17-
guiding principles here is that changelogs are for humans, not machines.
17+
guiding principle here is that changelogs are for humans, not machines.
1818

1919
When reviewing merged PR's the labels to be used are:
2020

@@ -30,12 +30,33 @@ When reviewing merged PR's the labels to be used are:
3030

3131
Once the prep work is completed, the actual release is straight forward:
3232

33+
* First, ensure that you have installed your projects dependencies:
34+
3335
```
3436
yarn install
35-
yarn release
3637
```
3738

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.
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: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,50 @@
1-
21
{
32
"private": true,
3+
"repository": {
4+
"type": "git",
5+
"url": "git@github.com:ember-fastboot/ember-cli-fastboot.git"
6+
},
47
"workspaces": [
5-
"packages/ember-cli-fastboot",
6-
"test-packages/basic-app",
8+
"packages/*",
79
"test-packages/*"
8-
]
10+
],
11+
"devDependencies": {
12+
"release-it": "^13.6.5",
13+
"release-it-lerna-changelog": "^2.3.0",
14+
"release-it-yarn-workspaces": "^1.4.0"
15+
},
16+
"publishConfig": {
17+
"registry": "https://registry.npmjs.org"
18+
},
19+
"release-it": {
20+
"plugins": {
21+
"release-it-lerna-changelog": {
22+
"infile": "CHANGELOG.md",
23+
"launchEditor": true
24+
},
25+
"release-it-yarn-workspaces": {
26+
"workspaces": [
27+
"packages/*"
28+
],
29+
"additionalManifests": {
30+
"versionUpdates": [
31+
"package.json",
32+
"test-packages/*/package.json"
33+
],
34+
"dependencyUpdates": [
35+
"package.json",
36+
"test-packages/*/package.json"
37+
]
38+
}
39+
}
40+
},
41+
"git": {
42+
"tagName": "v${version}"
43+
},
44+
"github": {
45+
"release": true,
46+
"tokenRef": "GITHUB_AUTH"
47+
},
48+
"npm": false
49+
}
950
}

packages/ember-cli-fastboot/package.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,6 @@
9191
"broccoli-serve-files"
9292
]
9393
},
94-
"release-it": {
95-
"plugins": {
96-
"release-it-lerna-changelog": {
97-
"infile": "CHANGELOG.md"
98-
}
99-
},
100-
"git": {
101-
"tagName": "v${version}"
102-
},
103-
"github": {
104-
"release": true
105-
}
106-
},
10794
"volta": {
10895
"node": "12.18.2",
10996
"yarn": "1.17.3"

test-packages/fake-addon-2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"private": true,
23
"name": "fake-addon-2",
34
"version": "0.1.0",
45
"ember-addon": {

test-packages/fake-addon/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"private": true,
23
"name": "fake-addon",
34
"version": "0.1.0",
45
"ember-addon": {

0 commit comments

Comments
 (0)