Skip to content

chore: add release-it for release automation #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"increment": "conventional:angular",
"changelogCommand": "conventional-changelog -p angular | tail -n +3",
"safeBump": false,
"src": {
"commitMessage": "chore: release %s",
"tagName": "v%s"
},
"npm": {
"publish": true
},
"github": {
"release": true,
"releaseName": "v%s"
}
}
38 changes: 23 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The core team works directly on GitHub and all work is public.

### Development workflow

> **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).
> **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).

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/)).
2. Run `yarn` to setup the developement environment.
Expand All @@ -20,32 +20,40 @@ The core team works directly on GitHub and all work is public.

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

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

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

### Linting and tests

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:

* `yarn flow`: run flow on all files.
* `yarn lint`: run eslint and prettier.
* `yarn test`: run tests.
- `yarn flow`: run flow on all files.
- `yarn lint`: run eslint and prettier.
- `yarn test`: run tests.

### Sending a pull request

When you're sending a pull request:

* Prefer small pull requests focused on one change.
* Verify that `flow`, `eslint` and tests are passing.
* Preview the documentation to make sure it looks good.
* Follow the pull request template when opening a pull request.
- Prefer small pull requests focused on one change.
- Verify that `flow`, `eslint` and tests are passing.
- Preview the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.

### Publishing a release

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:

```sh
yarn release
```

## Reporting issues

Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"@types/react-test-renderer": "^16.0.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"chalk": "^2.4.1",
"conventional-changelog-cli": "^2.0.5",
"dedent": "^0.7.0",
"eslint": "^5.6.1",
"flow-bin": "^0.83.0",
"jest": "^23.6.0",
Expand All @@ -24,6 +27,7 @@
"react": "16.6.0-alpha.8af6728",
"react-native": "^0.57.3",
"react-test-renderer": "16.6.0-alpha.8af6728",
"release-it": "^7.6.2",
"strip-ansi": "^5.0.0",
"typescript": "^3.1.1"
},
Expand All @@ -36,9 +40,13 @@
"test": "jest",
"flow-check": "flow check",
"typescript-check": "tsc --noEmit --skipLibCheck --jsx react ./typings/__tests__/*",
"lint": "eslint src --cache"
"lint": "eslint src --cache",
"release": "release-it"
},
"jest": {
"preset": "react-native"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
}
Loading