mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-11-28 02:01:58 +02:00
more fix
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
d5e77e0b90
commit
3dd816beaa
1 changed files with 8 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
# calling this directly via e.g. bash forgejo-release.sh will not set -e if it's in the shebang only
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ${VERBOSE:-false}; then set -x; fi
|
if ${VERBOSE:-false}; then set -x; fi
|
||||||
|
|
@ -81,10 +82,11 @@ delete_tag() {
|
||||||
|
|
||||||
upload_release() {
|
upload_release() {
|
||||||
# assets is defined as a list of arguments, where values may contain whitespace and need to be quoted like this -a "my file.txt" -a "file.txt".
|
# assets is defined as a list of arguments, where values may contain whitespace and need to be quoted like this -a "my file.txt" -a "file.txt".
|
||||||
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
|
# It is built using "set --" and expanded with "$@", which preserves argument separation and whitespace splitting.
|
||||||
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
|
# For reference, see https://www.shellcheck.net/wiki/SC3030
|
||||||
|
# In this case, we do not need more than one array, so set -- is fine here.
|
||||||
for file in "$RELEASE_DIR"/*; do
|
for file in "$RELEASE_DIR"/*; do
|
||||||
assets="$assets -a $file"
|
set -- "$@" -a "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
|
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
|
||||||
|
|
@ -97,11 +99,11 @@ upload_release() {
|
||||||
ensure_tag
|
ensure_tag
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! $TEA_BIN release create $assets --repo "$REPO" --note "$RELEASENOTES" --tag "$TAG" --title "$TITLE" --draft "$releaseType" > "$TMP_DIR"/tea.log 2>&1; then
|
if ! $TEA_BIN release create "$@" --repo "$REPO" --note "$RELEASENOTES" --tag "$TAG" --title "$TITLE" --draft "$releaseType" > "$TMP_DIR"/tea.log 2>&1; then
|
||||||
if grep --quiet 'Unknown API Error: 500' "$TMP_DIR"/tea.log && grep --quiet services/release/release.go:194 "$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"
|
echo "workaround v1.20 race condition https://codeberg.org/forgejo/forgejo/issues/1370"
|
||||||
sleep 10
|
sleep 10
|
||||||
$TEA_BIN release create $assets --repo "$REPO" --note "$RELEASENOTES" --tag "$TAG" --title "$TITLE" --draft "$releaseType"
|
$TEA_BIN release create "$@" --repo "$REPO" --note "$RELEASENOTES" --tag "$TAG" --title "$TITLE" --draft "$releaseType"
|
||||||
else
|
else
|
||||||
cat "$TMP_DIR"/tea.log
|
cat "$TMP_DIR"/tea.log
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue