From a015801423c80a60d50e5c9344e230f29baa5ddc Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sun, 10 May 2026 09:18:54 +0200 Subject: [PATCH] Added tag and release step after publish --- .drone.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2a7ba50..20cb3f8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,8 +13,7 @@ steps: - name: pack-and-publish image: mcr.microsoft.com/dotnet/sdk:10.0 environment: - NEXUS_KEY: - from_secret: nexus_api_key + NEXUS_KEY: { from_secret: nexus_api_key } NEXUS_URL: https://nexus.khongisa.co.za/repository/nuget-hosted/ VERSION: 1.${DRONE_BUILD_NUMBER}.0 commands: @@ -42,6 +41,31 @@ steps: - dotnet pack LiteCharms.Entities/LiteCharms.Entities.csproj -c Release -p:PackageVersion=$VERSION -o dist/ - dotnet nuget push dist/LiteCharms.Entities.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL + - 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 } + VERSION: 1.${DRONE_BUILD_NUMBER}.0 + commands: + - apk add --no-cache curl + - git remote set-url origin https://$${GITEA_USER}:$${GITEA_PASS}@gitea.khongisa.co.za/litecharms/libraries.git + - git tag $VERSION + - git push origin $VERSION + - | + curl -X POST "https://gitea.khongisa.co.za/api/v1/repos/litecharms/libraries/releases" \ + -H "Authorization: token $${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{ + \"tag_name\": \"$VERSION\", + \"target_commitish\": \"${DRONE_COMMIT_SHA}\", + \"name\": \"Library Suite $VERSION\", + \"body\": \"### Published NuGet Packages\nAll packages versioned as **$VERSION**:\n* LiteCharms.Abstractions\n* LiteCharms.Models\n* LiteCharms.Infrastructure\n* LiteCharms.Features\n* LiteCharms.Extensions\n* LiteCharms.Entities\n\n[View in Nexus](https://nexus.khongisa.co.za/repository/nuget-group/)\", + \"draft\": false, + \"prerelease\": false + }" + trigger: - branch: - - master \ No newline at end of file + event: + - pull_request \ No newline at end of file