Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 56ad0824c7 | |||
| ec65df2976 | |||
| 23cc1e0e08 |
@@ -112,43 +112,46 @@ jobs:
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
|
||||
echo "Creating Gitea release for ${TAG}..."
|
||||
echo "Debug: GITHUB_REPOSITORY=${GITHUB_REPOSITORY}"
|
||||
echo "Debug: TAG=${TAG}"
|
||||
|
||||
# Create JSON payload (avoid shell escaping issues)
|
||||
cat > /tmp/release.json << EOF
|
||||
{
|
||||
"tag_name": "${TAG}",
|
||||
"name": "${TAG}",
|
||||
"body": "## Download\n\nSelect the binary for your platform.\n\n### Platforms\n- Linux (amd64, arm64)\n- macOS (Intel, Apple Silicon)\n- FreeBSD (amd64)",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}
|
||||
EOF
|
||||
# Simple body without special characters
|
||||
BODY="Download binaries for your platform"
|
||||
|
||||
# Create release via API
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
# Create release via API with simple inline JSON
|
||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @/tmp/release.json \
|
||||
-d '{"tag_name":"'"${TAG}"'","name":"'"${TAG}"'","body":"'"${BODY}"'","draft":false,"prerelease":false}' \
|
||||
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases")
|
||||
|
||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
||||
BODY_RESPONSE=$(echo "$RESPONSE" | sed '$d')
|
||||
|
||||
echo "HTTP Code: $HTTP_CODE"
|
||||
echo "Response: $BODY_RESPONSE"
|
||||
|
||||
RELEASE_ID=$(echo "$BODY_RESPONSE" | jq -r '.id')
|
||||
|
||||
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release. Response:"
|
||||
echo "$RESPONSE"
|
||||
echo "Failed to create release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# Upload each binary
|
||||
echo "Files to upload:"
|
||||
ls -la release/
|
||||
|
||||
for file in release/dbbackup-*; do
|
||||
FILENAME=$(basename "$file")
|
||||
echo "Uploading $FILENAME..."
|
||||
curl -s -X POST \
|
||||
UPLOAD_RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-F "attachment=@${file}" \
|
||||
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
|
||||
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}")
|
||||
echo "Upload response: $UPLOAD_RESPONSE"
|
||||
done
|
||||
|
||||
echo "Gitea release complete!"
|
||||
|
||||
Reference in New Issue
Block a user