Skip to content

Commit 68a5b16

Browse files
author
clowwindy
committed
add release.sh
1 parent bf320a4 commit 68a5b16

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packaging/release.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
if [ $# -ne 1 ]; then
4+
echo usage: release.sh version
5+
exit 1
6+
fi
7+
8+
VERSION=$1
9+
10+
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "master","name": "%s","body": "","draft": false,"prerelease": false}' $VERSION $VERSION)
11+
ID=`curl -v --data "$API_JSON" https://api.github.com/repos/clowwindy/ChinaDNS-C/releases?access_token=$GITHUB_TOKEN | python -c 'import json,sys;print json.load(sys.stdin)["id"]'`
12+
13+
curl -v -H "Content-Type: application/x-tar" \
14+
-H "Authorization: token $GITHUB_TOKEN" \
15+
--data-binary "@chinadns-c-$VERSION.tar.gz" \
16+
https://uploads.github.com/repos/clowwindy/ChinaDNS-C/releases/$ID/assets?name=chinadns-c-$VERSION.tar.gz

0 commit comments

Comments
 (0)