fix: replace release assets cleanly in Gitea Action
Build and Release Plugin / release (push) Failing after 34s

This commit is contained in:
2026-09-17 21:09:12 +02:00
parent 13f9fd642c
commit b7693b606e
+10 -2
View File
@@ -70,14 +70,22 @@ jobs:
REL_ID=$(echo "$RELEASE_RES" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
fi
# Delete existing assets for this release if present
ASSETS=$(curl -s -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/releases/$REL_ID/assets")
echo "$ASSETS" | grep -o '"id":[0-9]*' | cut -d':' -f2 | while read -r asset_id; do
if [ -n "$asset_id" ]; then
curl -s -X DELETE -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/releases/$REL_ID/assets/$asset_id"
fi
done
# Upload Assets
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_${TAG}_jf10.11.zip" || true
-F "attachment=@BlackBarRemover_${TAG}_jf10.11.zip"
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip" || true
-F "attachment=@BlackBarRemover_${TAG}_jf12.0.zip"
- name: Update manifest.json
run: |