(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" \
-d "$(jq -n \
--arg tag "$TAG" \
--arg name "$TAG" \
--arg body "Release $VERSION" \
--arg target "$SHA" \
'{
tag_name: $tag,
name: $name,
body: $body,
target_commitish: $target,
draft: false,
prerelease: false
}')")"
RELEASE_ID="$(echo "$RELEASE_JSON" | jq -r .id)" if [ "$HTTP_STATUS" = "200" ]; then
echo "Release $TAG already exists."
RELEASE_ID="$(jq -r .id release_out.json)"
else
echo "Creating new release for $TAG"
RELEASE_JSON="$(curl -f -sS -X POST "$API/repos/$REPO/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg tag "$TAG" \
--arg name "$TAG" \
--arg body "Release $VERSION" \
--arg target "$SHA" \
'{
tag_name: $tag,
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")"