1 Star 0 Fork 0

2144/protodep

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
release.sh 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
stormcat24 提交于 2017-06-10 22:34 . add permission to releash.sh
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iamherer/protodep.git
git@gitee.com:iamherer/protodep.git
iamherer
protodep
protodep
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385