Modify bb64/publish.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 9s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m10s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped

This commit is contained in:
Your Name
2025-06-29 20:18:42 +12:00
parent 3388a46bf3
commit 00d1e86157

View File

@ -105,12 +105,20 @@ echo "Getting or creating release $TAG on Gitea..."
EXISTING_RELEASE=$(curl -s -X GET "$API_URL/releases/tags/$TAG" \ EXISTING_RELEASE=$(curl -s -X GET "$API_URL/releases/tags/$TAG" \
-H "Authorization: token $RELEASE_WRITE_TOKEN") -H "Authorization: token $RELEASE_WRITE_TOKEN")
echo "Existing release check response: $EXISTING_RELEASE" >&2
if echo "$EXISTING_RELEASE" | grep -q '"id":[0-9]*'; then if echo "$EXISTING_RELEASE" | grep -q '"id":[0-9]*'; then
# Release already exists, get its ID # Release already exists, get its ID
RELEASE_ID=$(echo "$EXISTING_RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) RELEASE_ID=$(echo "$EXISTING_RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
echo "Release $TAG already exists with ID: $RELEASE_ID" echo "Release $TAG already exists with ID: $RELEASE_ID"
else else
# Create new release # Create new release only if tag was just created
if [ "$TAG_EXISTS_ON_REMOTE" = true ]; then
echo "Tag exists on remote but no release found - this shouldn't happen" >&2
echo "API response was: $EXISTING_RELEASE" >&2
exit 1
fi
echo "Creating new release $TAG on Gitea..." echo "Creating new release $TAG on Gitea..."
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \ RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \