diff --git a/.drone.yml b/.drone.yml index b0dd687..5e1e9ab 100644 --- a/.drone.yml +++ b/.drone.yml @@ -74,31 +74,31 @@ steps: - name: artifacts path: /artifacts -- name: upload-to-gitea - image: alpine/curl - commands: - - apk add curl jq - - | - # 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 + - name: upload-to-gitea + image: alpine/curl + commands: + - apk add curl jq + - | + # 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 - echo "Uploading ${artifact} to Gitea" - curl -X POST \ - -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: multipart/form-data" \ - -F "attachment=@${artifact}" \ - "${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${release_id}/assets?name=$(basename ${artifact})" - done + for artifact in /artifacts/*; do + echo "Uploading ${artifact} to Gitea" + curl -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@${artifact}" \ + "${GITEA_SERVER}/api/v1/repos/${DRONE_REPO}/releases/${release_id}/assets?name=$(basename ${artifact})" + done environment: GITEA_TOKEN: from_secret: gitea-token