Skip to content

Commit 37b8c79

Browse files
committed
Add release-it
1 parent ad3815b commit 37b8c79

File tree

5 files changed

+1761
-106
lines changed

5 files changed

+1761
-106
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

CONTRIBUTING.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@ See test-setup.ts for information about useful test setup hooks.
2525

2626
## Publishing
2727

28-
```shell
29-
git commit
30-
git push
31-
yarn login
32-
yarn publish
33-
# now check to make sure the published package works
34-
git push
35-
git push --tags
36-
```
28+
See the [Release](RELEASE.md) guide for details.
3729

3830
## Running docs server in dev
3931

@@ -60,6 +52,8 @@ Visit http://localhost:4200/
6052

6153
## Deploying docs
6254

55+
NOTE: This is done automatically during releases.
56+
6357
```shell
6458
yarn docs:deploy
6559
```

RELEASE.md

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

package.json

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
"name": "event-perk-grid",
33
"version": "0.1.7",
44
"description": "A utility for reading and displaying Event Perk Grids.",
5-
"main": "dist/index.js",
5+
"keywords": [],
6+
"homepage": "https://tildeio.github.io/event-perk-grid",
7+
"bugs": {
8+
"url": "https://github.com/tildeio/event-perk-grid/issues"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/tildeio/event-perk-grid.git"
13+
},
14+
"license": "MIT",
15+
"author": "Tilde Engineering <[email protected]> (https://tilde.io)",
616
"exports": {
717
".": "./dist/index.js",
818
"./custom-element": "./dist/custom-element.js",
919
"./index.css": "./dist/index.css"
1020
},
21+
"main": "dist/index.js",
1122
"types": "dist/index.d.ts",
1223
"files": [
1324
"dist/**/*"
1425
],
15-
"repository": {
16-
"type": "git",
17-
"url": "git+https://github.com/tildeio/event-perk-grid.git"
18-
},
19-
"keywords": [],
20-
"author": "Tilde Engineering <[email protected]> (https://tilde.io)",
21-
"license": "MIT",
22-
"bugs": {
23-
"url": "https://github.com/tildeio/event-perk-grid/issues"
24-
},
25-
"homepage": "https://tildeio.github.io/event-perk-grid",
2626
"scripts": {
2727
"build:test": "webpack --mode development -c webpack.tests.config.js",
2828
"build:testem": "TESTEM=true webpack --mode development -c webpack.tests.config.js",
@@ -35,10 +35,9 @@
3535
"lint:fix": "npm-run-all --continue-on-error lint:*:fix",
3636
"start": "webpack serve --open --mode development -c webpack.tests.config.js",
3737
"test": "testem",
38-
"preversion": "yarn lint && yarn build && yarn test && yarn docs",
39-
"prepare": "yarn build",
4038
"docs": "typedoc",
41-
"docs:deploy": "yarn docs && cd docs && yarn ember deploy production"
39+
"docs:deploy": "yarn docs && cd docs && yarn ember deploy production",
40+
"release": "release-it"
4241
},
4342
"devDependencies": {
4443
"@types/dotenv-webpack": "^7.0.3",
@@ -65,6 +64,8 @@
6564
"prettier": "^2.5.1",
6665
"qunit": "^2.17.2",
6766
"qunit-dom": "^2.0.0",
67+
"release-it": "^14.2.1",
68+
"release-it-lerna-changelog": "^3.1.0",
6869
"style-loader": "^3.3.1",
6970
"stylelint": "^14.4.0",
7071
"stylelint-config-prettier": "^9.0.3",
@@ -77,11 +78,42 @@
7778
"webpack-cli": "^4.9.2",
7879
"webpack-dev-server": "^4.7.4"
7980
},
80-
"volta": {
81-
"node": "14.18.3",
82-
"yarn": "1.22.17"
81+
"publishConfig": {
82+
"registry": "https://registry.npmjs.org"
8383
},
8484
"msw": {
8585
"workerDirectory": "tests"
86+
},
87+
"release-it": {
88+
"plugins": {
89+
"release-it-lerna-changelog": {
90+
"infile": "CHANGELOG.md",
91+
"launchEditor": false
92+
}
93+
},
94+
"git": {
95+
"tagName": "v${version}"
96+
},
97+
"github": {
98+
"release": true,
99+
"tokenRef": "GITHUB_AUTH"
100+
},
101+
"hooks": {
102+
"before:init": [
103+
"yarn install",
104+
"yarn lint",
105+
"yarn build",
106+
"yarn test",
107+
"yarn docs"
108+
],
109+
"after:release": [
110+
"yarn docs:deploy",
111+
"echo Successfully released ${name} v${version} to ${repo.repository}."
112+
]
113+
}
114+
},
115+
"volta": {
116+
"node": "14.18.3",
117+
"yarn": "1.22.17"
86118
}
87119
}

0 commit comments

Comments
 (0)