Skip to content

Publish to NuGet

Publish to NuGet #5

Workflow file for this run

name: Publish to NuGet
run-name: Publish to NuGet
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build and pack
run: dotnet pack -o out /p:PackageVersion=${VERSION}
- name: Publish to NuGet
run: dotnet nuget push ./out/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json