Skip to content

Commit 76f3f65

Browse files
author
Robert Jackson
authored
Merge pull request #91 from tildeio/add-release-automation
2 parents c0be86f + b4cd875 commit 76f3f65

4 files changed

Lines changed: 2219 additions & 33 deletions

File tree

CHANGELOG.md

Whitespace-only changes.

RELEASE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Release Process
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+
## Preparation
8+
9+
Since the majority of the actual release process is automated, the primary
10+
remaining task prior to releasing is confirming that all pull requests that
11+
have been merged since the last release have been labeled with the appropriate
12+
`lerna-changelog` labels and the titles have been updated to ensure they
13+
represent something that would make sense to our users. Some great information
14+
on why this is important can be found at
15+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16+
guiding principle here is that changelogs are for humans, not machines.
17+
18+
When reviewing merged PR's the labels to be used are:
19+
20+
* breaking - Used when the PR is considered a breaking change.
21+
* enhancement - Used when the PR adds a new feature or enhancement.
22+
* bug - Used when the PR fixes a bug included in a previous release.
23+
* documentation - Used when the PR adds or updates documentation.
24+
* internal - Used for internal changes that still require a mention in the
25+
changelog/release notes.
26+
27+
## Release
28+
29+
Once the prep work is completed, the actual release is straight forward:
30+
31+
* First, ensure that you have installed your projects dependencies:
32+
33+
```sh
34+
yarn install
35+
```
36+
37+
* Second, ensure that you have obtained a
38+
[GitHub personal access token][generate-token] with the `repo` scope (no
39+
other permissions are needed). Make sure the token is available as the
40+
`GITHUB_AUTH` environment variable.
41+
42+
For instance:
43+
44+
```bash
45+
export GITHUB_AUTH=abc123def456
46+
```
47+
48+
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49+
50+
* And last (but not least 😁) do your release.
51+
52+
```sh
53+
npx release-it
54+
```
55+
56+
[release-it](https://github.com/release-it/release-it/) manages the actual
57+
release process. It will prompt you to to choose the version number after which
58+
you will have the chance to hand tweak the changelog to be used (for the
59+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60+
pushing the tag and commits, etc.

package.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "simple-html-tokenizer",
33
"version": "0.5.9",
4-
"license": "MIT",
54
"description": "Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates.",
65
"keywords": [
76
"html",
@@ -11,6 +10,7 @@
1110
"type": "git",
1211
"url": "https://github.com/tildeio/simple-html-tokenizer.git"
1312
},
13+
"license": "MIT",
1414
"main": "dist/simple-html-tokenizer.js",
1515
"module": "dist/es6/index.js",
1616
"types": "dist/types/index.d.ts",
@@ -20,10 +20,10 @@
2020
],
2121
"scripts": {
2222
"build": "ember build",
23-
"prepublish": "rm -rf node_modules/in-repo-commands && ln -s ../commands node_modules/in-repo-commands && rm -rf node_modules/symlink-self && ln -s ../lib/symlink-self node_modules/symlink-self",
23+
"lint": "tslint -p tsconfig.json",
2424
"prepare": "ember build",
25-
"test": "ember test && nyc qunit dist/tests/tests.js",
26-
"lint": "tslint -p tsconfig.json"
25+
"prepublish": "rm -rf node_modules/in-repo-commands && ln -s ../commands node_modules/in-repo-commands && rm -rf node_modules/symlink-self && ln -s ../lib/symlink-self node_modules/symlink-self",
26+
"test": "ember test && nyc qunit dist/tests/tests.js"
2727
},
2828
"devDependencies": {
2929
"@types/qunit": "^2.5.0",
@@ -38,9 +38,29 @@
3838
"in-repo-commands": "file:./commands",
3939
"nyc": "^11.4.1",
4040
"qunit": "^2.5.1",
41+
"release-it": "^14.0.2",
42+
"release-it-lerna-changelog": "^2.4.0",
4143
"rollup-plugin-sourcemaps": "^0.4.2",
4244
"symlink-self": "file:./lib/symlink-self",
4345
"tslint": "^5.9.1",
4446
"typescript": "^2.7.2"
47+
},
48+
"publishConfig": {
49+
"registry": "https://registry.npmjs.org"
50+
},
51+
"release-it": {
52+
"plugins": {
53+
"release-it-lerna-changelog": {
54+
"infile": "CHANGELOG.md",
55+
"launchEditor": true
56+
}
57+
},
58+
"git": {
59+
"tagName": "v${version}"
60+
},
61+
"github": {
62+
"release": true,
63+
"tokenRef": "GITHUB_AUTH"
64+
}
4565
}
4666
}

0 commit comments

Comments
 (0)