Files
Just.Cqrs/.gitea/workflows/publish-nuget.yaml
just c0c2c9f057
All checks were successful
.NET Publish / publish (push) Successful in 1m0s
change publish script
2025-11-11 23:38:15 +04:00

39 lines
1.1 KiB
YAML

name: .NET Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
jobs:
publish:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: 10.x
- name: Restore dependencies
run: dotnet restore --nologo
- name: Create the package
env:
RELEASE_VERSION: ${{ gitea.ref_name }}
run: >
dotnet pack --no-restore --configuration Release --output nupkgs
`echo $RELEASE_VERSION | sed -E 's|^(v([0-9]+(\.[0-9]+){2}))(-([a-z0-9]+)){1}|/p:ReleaseVersion=\2 /p:VersionSuffix=\5|; s|^(v([0-9]+(\.[0-9]+){2}))$|/p:ReleaseVersion=\2|'`
- name: Publish the package to Gitea
run: dotnet nuget push --source ${{ vars.OUTPUT_NUGET_REGISTRY }} --api-key ${{ secrets.LOCAL_NUGET_PACKAGE_TOKEN }} nupkgs/*.nupkg
- name: Publish the package to NuGet.org
run: dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PACKAGE_TOKEN }} nupkgs/*.nupkg