(fix): uploads return 409
All checks were successful
/ deploy (push) Successful in 14m35s

This commit is contained in:
Alois 2026-05-02 22:45:13 +02:00
commit 56d05a4e09

View file

@ -61,24 +61,31 @@ jobs:
test -d releases test -d releases
find releases -type f | grep -q . find releases -type f | grep -q .
RELEASE_JSON="$(curl -fsS -X POST "$API/repos/$REPO/releases" \ HTTP_STATUS=$(curl -s -w "%{http_code}" -o release_out.json -H "Authorization: token $TOKEN" "$API/repos/$REPO/releases/tags/$TAG")
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \ if [ "$HTTP_STATUS" = "200" ]; then
-d "$(jq -n \ echo "Release $TAG already exists."
--arg tag "$TAG" \ RELEASE_ID="$(jq -r .id release_out.json)"
--arg name "$TAG" \ else
--arg body "Release $VERSION" \ echo "Creating new release for $TAG"
--arg target "$SHA" \ RELEASE_JSON="$(curl -f -sS -X POST "$API/repos/$REPO/releases" \
'{ -H "Authorization: token $TOKEN" \
tag_name: $tag, -H "Content-Type: application/json" \
name: $name, -d "$(jq -n \
body: $body, --arg tag "$TAG" \
target_commitish: $target, --arg name "$TAG" \
draft: false, --arg body "Release $VERSION" \
prerelease: false --arg target "$SHA" \
}')")" '{
tag_name: $tag,
RELEASE_ID="$(echo "$RELEASE_JSON" | jq -r .id)" name: $name,
body: $body,
target_commitish: $target,
draft: false,
prerelease: false
}')")"
RELEASE_ID="$(echo "$RELEASE_JSON" | jq -r .id)"
fi
find releases -type f -print0 | while IFS= read -r -d '' file; do find releases -type f -print0 | while IFS= read -r -d '' file; do
name="$(basename "$file")" name="$(basename "$file")"