upload-to-github: mark newly created releases as drafts

This hides them from https://github.com/.../releases/latest so that the
release can be made public only after all the files have been uploaded.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2015-05-14 20:16:18 +02:00
Родитель 5e95af6d43
Коммит dfb0081f2f
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -26,7 +26,9 @@ id="$(curl --netrc -s $url |
grep -B1 "\"tag_name\": \"$tagname\"" |
sed -n 's/.*"id": *\([0-9]*\).*/\1/p')"
test -n "$id" || {
out="$(curl --netrc -s -XPOST -d '{"tag_name":"'"$tagname"'"}' $url)" ||
out="$(curl --netrc -s -XPOST -d \
'{"tag_name":"'"$tagname"'","draft":true,"prerelease":true}' \
$url)" ||
die "Error creating release: $out"
id="$(echo "$out" |
sed -n 's/^ "id": *\([0-9]*\).*/\1/p')"