Publish NuGet Package #27
Workflow file for this run
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 Tag | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 10.0.x | |
- name: Extract tag version | |
id: tag_version | |
run: | | |
TAG=${GITHUB_REF#refs/tags/} | |
echo "TAG_VERSION=${TAG#v}" >> $GITHUB_OUTPUT | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Pack | |
run: dotnet pack --configuration Release --no-build -o out \ | |
-p:PackageVersion=${{ steps.tag_version.outputs.TAG_VERSION }} | |
- name: Push to NuGet | |
run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |