v0.0.8
Some checks failed
CI/CD / build-deploy (pull_request) Failing after 53s

This commit is contained in:
Timi
2026-03-25 15:32:19 +08:00
parent c5466ec373
commit c6e2e9cc6d

View File

@@ -88,19 +88,20 @@ jobs:
} }
EOF EOF
) )
response=$(curl -sS -X POST "$api_url" \ response=$(curl -fsS -X POST "$api_url" \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "$payload") -d "$payload")
release_id=$(echo "$response" | grep -o '"id":[0-9]*' | head -n 1 | grep -o '[0-9]*') response=$(printf '%s' "$response" | tr -d '\r\n')
if [ -z "$release_id" ] || echo "$response" | grep -q '"message"'; then release_id=$(printf '%s' "$response" | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p')
if [ -z "$release_id" ] || printf '%s' "$response" | grep -q '"message"'; then
echo "Create release failed: $response" echo "Create release failed: $response"
exit 1 exit 1
fi fi
echo "Release created: id=$release_id" echo "Release created: id=$release_id"
for asset_path in target/*.jar; do for asset_path in target/*.jar; do
asset_name=$(basename "$asset_path") asset_name=$(basename "$asset_path")
curl -sS -X POST "$api_url/$release_id/assets?name=$asset_name" \ curl -fsS -X POST "$api_url/$release_id/assets?name=$asset_name" \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
--data-binary @"$asset_path" --data-binary @"$asset_path"