This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pt/scripts/release.sh

20 lines
568 B
Bash

#!/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'"
}'