Update .drone.yml
Some checks failed
Build on Multiple Distributions / build-on-arch (push) Has been cancelled
Build on Multiple Distributions / build-on-debian (push) Has been cancelled
Build on Multiple Distributions / build-on-fedora (push) Has been cancelled
continuous-integration/drone Build is failing

This commit is contained in:
2025-06-15 16:32:18 +00:00
parent 6293b9af40
commit e927c2ae84

View File

@@ -81,23 +81,27 @@ steps:
- | - |
# Set the release ID (use tag if available, otherwise "latest") # Set the release ID (use tag if available, otherwise "latest")
if [ -n "${DRONE_TAG}" ]; then if [ -n "${DRONE_TAG}" ]; then
curl -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 '{"tag_name": "'"${DRONE_TAG}"'", "name": "'"${DRONE_TAG}"'", "body": "Automated release"}' \ -d '{"tag_name": "'"${DRONE_TAG}"'", "name": "'"${DRONE_TAG}"'", "body": "Automated release"}' \
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases" "${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases")
release_id="${DRONE_TAG}" release_id=$(echo "$response" | jq -r '.id')
else else
release_id="latest"
response=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/latest")
release_id=$(echo "$response" | jq -r '.id')
fi fi
for artifact in /artifacts/*; do for artifact in /artifacts/*-setup; do
echo "Uploading ${artifact} to Gitea" filename=$(basename "$artifact")
echo "Uploading ${filename} to Gitea release ${release_id}"
curl -X POST \ curl -X POST \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: multipart/form-data" \ -H "Content-Type: multipart/form-data" \
-F "attachment=@${artifact}" \ -F "attachment=@${artifact}" \
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${release_id}/assets?name=$(basename ${artifact})" "${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${release_id}/assets?name=${filename}"
done done
environment: environment:
GITEA_TOKEN: GITEA_TOKEN: