Skip to content

Commit d079854

Browse files
authored
Merge pull request #179 from ember-template-lint/release-it
Setup release-it with `yarn create rwjblue-release-it-setup`
2 parents ed5b6d3 + a720652 commit d079854

3 files changed

Lines changed: 1766 additions & 54 deletions

File tree

RELEASE.md

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,60 @@
1-
# RELEASE
2-
3-
Here are the steps:
4-
1. run these commands
5-
```bash
6-
- yarn version
7-
- git push origin master the-new-tag
8-
- yarn changelog --from=previous-tag >> CHANGELOG.md (manual cleanup)
9-
- npm publish
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
1035
```
11-
2. Draft a release: https://github.com/dcyriller/ember-template-lint-plugin-prettier/releases/new
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: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "ember-template-lint-plugin-prettier",
33
"version": "3.0.0",
4+
"private": false,
45
"description": "A prettier plugin for ember-template-lint",
56
"keywords": [
67
"ember-template-lint",
@@ -9,27 +10,25 @@
910
"glimmer",
1011
"prettier"
1112
],
13+
"repository": "[email protected]:ember-template-lint/ember-template-lint-plugin-prettier.git",
14+
"license": "Apache-2.0",
15+
"author": "Cyrille David <'[email protected]'>",
16+
"main": "ember-template-lint-plugin-prettier.js",
1217
"files": [
1318
"ember-template-lint-plugin-prettier.js",
1419
"lib",
1520
"docs"
1621
],
17-
"main": "ember-template-lint-plugin-prettier.js",
1822
"scripts": {
19-
"changelog": "lerna-changelog",
23+
"format": "yarn prettier '**/*.{hbs,js,json,yml}' --write",
2024
"lint": "npm-run-all lint:* --continue-on-error",
2125
"lint:docs": "markdownlint 'docs/**/*.md'",
2226
"lint:js": "eslint . --cache",
23-
"test": "mocha --recursive",
24-
"format": "yarn prettier '**/*.{hbs,js,json,yml}' --write"
27+
"release": "release-it",
28+
"test": "mocha --recursive"
2529
},
26-
"repository": "[email protected]:dcyriller/ember-template-lint-plugin-prettier.git",
27-
"author": "Cyrille David <'[email protected]'>",
28-
"license": "Apache-2.0",
29-
"private": false,
30-
"peerDependencies": {
31-
"ember-template-lint": ">=2.10.0",
32-
"prettier": ">=1.18.1"
30+
"dependencies": {
31+
"prettier-linter-helpers": "^1.0.0"
3332
},
3433
"devDependencies": {
3534
"ember-template-lint": "^3.4.2",
@@ -41,13 +40,34 @@
4140
"markdownlint-cli": "^0.29.0",
4241
"mocha": "^9.0.1",
4342
"npm-run-all": "^4.1.5",
44-
"prettier": "^2.3.1"
43+
"prettier": "^2.3.1",
44+
"release-it": "^14.11.6",
45+
"release-it-lerna-changelog": "^4.0.1"
46+
},
47+
"peerDependencies": {
48+
"ember-template-lint": ">=2.10.0",
49+
"prettier": ">=1.18.1"
4550
},
4651
"engines": {
4752
"node": "12.* || 14.* || >= 16.*"
4853
},
49-
"dependencies": {
50-
"prettier-linter-helpers": "^1.0.0"
54+
"publishConfig": {
55+
"registry": "https://registry.npmjs.org"
56+
},
57+
"release-it": {
58+
"plugins": {
59+
"release-it-lerna-changelog": {
60+
"infile": "CHANGELOG.md",
61+
"launchEditor": false
62+
}
63+
},
64+
"git": {
65+
"tagName": "v${version}"
66+
},
67+
"github": {
68+
"release": true,
69+
"tokenRef": "GITHUB_AUTH"
70+
}
5171
},
5272
"volta": {
5373
"node": "12.22.7",

0 commit comments

Comments
 (0)