v0.2.8 #18
Workflow file for this run
This file contains 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: Build and Release to NuGet | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
3.1.x | |
8.0.x | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Restore dependencies | |
run: nuget restore | |
- name: Set VERSION variable from tag | |
run: | | |
TAG=${{github.event.release.tag_name}} | |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | |
- name: Build | |
run: dotnet build -c Release${{github.event.release.tag_name && ' -p:Version='}}${{github.event.release.tag_name && env.VERSION}} | |
- name: Pack nugets | |
run: dotnet pack -c Release --no-build --output . | |
- name: Push to NuGet | |
if: github.event_name == 'release' | |
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json |