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 encountered an error
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 encountered an error
This commit is contained in:
11
.drone.yml
11
.drone.yml
@@ -74,18 +74,21 @@ steps:
|
||||
- name: artifacts
|
||||
path: /artifacts
|
||||
|
||||
- name: upload-to-gitea
|
||||
- name: upload-to-gitea
|
||||
image: alpine/curl
|
||||
commands:
|
||||
- apk add curl jq
|
||||
- |
|
||||
# Create release if it doesn't exist (for tags)
|
||||
if [ "${DRONE_TAG}" != "" ]; then
|
||||
# Set the release ID (use tag if available, otherwise "latest")
|
||||
if [ -n "${DRONE_TAG}" ]; then
|
||||
curl -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"tag_name": "'"${DRONE_TAG}"'", "name": "'"${DRONE_TAG}"'", "body": "Automated release"}' \
|
||||
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases"
|
||||
release_id="${DRONE_TAG}"
|
||||
else
|
||||
release_id="latest"
|
||||
fi
|
||||
|
||||
for artifact in /artifacts/*; do
|
||||
@@ -94,7 +97,7 @@ steps:
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "attachment=@${artifact}" \
|
||||
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${DRONE_TAG:-latest}/assets?name=$(basename ${artifact})"
|
||||
"${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${release_id}/assets?name=$(basename ${artifact})"
|
||||
done
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
|
||||
Reference in New Issue
Block a user