mark the release as draft until it is ready

This commit is contained in:
Earl Warren 2023-05-24 01:01:15 +02:00
parent fb9e03dc6f
commit 56c1c975a3
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -35,11 +35,18 @@ upload_release() {
local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /') local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /')
local releasetype local releasetype
echo "${TAG}" | grep -qi '\-rc' && export releasetype="--prerelease" && echo "Uploading as Pre-Release" echo "${TAG}" | grep -qi '\-rc' && export releasetype="--prerelease" && echo "Uploading as Pre-Release"
echo "${TAG}" | grep -qi '\-test' && export releasetype="--draft" && echo "Uploading as Draft"
test ${releasetype+false} || echo "Uploading as Stable" test ${releasetype+false} || echo "Uploading as Stable"
ensure_tag ensure_tag
anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g') anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g')
$BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG ${releasetype} $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype}
release_draft false
}
release_draft() {
local state="$1"
local id=$(api GET repos/$REPO/releases/tags/$TAG | jq --raw-output .id)
api PATCH repos/$REPO/releases/$id --data-raw '{"draft": '$state'}'
} }
upload() { upload() {