Adding release script

This commit is contained in:
Samuel Carlsson 2016-11-10 06:46:57 +01:00
parent b4f5083d00
commit e9de06dc8c
2 changed files with 20 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# Used to store github access token for releasing
/access_token
################
# IntelliJ #
################

17
release.sh Executable file
View File

@ -0,0 +1,17 @@
#/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
exit -1
fi
if [ ! -f access_token ]; then
echo "Place your access token in a file called access_token"
exit -2
fi
VERSION=$1
ACCESS_TOKEN=$(<access_token)
API_JSON=$(printf '{"tag_name": "v%s","target_commitish": "master","name": "v%s","body": "Release of version %s","draft": true,"prerelease": false}' $VERSION $VERSION $VERSION)
curl --data "$API_JSON" https://api.github.com/repos/vidstige/jadb/releases?access_token=$ACCESS_TOKEN