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
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:
33
.drone.yml
33
.drone.yml
@@ -74,16 +74,33 @@ steps:
|
||||
- name: artifacts
|
||||
path: /artifacts
|
||||
|
||||
- name: publish-artifacts
|
||||
image: techknowlogick/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
- 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
|
||||
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"
|
||||
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/${DRONE_TAG:-latest}/assets?name=$(basename ${artifact})"
|
||||
done
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea-token
|
||||
base_url:
|
||||
GITEA_SERVER:
|
||||
from_secret: gitea-server
|
||||
files: /artifacts/*
|
||||
title: Build Artifacts
|
||||
note: "Automated build artifacts"
|
||||
volumes:
|
||||
- name: artifacts
|
||||
path: /artifacts
|
||||
|
||||
Reference in New Issue
Block a user