From 47dcafd0248a6817effb7485aa57054b922191d1 Mon Sep 17 00:00:00 2001 From: VitalickS Date: Wed, 31 Dec 2025 10:06:53 +0000 Subject: [PATCH] Update .gitea/workflows/publish-nuget.yml --- .gitea/workflows/publish-nuget.yml | 78 +++++++++++++----------------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/.gitea/workflows/publish-nuget.yml b/.gitea/workflows/publish-nuget.yml index ececff7..7cdbd9d 100644 --- a/.gitea/workflows/publish-nuget.yml +++ b/.gitea/workflows/publish-nuget.yml @@ -1,52 +1,42 @@ -kind: pipeline -type: docker name: publish-nuget -run-name: ${{ gitea.actor }} is building new Nuget version 🚀 -platform: - os: linux - arch: amd64 +run-name: ${{ gitea.actor }} is building new NuGet version 🚀 -clone: - depth: full # Needed for versioning if using GitVersion or tags +on: + push: + tags: + - 'v*' # Only trigger on tags like v1.0.0 -steps: - - name: restore - image: mcr.microsoft.com/dotnet/sdk:10.0 - commands: - - cd s8n-runtime - - dotnet restore +jobs: + buildnuget: + runs-on: ubuntu-latest # Gitea Actions uses standard runner labels like GitHub - - name: build - image: mcr.microsoft.com/dotnet/sdk:10.0 - commands: - - cd s8n-runtime - - dotnet build --no-restore -c Release + container: + image: mcr.microsoft.com/dotnet/sdk:10.0 - - name: pack - image: mcr.microsoft.com/dotnet/sdk:10.0 - commands: - - cd s8n-runtime - - dotnet pack --no-build -c Release -o ./nupkg - when: - event: [ tag ] # Only publish on Git tag - # Output: ./s8n-runtime/nupkg/Sharp8N.Runtime.1.0.0.nupkg + steps: + - name: Checkout code + uses: actions/checkout@v3 - - name: push-to-gitea-nuget - image: mcr.microsoft.com/dotnet/sdk:10.0 - environment: - GITEA_TOKEN: - from_secret: GITEANUGETTOKEN - commands: - - cd s8n-runtime - - | - dotnet nuget push ./nupkg/*.nupkg \ - --api-key $GITEA_TOKEN \ - --source https://code.sharp8n.com/api/packages/Sharp8N/nuget/index.json \ - --skip-duplicate - when: - event: [ tag ] # Only publish on Git tag + - name: Restore dependencies + run: | + cd s8n-runtime + dotnet restore -trigger: - tags: - - v* # Optional: only tags like v1.0.0 \ No newline at end of file + - name: Build project + run: | + cd s8n-runtime + dotnet build --no-restore -c Release + + - name: Pack NuGet package + run: | + cd s8n-runtime + dotnet pack --no-build -c Release -o ./nupkg + + - name: Push to Gitea NuGet feed + run: | + cd s8n-runtime + dotnet nuget push ./nupkg/*.nupkg \ + --api-key ${{ secrets.GITEANUGETTOKEN }} \ + --source https://code.sharp8n.com/api/packages/Sharp8N/nuget/index.json \ + --skip-duplicate \ No newline at end of file