Skip to content

Commit 5c5ddf5

Browse files
committed
chore: introduce semantic-release
1 parent a0e946e commit 5c5ddf5

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

.travis.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
language: node_js
22
sudo: required
33
dist: trusty
4-
node_js:
5-
- lts/*
4+
node_js: lts/*
65
env:
76
- BROWSER=ChromeHeadless
87
addons:
98
chrome: stable
109
cache:
1110
directories:
1211
- "node_modules"
13-
script:
14-
- npm run lint
15-
- npm run coveralls
1612
before_install:
1713
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
14+
15+
jobs:
16+
include:
17+
- stage: test
18+
name: 'Linting'
19+
script: npm run lint
20+
- name: 'Unit Test'
21+
script: npm run coveralls
22+
- stage: release
23+
if: branch = master
24+
script: skip
25+
deploy:
26+
provider: script
27+
skip_cleanup: true
28+
script: npx semantic-release

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ if (ua.isIOS()) {
2323
console.log('sub version': version[1])
2424
}
2525
```
26+
27+
## 贡献
28+
29+
本仓库使用 [semantic release](https://github.com/semantic-release/semantic-release) 自动发布 NPM,因此需要你的 commit 信息符合 [Commitizen](https://github.com/commitizen/cz-cli) 规范。比如:
30+
31+
- bugfix 例子(自动发 bugfix 版本):`fix: 修复在 XX 情况下的 XX 问题`
32+
- feature 例子(自动发 minor 版本):`feat: 支持 XX 浏览器的识别`
33+
- 维护工作(不发版本):`feat: 支持 XX 浏览器的识别`
34+
- 不兼容变更需要包含一段 `BREAKING CHANGES` 的说明,下次发版递增主版本号。

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"main": "src/index.js",
66
"scripts": {
77
"lint": "eslint src test *.js",
8-
"postversion": "git push && git push --tags",
98
"coveralls": "karma start --reporters mocha,coverage,coveralls",
109
"test": "karma start"
1110
},

0 commit comments

Comments
 (0)