Skip to content

Commit 9f0b5e5

Browse files
author
JavaScript Joe
authored
fix(release): add semantic-release (#128)
* feat: add circle ci and semantic release * fix: update create a new release docs
1 parent 3ac89ee commit 9f0b5e5

File tree

4 files changed

+4611
-9
lines changed

4 files changed

+4611
-9
lines changed

.circleci/config.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: "circleci/node:latest"
6+
steps:
7+
- checkout
8+
- run:
9+
name: release
10+
command: yarn run semantic-release

README.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,7 @@ This template is available on npm at [`@echobind/react-native-template`](https:/
166166

167167
### Create a New Release
168168

169-
Eventually, this process will be handled with CI and `semantic-release` but for now, follow these steps:
170-
171-
1. Make sure `master` is up-to-date: `git checkout master && git pull origin master`
172-
2. Create a new branch: `git checkout -b release`
173-
3. Following [semver](https://semver.org/), create bump the version using `npm version <MAJOR | MINOR | PATCH>`
174-
4. Open a PR to merge into `master`
175-
5. Once the PR is merged, locally run `npm publish`
176-
6. After you publish, our `postpublish` script will automatically push our new git tag to GitHub
169+
This is handled by `semantic-release` and CircleCI. When a commit is merged into `master`, it analyzes it, then runs a new release based on the type of commit (i.e fix is a patch whereas feat is considered a minor or feature relase).
177170

178171
## Acknowledgements
179172

package.json

+57-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,62 @@
55
"access": "public"
66
},
77
"scripts": {
8-
"postpublish": "git push --tags"
8+
"postpublish": "git push --tags",
9+
"semantic-release": "semantic-release"
10+
},
11+
"devDependencies": {
12+
"@semantic-release/commit-analyzer": "^6.3.2",
13+
"@semantic-release/git": "^7.0.17",
14+
"@semantic-release/github": "^5.5.5",
15+
"@semantic-release/npm": "^5.3.2",
16+
"@semantic-release/release-notes-generator": "^7.3.2",
17+
"semantic-release": "^15.14.0"
18+
},
19+
"release": {
20+
"plugins": [
21+
"@semantic-release/npm",
22+
[
23+
"@semantic-release/git",
24+
{
25+
"assets": [
26+
"package.json"
27+
],
28+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
29+
}
30+
],
31+
"@semantic-release/github",
32+
[
33+
"@semantic-release/commit-analyzer",
34+
{
35+
"preset": "angular",
36+
"parserOpts": {
37+
"noteKeywords": [
38+
"BREAKING CHANGE",
39+
"BREAKING CHANGES",
40+
"BREAKING"
41+
]
42+
}
43+
}
44+
],
45+
[
46+
"@semantic-release/release-notes-generator",
47+
{
48+
"preset": "angular",
49+
"parserOpts": {
50+
"noteKeywords": [
51+
"BREAKING CHANGE",
52+
"BREAKING CHANGES",
53+
"BREAKING"
54+
]
55+
},
56+
"writerOpts": {
57+
"commitsSort": [
58+
"subject",
59+
"scope"
60+
]
61+
}
62+
}
63+
]
64+
]
965
}
1066
}

0 commit comments

Comments
 (0)