Skip to content

Commit 859caea

Browse files
authored
Merge pull request #36 from FEMessage/dev
2 parents 72eef11 + e6f54e6 commit 859caea

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ script:
1212
- ./build.sh
1313
after_success:
1414
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
15+
- ./notify.sh
1516
cache: yarn
1617
deploy:
1718
on:

init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ fileActions.move({
3838
})
3939

4040
fs.chmodSync(path.join(outDir, 'build.sh'), '755')
41+
fs.chmodSync(path.join(outDir, 'notify.sh'), '755')
4142

4243
logger.success(`Generated into ${kleur.underline(outDir)}`)

notify.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
html_url=`curl https://api.github.com/repos/FEMessage/vue-sfc-cli/releases/latest | sed -n 5p | sed 's/\"html_url\"://g' | awk -F '"' '{print $2}'`
3+
body=`curl https://api.github.com/repos/FEMessage/vue-sfc-cli/releases/latest | grep body | sed 's/\"body\"://g;s/\"//g'`
4+
5+
msg='{"msgtype": "markdown", "markdown": {"title": "新版本发布", "text": "@所有人\n# ['$html_url']('$html_url')\n'$body'"}}'
6+
7+
#echo $msg
8+
9+
curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg"
10+

templates/.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ script:
1212
- ./build.sh
1313
after_success:
1414
- GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
15+
- ./notify.sh
1516
cache: yarn
1617
deploy:
1718
- provider: pages

templates/notify.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
url=https://api.github.com/repos/FEMessage/{{componentName}}/releases/latest
3+
html_url=`curl $url | sed -n 5p | sed 's/\"html_url\"://g' | awk -F '"' '{print $2}'`
4+
body=`curl $url | grep body | sed 's/\"body\"://g;s/\"//g'`
5+
6+
msg='{"msgtype": "markdown", "markdown": {"title": "新版本发布", "text": "@所有人\n# ['$html_url']('$html_url')\n'$body'"}}'
7+
8+
curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg"
9+

0 commit comments

Comments
 (0)