From 33a27ba31bcbe6ccc027e3966dcb5c537e429239 Mon Sep 17 00:00:00 2001 From: KimiSwitch Dev Date: Wed, 9 Sep 2026 14:32:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(release):=20publish-gitea.sh=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=90=AB=E7=A9=BA=E6=A0=BC=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=EF=BC=88=E6=9A=82=E5=AD=98?= =?UTF-8?q?=E5=8E=BB=E7=A9=BA=E6=A0=BC=E5=89=AF=E6=9C=AC=20+=20=E7=82=B9?= =?UTF-8?q?=E5=8F=B7=E5=91=BD=E5=90=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/publish-gitea.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/publish-gitea.sh b/scripts/publish-gitea.sh index 1167489..be91371 100644 --- a/scripts/publish-gitea.sh +++ b/scripts/publish-gitea.sh @@ -51,10 +51,13 @@ fi for ASSET in "$@"; do [[ -f "$ASSET" ]] || { echo "skip missing asset: $ASSET" >&2; continue; } - NAME=$(basename "$ASSET") + NAME=$(basename "$ASSET" | tr ' ' '.') + STAGED=$(mktemp "${TMPDIR:-/tmp}/upload.XXXXXX.${NAME##*.}") + cp "$ASSET" "$STAGED" CODE=$(curl -s -o /dev/null -w '%{http_code}' --max-time 600 "${AUTH[@]}" \ - -F "attachment=@$ASSET" \ + -F "attachment=@$STAGED" \ "$GITEA/repos/$REPO/releases/$RELEASE_ID/assets?name=$NAME") + rm -f "$STAGED" echo "upload $NAME -> HTTP $CODE" [[ "$CODE" == 2* ]] || { echo "upload failed: $NAME" >&2; exit 1; } done