Skip to content

Publish nuget

Publish nuget #68

Workflow file for this run

name: Publish nuget
on: [workflow_dispatch]
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Set Version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: GitVersion.yml
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore /p:Version=$GitVersion_SemVer /p:FileVersion=$GitVersion_SemVer /p:AssemblyVersion=$GitVersion_MajorMinorPatch
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
- name: Publish packages
run: dotnet nuget push **.nupkg --source nuget.org --api-key ${{secrets.NUGETORG_TOKEN}} --skip-duplicate