Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec65df2976 | |||
| 23cc1e0e08 |
@@ -113,22 +113,20 @@ jobs:
|
|||||||
|
|
||||||
echo "Creating Gitea release for ${TAG}..."
|
echo "Creating Gitea release for ${TAG}..."
|
||||||
|
|
||||||
# Create JSON payload (avoid shell escaping issues)
|
# Use jq to build valid JSON with proper escaping
|
||||||
cat > /tmp/release.json << EOF
|
BODY="Download binaries for your platform: Linux (amd64, arm64), macOS (Intel, Apple Silicon), FreeBSD (amd64)"
|
||||||
{
|
|
||||||
"tag_name": "${TAG}",
|
JSON_PAYLOAD=$(jq -n \
|
||||||
"name": "${TAG}",
|
--arg tag "$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)",
|
--arg name "$TAG" \
|
||||||
"draft": false,
|
--arg body "$BODY" \
|
||||||
"prerelease": false
|
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Create release via API
|
# Create release via API
|
||||||
RESPONSE=$(curl -s -X POST \
|
RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d @/tmp/release.json \
|
-d "$JSON_PAYLOAD" \
|
||||||
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases")
|
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases")
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||||
@@ -142,13 +140,17 @@ jobs:
|
|||||||
echo "Created release ID: $RELEASE_ID"
|
echo "Created release ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Upload each binary
|
# Upload each binary
|
||||||
|
echo "Files to upload:"
|
||||||
|
ls -la release/
|
||||||
|
|
||||||
for file in release/dbbackup-*; do
|
for file in release/dbbackup-*; do
|
||||||
FILENAME=$(basename "$file")
|
FILENAME=$(basename "$file")
|
||||||
echo "Uploading $FILENAME..."
|
echo "Uploading $FILENAME..."
|
||||||
curl -s -X POST \
|
UPLOAD_RESPONSE=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-F "attachment=@${file}" \
|
-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
|
done
|
||||||
|
|
||||||
echo "Gitea release complete!"
|
echo "Gitea release complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user