v0.2.0 - New minor version
This commit is contained in:
@@ -259,13 +259,24 @@ create_gitea_release() {
|
|||||||
|
|
||||||
if echo "$response" | grep -q '"id"'; then
|
if echo "$response" | grep -q '"id"'; then
|
||||||
print_success "Created release $NEW_VERSION"
|
print_success "Created release $NEW_VERSION"
|
||||||
|
upload_release_binaries "$api_url" "$token"
|
||||||
# Upload binaries
|
elif echo "$response" | grep -q "already exists"; then
|
||||||
|
print_warning "Release $NEW_VERSION already exists"
|
||||||
upload_release_binaries "$api_url" "$token"
|
upload_release_binaries "$api_url" "$token"
|
||||||
else
|
else
|
||||||
print_warning "Release may already exist or creation failed"
|
print_error "Failed to create release $NEW_VERSION"
|
||||||
print_status "Attempting to upload to existing release..."
|
print_error "Response: $response"
|
||||||
upload_release_binaries "$api_url" "$token"
|
|
||||||
|
# Try to check if the release exists anyway
|
||||||
|
print_status "Checking if release exists..."
|
||||||
|
local check_response=$(curl -s -H "Authorization: token $token" "$api_url/releases/tags/$NEW_VERSION")
|
||||||
|
if echo "$check_response" | grep -q '"id"'; then
|
||||||
|
print_warning "Release exists but creation response was unexpected"
|
||||||
|
upload_release_binaries "$api_url" "$token"
|
||||||
|
else
|
||||||
|
print_error "Release does not exist and creation failed"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,16 +285,23 @@ upload_release_binaries() {
|
|||||||
local api_url="$1"
|
local api_url="$1"
|
||||||
local token="$2"
|
local token="$2"
|
||||||
|
|
||||||
# Get release ID
|
# Get release ID with more robust parsing
|
||||||
local release_id=$(curl -s -H "Authorization: token $token" \
|
print_status "Getting release ID for $NEW_VERSION..."
|
||||||
"$api_url/releases/tags/$NEW_VERSION" | \
|
local response=$(curl -s -H "Authorization: token $token" "$api_url/releases/tags/$NEW_VERSION")
|
||||||
grep -o '"id":[0-9]*' | head -n1 | cut -d: -f2)
|
local release_id=$(echo "$response" | grep -o '"id":[0-9]*' | head -n1 | cut -d: -f2)
|
||||||
|
|
||||||
if [[ -z "$release_id" ]]; then
|
if [[ -z "$release_id" ]]; then
|
||||||
print_error "Could not get release ID for $NEW_VERSION"
|
print_error "Could not get release ID for $NEW_VERSION"
|
||||||
|
print_error "API Response: $response"
|
||||||
|
|
||||||
|
# Try to list all releases to debug
|
||||||
|
print_status "Available releases:"
|
||||||
|
curl -s -H "Authorization: token $token" "$api_url/releases" | grep -o '"tag_name":"[^"]*"' | head -5
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
print_success "Found release ID: $release_id"
|
||||||
|
|
||||||
# Upload x86_64 binary
|
# Upload x86_64 binary
|
||||||
if [[ -f "c-relay-x86_64" ]]; then
|
if [[ -f "c-relay-x86_64" ]]; then
|
||||||
print_status "Uploading x86_64 binary..."
|
print_status "Uploading x86_64 binary..."
|
||||||
|
|||||||
Reference in New Issue
Block a user