Skip to content

Commit

Permalink
ci: build & deploy & notify without human!
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghx-319 authored and levy9527 committed May 13, 2019
1 parent b8ccfbd commit 80a969f
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 2,000 deletions.
7 changes: 0 additions & 7 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"presets": [
["@babel/env", { "modules": false }]
],
"env": {
"test": {
"presets": [
["@babel/env", { "targets": { "node": "current" }}]
]
}
},
"plugins": [
["@babel/transform-runtime", {
"regenerator": true
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ git:
install:
- yarn --frozen-lockfile
script:
- yarn build
- ./build.sh
after_success:
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
- ./notify.sh
cache: yarn
deploy:
- provider: pages
Expand Down
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
yarn stdver

yarn build

git remote add github https://$GITHUB_TOKEN@github.com/FEMessage/el-data-table.git > /dev/null 2>&1
git push github HEAD:master --follow-tags

9 changes: 9 additions & 0 deletions notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
url=https://api.github.com/repos/FEMessage/el-data-table/releases/latest
html_url=`curl $url | sed -n 5p | sed 's/\"html_url\"://g' | awk -F '"' '{print $2}'`
body=`curl $url | grep body | sed 's/\"body\"://g;s/\"//g'`

msg='{"msgtype": "markdown", "markdown": {"title": "新版本发布", "text": "@所有人\n# ['$html_url']('$html_url')\n'$body'"}}'

curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg"

18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"scripts": {
"dev": "vue-styleguidist server",
"doc": "vue-styleguidist build",
"test": "jest",
"build":
"npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
"build:umd":
Expand All @@ -28,7 +27,9 @@
"rollup --config build/rollup.config.js --format es --file dist/el-data-table.esm.js",
"build:unpkg":
"rollup --config build/rollup.config.js --format iife --file dist/el-data-table.min.js",
"precommit": "pretty-quick --staged"
"precommit": "pretty-quick --staged",
"stdver": "standard-version -m '[skip ci] chore(release): v%s'",
"release": "gren release --override"
},
"dependencies": {
"lodash.get": "^4.4.2",
Expand All @@ -39,15 +40,12 @@
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@femessage/el-form-renderer": "^1.5.4",
"@vue/test-utils": "^1.0.0-beta.16",
"axios": "^0.18.0",
"babel-jest": "^24.7.1",
"babel-loader": "^8.0.5",
"element-ui": "^2.4.11",
"file-loader": "^3.0.1",
"glob": "^7.1.3",
"husky": "^0.14.3",
"jest": "^23.1.0",
"minimist": "^1.2.0",
"prettier": "1.12.1",
"pretty-quick": "^1.4.1",
Expand All @@ -59,20 +57,12 @@
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue": "^2.5.16",
"vue-jest": "^3.0.4",
"vue-loader": "^15.7.0",
"vue-styleguidist": "^3.11.4",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.29.6"
},
"jest": {
"moduleFileExtensions": ["js", "vue"],
"transform": {
"^.+\\.js$": "./node_modules/babel-jest",
"^.+\\.vue$": "./node_modules/vue-jest"
}
},
"vue-sfc-cli": "1.2.0",
"vue-sfc-cli": "1.6.0",
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
Expand Down
9 changes: 0 additions & 9 deletions test/index.test.js

This file was deleted.

Loading

0 comments on commit 80a969f

Please sign in to comment.