mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2024-12-28 15:44:48 -05:00
mark the release as draft until it is ready
This commit is contained in:
parent
fb9e03dc6f
commit
56c1c975a3
1 changed files with 9 additions and 2 deletions
|
@ -35,11 +35,18 @@ upload_release() {
|
|||
local assets=$(ls $RELEASE_DIR/* | sed -e 's/^/-a /')
|
||||
local releasetype
|
||||
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"
|
||||
ensure_tag
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue