From aef2884e8e56bb4758a579f4a50bad1021079d52 Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sun, 10 May 2026 08:38:10 +0200 Subject: [PATCH] Added git tag and release step to package --- .drone.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0ac125b..bf30b9b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,20 +31,35 @@ steps: registry: nexus.khongisa.co.za repo: nexus.khongisa.co.za/litecharms-scheduler tags: [ latest, "1.${DRONE_BUILD_NUMBER}" ] + custom_labels: + - org.opencontainers.image.source=https://gitea.khongisa.co.za/litecharms/scheduler + - org.opencontainers.image.version=1.${DRONE_BUILD_NUMBER} + - org.opencontainers.image.revision=${DRONE_COMMIT_SHA} username: { from_secret: docker_username } password: { from_secret: docker_password } - - - name: gitea-tag + + - name: gitea-tag-release image: alpine/git environment: + GITEA_TOKEN: { from_secret: git_token } GITEA_USER: { from_secret: git_username } GITEA_PASS: { from_secret: git_password } commands: - - git config --global user.email "drone@litecharms.co.za" - - git config --global user.name "Drone CI" - git remote set-url origin https://$${GITEA_USER}:$${GITEA_PASS}@gitea.khongisa.co.za/litecharms/scheduler.git - git tag 1.${DRONE_BUILD_NUMBER} - git push origin 1.${DRONE_BUILD_NUMBER} + - | + curl -X POST "https://gitea.khongisa.co.za/api/v1/repos/litecharms/scheduler/releases" \ + -H "Authorization: token $${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{ + \"tag_name\": \"1.${DRONE_BUILD_NUMBER}\", + \"target_commitish\": \"${DRONE_COMMIT_SHA}\", + \"name\": \"Release 1.${DRONE_BUILD_NUMBER}\", + \"body\": \"### Artifacts\n* **Docker Image:** nexus.khongisa.co.za/litecharms-scheduler:1.${DRONE_BUILD_NUMBER}\n* **NuGet:** [View on Nexus](https://nexus.khongisa.co.za/repository/nuget-group/)\", + \"draft\": false, + \"prerelease\": false + }" depends_on: - build