Skip to content

Commit

Permalink
add release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Dec 26, 2014
1 parent bf320a4 commit 68a5b16
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packaging/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo usage: release.sh version
exit 1
fi

VERSION=$1

API_JSON=$(printf '{"tag_name": "%s","target_commitish": "master","name": "%s","body": "","draft": false,"prerelease": false}' $VERSION $VERSION)
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"]'`

curl -v -H "Content-Type: application/x-tar" \
-H "Authorization: token $GITHUB_TOKEN" \
--data-binary "@chinadns-c-$VERSION.tar.gz" \
https://uploads.github.com/repos/clowwindy/ChinaDNS-C/releases/$ID/assets?name=chinadns-c-$VERSION.tar.gz

0 comments on commit 68a5b16

Please sign in to comment.