代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN is empty." 1>&2
exit 1
fi
if [ ! -z "$CIRCLE_TAG" ]; then
TAG=$CIRCLE_TAG
fi
echo "TAG=$TAG"
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"$TAG\",
\"target_commitish\": \"master\",
\"name\": \"$TAG\",
\"body\": \"$TAG\",
\"draft\": true,
\"prerelease\": true
}" \
https://api.github.com/repos/stormcat24/protodep/releases > .tag.json
if [ $? -ne 0 ]; then
echo "create release failed." 1>&2
exit 1
fi
UPLOAD_URL=`cat .tag.json | grep upload_url | sed -e "s/\s*\"upload_url\": \"//" | sed -e "s/\",//" | sed -e "s/{?name,label}/?name=/" | sed -e "s/ //"`
echo "UPLOAD_URL=$UPLOAD_URL"
for file in `ls artifacts`
do
curl --data-binary @artifacts/$file \
-H "Content-Type: application/x-gzip" \
-H "Authorization: token $GITHUB_TOKEN" $UPLOAD_URL$file
if [ $? -ne 0 ]; then
echo "upload artifact failed." 1>&2
exit 1
fi
done
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。