Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use vue-sfc-cli upgrade #67

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: node_js
node_js:
- lts/*
git:
depth: 3
depth: 30
install:
- yarn --frozen-lockfile
- yarn test
Expand Down
17 changes: 17 additions & 0 deletions netlify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
echo "is netlify: $NETLIFY"
echo "in branch: $BRANCH"
echo "head: $HEAD"

if [ "$NETLIFY" != "true" ]
then
echo "this script only runs in netlify, bye"
exit 1
fi

if [ "$BRANCH" != "dev" ] && [ "$HEAD" != "dev" ]
then
yarn doc
else
echo "this script only runs in targeting dev's PR deploy preview, bye"
fi
25 changes: 22 additions & 3 deletions notify.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
#!/bin/sh
# https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean
echo "1/5: checking TRAVIS_TEST_RESULT"
if [ "$TRAVIS_TEST_RESULT" != "0" ]
then
echo "build not success, bye"
exit 1
fi

git remote add github https://[email protected]/FEMessage/el-data-tree.git > /dev/null 2>&1
ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)

echo "2/5: pushing commit and tag to github"
# 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
git remote add github https://[email protected]/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
git push github HEAD:master --follow-tags

echo "3/5: generating github release notes"
GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release

url=https://api.github.com/repos/FEMessage/el-data-tree/releases/latest
# 避免发送错误信息
if [ $? -ne 0 ]
then
echo "gren fails, bye"
exit 1
fi

echo "4/5: downloading github release info"
url=https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest
resp_tmp_file=resp.tmp

curl -H "Authorization: token $GITHUB_TOKEN" $url > $resp_tmp_file
Expand All @@ -19,8 +35,11 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
body=$(grep body < $resp_tmp_file | sed 's/\"body\"://g;s/\"//g')
version=$(echo $html_url | awk -F '/' '{print $NF}')

msg='{"msgtype": "markdown", "markdown": {"title": "el-data-tree更新", "text": "@所有人\n# [el-data-tree('$version')]('$html_url')\n'$body'"}}'
echo "5/5: notifying with dingtalk bot"
msg='{"msgtype": "markdown", "markdown": {"title": "'$REPO_NAME'更新", "text": "@所有人\n# ['$REPO_NAME'('$version')]('$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"

rm $resp_tmp_file

echo "executing notify.sh successfully"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@femessage/el-form-renderer": "^1.6.0",
"@femessage/github-release-notes": "^0.19.0",
"@femessage/github-release-notes": "latest",
"axios": "^0.18.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.5",
Expand Down Expand Up @@ -83,7 +83,7 @@
"publishConfig": {
"access": "public"
},
"vue-sfc-cli": "1.10.4",
"vue-sfc-cli": "1.12.0",
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@
lodash.get "^4.4.2"
lodash.set "^4.3.2"

"@femessage/github-release-notes@^0.19.0":
"@femessage/github-release-notes@latest":
version "0.19.0"
resolved "https://registry.npmjs.org/@femessage/github-release-notes/-/github-release-notes-0.19.0.tgz#483767c6a52d3a1086000442580503fed72a0898"
integrity sha512-p97YOnBoLfgiWknF5bzqlUOTHIBcBpI8L7bpekPls3annTV65TGfdkl2ICZZAvhjIcl9usDqGFj6pJWj+R+Rzw==
Expand Down