Skip to content

Commit e530a7e

Browse files
Add release-it
1 parent 3f316c6 commit e530a7e

5 files changed

Lines changed: 1657 additions & 170 deletions

File tree

.release-it.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
module.exports = {
4+
hooks: {
5+
'after:bump': 'yarn build'
6+
},
7+
plugins: {
8+
'release-it-lerna-changelog': {
9+
infile: 'CHANGELOG.md',
10+
launchEditor: true
11+
}
12+
},
13+
git: {
14+
tagName: 'v${version}'
15+
},
16+
github: {
17+
release: true,
18+
tokenRef: 'GITHUB_AUTH',
19+
assets: ['dist/**/*.css', 'dist/**/*.js', 'dist/**/*.map']
20+
},
21+
npm: {
22+
publish: true
23+
}
24+
};

.travis.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

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: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
"Zack Bloom <zackbloom@gmail.com>",
77
"Adam Schwartz <adam.flynn.schwartz@gmail.com>"
88
],
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/shipshapecode/tether.git"
12+
},
13+
"license": "MIT",
914
"maintainers": [
1015
"Nicholas Hwang <nick.joosung.hwang@gmail.com>",
1116
"Trevor Burnham <trevorburnham@gmail.com>"
1217
],
18+
"main": "dist/js/tether.js",
19+
"module": "dist/js/tether.esm.js",
1320
"scripts": {
1421
"build": "yarn clean && rollup -c",
1522
"changelog": "github_changelog_generator -u shipshapecode -p tether --since-tag v1.4.7",
@@ -27,13 +34,6 @@
2734
"test:unit:watch": "jest --watch",
2835
"watch": "yarn clean && rollup -c --environment DEVELOPMENT --watch"
2936
},
30-
"repository": {
31-
"type": "git",
32-
"url": "https://github.com/shipshapecode/tether.git"
33-
},
34-
"license": "MIT",
35-
"main": "dist/js/tether.js",
36-
"module": "dist/js/tether.esm.js",
3737
"devDependencies": {
3838
"@babel/core": "^7.13.10",
3939
"@babel/preset-env": "^7.13.10",
@@ -54,6 +54,8 @@
5454
"jest-transform-css": "^2.1.0",
5555
"mutationobserver-shim": "^0.3.7",
5656
"postcss": "^7.0.35",
57+
"release-it": "^14.2.1",
58+
"release-it-lerna-changelog": "^3.1.0",
5759
"rimraf": "^3.0.2",
5860
"rollup": "^2.42.2",
5961
"rollup-plugin-babel": "^4.4.0",
@@ -67,6 +69,9 @@
6769
"sinon": "^9.2.4",
6870
"start-server-and-test": "^1.12.1"
6971
},
72+
"publishConfig": {
73+
"registry": "https://registry.npmjs.org"
74+
},
7075
"volta": {
7176
"node": "10.23.0",
7277
"yarn": "1.22.10"

0 commit comments

Comments
 (0)