release.sh 514 B

123456789101112131415161718
  1. #/bin/bash
  2. if [ -z "$1" ]; then
  3. echo "Usage: $0 <version>"
  4. exit -1
  5. fi
  6. if [ ! -f access_token ]; then
  7. echo "Place your access token in a file called access_token"
  8. exit -2
  9. fi
  10. VERSION=$1
  11. ACCESS_TOKEN=$(<access_token)
  12. 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)
  13. curl --data "$API_JSON" https://api.github.com/repos/vidstige/jadb/releases?access_token=$ACCESS_TOKEN