Update .gitea/workflows/publish-nuget.yml

This commit is contained in:
2025-12-31 10:06:53 +00:00
parent 267d2cb812
commit bed1d58f48

View File

@@ -1,52 +1,42 @@
kind: pipeline
type: docker
name: publish-nuget name: publish-nuget
run-name: ${{ gitea.actor }} is building new Nuget version 🚀
platform: run-name: ${{ gitea.actor }} is building new NuGet version 🚀
os: linux
arch: amd64
clone: on:
depth: full # Needed for versioning if using GitVersion or tags push:
tags:
- 'v*' # Only trigger on tags like v1.0.0
steps: jobs:
- name: restore buildnuget:
image: mcr.microsoft.com/dotnet/sdk:10.0 runs-on: ubuntu-latest # Gitea Actions uses standard runner labels like GitHub
commands:
- cd s8n-runtime
- dotnet restore
- name: build container:
image: mcr.microsoft.com/dotnet/sdk:10.0 image: mcr.microsoft.com/dotnet/sdk:10.0
commands:
- cd s8n-runtime
- dotnet build --no-restore -c Release
- name: pack steps:
image: mcr.microsoft.com/dotnet/sdk:10.0 - name: Checkout code
commands: uses: actions/checkout@v3
- 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
- name: push-to-gitea-nuget - name: Restore dependencies
image: mcr.microsoft.com/dotnet/sdk:10.0 run: |
environment: cd s8n-runtime
GITEA_TOKEN: dotnet restore
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
trigger: - name: Build project
tags: run: |
- v* # Optional: only tags like v1.0.0 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