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

34 lines
1005 B
Bash
Executable File

#!/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)
BODY=$1
USER=PlexSheep
git tag "v$NEW_VERSION" || echo "could not tag"
echo '$' "curl -X 'POST'
'https://git.cscherr.de/api/v1/repos/PlexSheep/pt/releases'
-H 'accept: application/json'
-H 'Authorization: token (redacted)'
-H 'Content-Type: application/json'
-d" '{
"body": "'$BODY'",
"draft": true,
"name": "v'$NEW_VERSION'",
"prerelease": true,
"tag_name": "v'$NEW_VERSION'",
"target_commitish": "'$COMMIT_SHA'"
}'
curl -X 'POST' \
'https://git.cscherr.de/api/v1/repos/PlexSheep/pt/releases' \
-H 'accept: application/json' \
-H "Authorization: token $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"body": "'$BODY'",
"draft": true,
"name": "v'$NEW_VERSION'",
"prerelease": true,
"tag_name": "v'$NEW_VERSION'",
"target_commitish": "'$COMMIT_SHA'"
}'