Fix version-4 #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NuGet Package | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET SDKs | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
10.0.x | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.13.0' | |
- name: Use GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Pack NuGet | |
run: | | |
dotnet pack --configuration Release \ | |
-p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} \ | |
--no-build -o out | |
- name: Push to NuGet | |
if: success() | |
run: | | |
dotnet nuget push out/*.nupkg \ | |
--api-key ${{ secrets.NUGET_API_KEY }} \ | |
--source https://api.nuget.org/v3/index.json |