Skip to content

Commit 22ffe84

Browse files
authored
chore: add release-it for release and changelog automation (#38)
1 parent f0057bc commit 22ffe84

File tree

4 files changed

+1718
-96
lines changed

4 files changed

+1718
-96
lines changed

.release-it.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"increment": "conventional:angular",
3+
"changelogCommand": "conventional-changelog -p angular | tail -n +3",
4+
"safeBump": false,
5+
"src": {
6+
"commitMessage": "chore: release %s",
7+
"tagName": "v%s"
8+
},
9+
"npm": {
10+
"publish": true
11+
},
12+
"github": {
13+
"release": true,
14+
"releaseName": "v%s"
15+
}
16+
}

CONTRIBUTING.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The core team works directly on GitHub and all work is public.
1010

1111
### Development workflow
1212

13-
> **Working on your first pull request?** You can learn how from this *free* series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
13+
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
1414
1515
1. Fork the repo and create your branch from `master` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
1616
2. Run `yarn` to setup the developement environment.
@@ -20,32 +20,42 @@ The core team works directly on GitHub and all work is public.
2020

2121
We prefix our commit messages with one of the following to signify the kind of change:
2222

23-
* `fix`: bug fixes, e.g. fix incorrect error message.
24-
* `feat`: new features, e.g. add useful API.
25-
* `refactor`: code/structure refactor, e.g. new folder structure.
26-
* `docs`: changes into documentation, e.g. add usage example for `getByText`.
27-
* `test`: adding or updating tests, eg unit, snapshot testing.
28-
* `chore`: tooling changes, e.g. change circle ci config.
29-
* `BREAKING`: for changes that break existing usage, e.g. change API.
23+
- `fix`: bug fixes, e.g. fix incorrect error message.
24+
- `feat`: new features, e.g. add useful API.
25+
- `refactor`: code/structure refactor, e.g. new folder structure.
26+
- `docs`: changes into documentation, e.g. add usage example for `getByText`.
27+
- `test`: adding or updating tests, eg unit, snapshot testing.
28+
- `chore`: tooling changes, e.g. change circle ci config.
29+
- `BREAKING`: for changes that break existing usage, e.g. change API.
3030

3131
Our pre-commit hooks verify that your commit message matches this format when committing.
3232

3333
### Linting and tests
3434

3535
We use `flow` for type checking, `eslint` with `prettier` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when commiting. You can also run the following commands manually:
3636

37-
* `yarn flow`: run flow on all files.
38-
* `yarn lint`: run eslint and prettier.
39-
* `yarn test`: run tests.
37+
- `yarn flow`: run flow on all files.
38+
- `yarn lint`: run eslint and prettier.
39+
- `yarn test`: run tests.
4040

4141
### Sending a pull request
4242

4343
When you're sending a pull request:
4444

45-
* Prefer small pull requests focused on one change.
46-
* Verify that `flow`, `eslint` and tests are passing.
47-
* Preview the documentation to make sure it looks good.
48-
* Follow the pull request template when opening a pull request.
45+
- Prefer small pull requests focused on one change.
46+
- Verify that `flow`, `eslint` and tests are passing.
47+
- Preview the documentation to make sure it looks good.
48+
- Follow the pull request template when opening a pull request.
49+
50+
### Publishing a release
51+
52+
We use [release-it](https://github.com/webpro/release-it) to automate our release. If you have publish access to the NPM package, run the following from the master branch to publish a new release:
53+
54+
```sh
55+
yarn release
56+
```
57+
58+
NOTE: You must have a `GITHUB_TOKEN` environment variable available. You can create a GitHub access token with the "repo" access [here](https://github.com/settings/tokens).
4959

5060
## Reporting issues
5161

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"@types/react-test-renderer": "^16.0.3",
1717
"babel-core": "7.0.0-bridge.0",
1818
"babel-jest": "^23.6.0",
19+
"chalk": "^2.4.1",
20+
"conventional-changelog-cli": "^2.0.5",
21+
"dedent": "^0.7.0",
1922
"eslint": "^5.6.1",
2023
"flow-bin": "^0.83.0",
2124
"jest": "^23.6.0",
@@ -24,6 +27,7 @@
2427
"react": "16.6.0-alpha.8af6728",
2528
"react-native": "^0.57.3",
2629
"react-test-renderer": "16.6.0-alpha.8af6728",
30+
"release-it": "^7.6.2",
2731
"strip-ansi": "^5.0.0",
2832
"typescript": "^3.1.1"
2933
},
@@ -36,9 +40,13 @@
3640
"test": "jest",
3741
"flow-check": "flow check",
3842
"typescript-check": "tsc --noEmit --skipLibCheck --jsx react ./typings/__tests__/*",
39-
"lint": "eslint src --cache"
43+
"lint": "eslint src --cache",
44+
"release": "release-it"
4045
},
4146
"jest": {
4247
"preset": "react-native"
48+
},
49+
"publishConfig": {
50+
"registry": "https://registry.npmjs.org/"
4351
}
4452
}

0 commit comments

Comments
 (0)