workaround race condition in v1.20

Refs: https://codeberg.org/forgejo/forgejo/issues/1370
This commit is contained in:
Earl Warren 2023-09-02 08:57:24 +02:00
parent 069735deb1
commit 2d51a3fa48
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -44,7 +44,16 @@ upload_release() {
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 --draft ${releasetype}
if ! $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype} >& $TMP_DIR/tea.log ; then
if grep --quiet 'Unknown API Error: 500' $TMP_DIR/tea.log && grep --quiet services/release/release.go:194 $TMP_DIR/tea.log ; then
echo "workaround v1.20 race condition https://codeberg.org/forgejo/forgejo/issues/1370"
sleep 10
$BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype}
else
cat $TMP_DIR/tea.log
return 1
fi
fi
release_draft false
}