Skip to content

Commit c489501

Browse files
authored
ci(release): bring in semantic-release (#36)
1 parent 805fa54 commit c489501

File tree

11 files changed

+3085
-131
lines changed

11 files changed

+3085
-131
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
- run: yarn lint
2222
- run: yarn test --coverage
2323
- run: ./node_modules/.bin/codecov
24+
- run: yarn semantic-release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,4 @@ $RECYCLE.BIN/
233233
# End of https://www.gitignore.io/api/windows,linux,osx,node,intellij,sublimetext,visualstudiocode
234234

235235
package-lock.json
236+
.npmrc

CHANGELOG.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
# Change Log
22

3-
## Version 1.1.1 _(2018-12-19)_
3+
The changelog is automatically updated using
4+
[semantic-release](https://github.com/semantic-release/semantic-release). You
5+
can see it on the [releases page](../../releases).
6+
7+
---
8+
9+
<details>
10+
<summary>Historical v1 Change Log</summary>
11+
12+
#### Version 1.1.1 _(2018-12-19)_
413

514
- Improved docs
615
- Improved tests
716
- Moved CI from Travis to Circle
817
- Moved test coverage reports from Coveralls to Codecov
918

10-
## Version 1.1.0 _(2018-02-06)_
19+
#### Version 1.1.0 _(2018-02-06)_
1120

1221
- Added support for component injection and function-as-children render patterns
1322
([#1][#1])
1423

15-
## Version 1.0.1 _(2017-12-20)_
24+
#### Version 1.0.1 _(2017-12-20)_
1625

1726
- Fixed typo in README
1827

19-
## Version 1.0.0 _(2017-12-14)_
28+
#### Version 1.0.0 _(2017-12-14)_
2029

2130
- Initial release :tada:
2231

23-
## Version 1.0.0-alpha.2 _(2017-12-13)_
32+
#### Version 1.0.0-alpha.2 _(2017-12-13)_
2433

2534
- Removed static class fields as a workaround for an [Expo Snack][snack] bug
2635

27-
## Version 1.0.0-alpha.1 _(2017-12-12)_
36+
#### Version 1.0.0-alpha.1 _(2017-12-12)_
2837

2938
- Fixed default `render` return value (`null`) when no `render` prop provided
3039
- Removed unused babel plugins
3140

32-
## Version 1.0.0-alpha.0 _(2017-12-12)_
41+
#### Version 1.0.0-alpha.0 _(2017-12-12)_
3342

3443
- Initial prerelease
3544

45+
</details>
46+
3647
[snack]: https://snack.expo.io/
3748
[#1]: https://github.com/wKovacs64/react-native-responsive-image-view/pull/1

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ _React Native component for scaling an `Image` within the parent `View`_
44

55
[![npm Version][npm-image]][npm-url] [![Build Status][ci-image]][ci-url]
66
[![Code Coverage][coverage-image]][coverage-url]
7+
[![semantic-release][semantic-release-image]][semantic-release-url]
78

89
## The problem
910

@@ -455,6 +456,9 @@ end of the day, these features proved to be too opinionated.
455456
https://img.shields.io/codecov/c/github/wKovacs64/react-native-responsive-image-view/master.svg?style=flat-square
456457
[coverage-url]:
457458
https://codecov.io/gh/wKovacs64/react-native-responsive-image-view/branch/master
459+
[semantic-release-image]:
460+
https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square
461+
[semantic-release-url]: https://github.com/semantic-release/semantic-release
458462
[aspectratio]:
459463
https://facebook.github.io/react-native/docs/layout-props#aspectratio
460464
[render-props]: https://reactjs.org/docs/render-props.html

RELEASING.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
11
# Releasing
22

3-
1. Update the version in `package.json` to a non-dev version in the `develop`
4-
branch.
5-
6-
# Patch
7-
semver -i patch 1.0.1-dev.0 # 1.0.1
8-
9-
# Minor
10-
semver -i minor 1.0.1-dev.0 # 1.1.0
11-
12-
# Major
13-
semver -i major 1.0.1-dev.0 # 2.0.0
14-
15-
1. Update the `CHANGELOG.md` for the impending release.
16-
1. `git commit -am "X.Y.Z"` (where X.Y.Z is the new version)
17-
1. `npm publish` (ensure this succeeds before proceeding)
18-
1. `git checkout master && git merge develop`
19-
1. `git tag vX.Y.Z` (where X.Y.Z is the new version)
20-
1. `git push origin master --tags`
21-
1. `git checkout develop`
22-
1. Update the version in `package.json` to the next dev version in the
23-
`develop` branch.
24-
25-
semver -i prerelease --preid dev 1.0.1 # 1.0.2-dev.0
26-
27-
1. `git commit -am "Prepare next development version"`
28-
1. `git push`
29-
1. Update `gh-pages` branch if necessary.
3+
This package is released automatically using
4+
[semantic-release](https://github.com/semantic-release/semantic-release).

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};

husky.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
hooks: {
3+
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
34
'pre-commit': 'lint-staged',
45
},
56
};

package.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,33 @@
3232
],
3333
"scripts": {
3434
"clean": "rimraf coverage",
35+
"cm": "git-cz",
3536
"format": "prettier --write \"**/*.{js,json,md,yml}\"",
3637
"lint": "eslint .",
37-
"prepublishOnly": "npm run lint && npm run test",
38+
"prepublishOnly": "npm run validate",
3839
"test": "cross-env NODE_ENV=test jest",
39-
"test:coverage": "npm run test -- --coverage",
40-
"test:watch": "npm run test -- --watch"
40+
"validate": "npm-run-all --parallel lint test"
41+
},
42+
"config": {
43+
"commitizen": {
44+
"path": "./node_modules/cz-conventional-changelog"
45+
}
46+
},
47+
"private": false,
48+
"publishConfig": {
49+
"access": "public"
4150
},
4251
"dependencies": {},
4352
"devDependencies": {
4453
"@babel/core": "7.3.4",
54+
"@commitlint/cli": "7.5.2",
55+
"@commitlint/config-conventional": "7.5.0",
4556
"@wkovacs64/eslint-config-react": "2.1.0",
4657
"babel-jest": "24.5.0",
4758
"codecov": "3.2.0",
59+
"commitizen": "3.0.7",
4860
"cross-env": "5.2.0",
61+
"cz-conventional-changelog": "2.1.0",
4962
"doctoc": "1.4.0",
5063
"eslint": "5.15.1",
5164
"eslint-plugin-import": "2.16.0",
@@ -58,14 +71,16 @@
5871
"jest-watch-typeahead": "0.2.1",
5972
"lint-staged": "8.1.5",
6073
"metro-react-native-babel-preset": "0.53.0",
74+
"npm-run-all": "4.1.5",
6175
"prettier": "1.16.4",
6276
"prop-types": "15.7.2",
6377
"react": "16.8.4",
6478
"react-dom": "16.8.4",
6579
"react-native": "0.59.0",
6680
"react-native-testing-library": "1.6.0",
6781
"react-test-renderer": "16.8.4",
68-
"rimraf": "2.6.3"
82+
"rimraf": "2.6.3",
83+
"semantic-release": "15.13.3"
6984
},
7085
"peerDependencies": {
7186
"prop-types": ">=15",

release.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
branch: 'master',
3+
};

renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["config:js-lib"],
2+
"extends": ["config:js-lib", ":semanticCommits"],
33
"commitMessageTopic": "{{depName}}",
44
"automergeType": "branch",
55
"automerge": true,

0 commit comments

Comments
 (0)