File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
2+ set -e
3+
4+ echo " checking TRAVIS_TEST_RESULT"
25if [ " $TRAVIS_TEST_RESULT " != " 0" ]
36then
47 echo " build not success, bye"
811ORG_NAME=$( echo " $TRAVIS_REPO_SLUG " | cut -d ' /' -f 1)
912REPO_NAME=$( echo " $TRAVIS_REPO_SLUG " | cut -d ' /' -f 2)
1013
14+ echo " pushing commit and tag to github"
1115git remote add github https://$GITHUB_TOKEN @github.com/$TRAVIS_REPO_SLUG .git > /dev/null 2>&1
1216git push github HEAD:master --follow-tags
1317
18+ echo " generating github release notes"
1419GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
1520
21+ echo " downloading github release info"
1622url=https://api.github.com/repos/$TRAVIS_REPO_SLUG /releases/latest
1723resp_tmp_file=resp.tmp
1824
@@ -22,8 +28,11 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
2228body=$( grep body < $resp_tmp_file | sed ' s/\"body\"://g;s/\"//g' )
2329version=$( echo $html_url | awk -F ' /' ' {print $NF}' )
2430
31+ echo " notifying with dingtalk bot"
2532msg=' {"msgtype": "markdown", "markdown": {"title": "' $REPO_NAME ' 更新", "text": "@所有人\n# [' $REPO_NAME ' (' $version ' )](' $html_url ' )\n' $body ' "}}'
2633
2734curl -X POST https://oapi.dingtalk.com/robot/send\? access_token\= $DINGTALK_ROBOT_TOKEN -H ' Content-Type: application/json' -d " $msg "
2835
2936rm $resp_tmp_file
37+
38+ echo " executing notify.sh successfully"
Original file line number Diff line number Diff line change 11#! /bin/sh
2+ # https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean
3+ set -e
4+
5+ echo " 1/5: checking TRAVIS_TEST_RESULT"
26if [ " $TRAVIS_TEST_RESULT " != " 0" ]
37then
48 echo " build not success, bye"
812ORG_NAME=$( echo " $TRAVIS_REPO_SLUG " | cut -d ' /' -f 1)
913REPO_NAME=$( echo " $TRAVIS_REPO_SLUG " | cut -d ' /' -f 2)
1014
15+ echo " 2/5: pushing commit and tag to github"
1116git remote add github https://$GITHUB_TOKEN @github.com/$TRAVIS_REPO_SLUG .git > /dev/null 2>&1
1217git push github HEAD:master --follow-tags
1318
19+ echo " 3/5: generating github release notes"
1420GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
1521
22+ echo " 4/5: downloading github release info"
1623url=https://api.github.com/repos/$TRAVIS_REPO_SLUG /releases/latest
1724resp_tmp_file=resp.tmp
1825
@@ -22,8 +29,11 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
2229body=$( grep body < $resp_tmp_file | sed ' s/\"body\"://g;s/\"//g' )
2330version=$( echo $html_url | awk -F ' /' ' {print $NF}' )
2431
32+ echo " 5/5: notifying with dingtalk bot"
2533msg=' {"msgtype": "markdown", "markdown": {"title": "' $REPO_NAME ' 更新", "text": "@所有人\n# [' $REPO_NAME ' (' $version ' )](' $html_url ' )\n' $body ' "}}'
2634
2735curl -X POST https://oapi.dingtalk.com/robot/send\? access_token\= $DINGTALK_ROBOT_TOKEN -H ' Content-Type: application/json' -d " $msg "
2836
2937rm $resp_tmp_file
38+
39+ echo " executing notify.sh successfully"
You can’t perform that action at this time.
0 commit comments