#!/bin/sh # https://gist.github.com/DarrenN/8c6a5b969481725a4413 # Modified to trim spaces PACKAGE_VERSION=$(cat package.json \ | grep version \ | head -1 \ | awk -F: '{ print $2 }' \ | sed 's/[ ",]//g') RELEASE_NAME="v$PACKAGE_VERSION" POST_BODY="{\"tag_name\":\"$RELEASE_NAME\",\"target_commitish\":\"master\",\"name\":\"$RELEASE_NAME\",\"body\":\"\",\"prerelease\":false,\"draft\":false}" curl -f -H "Authorization: token $GITHUB_PERSONAL_ACCESS_TOKEN" -H "Content-Type: application/json" -d $POST_BODY -X POST https://api.github.com/repos/$OWNER/$REPO/releases