#!/bin/bash TOKEN=$(cat ~/.git-credentials | grep -P '(?:)[^:]*(?=@)' -os | head -2 | tail -1) NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1') VERSION=$(git rev-parse HEAD) NAME=$1 BODY=$2 curl -X 'POST' \ 'https://git.cscherr.de/api/v1/repos/PlexSheep/pt/releases' \ -H 'accept: application/json' \ -H "Authorization: $TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "body": "'$BODY'", "draft": true, "name": "'$NAME'", "prerelease": true, "tag_name": "v'$NEW_VERSION'", "target_commitish": "'$COMMIT_SHA'" }'