Skip to content

update workflow to auto-publish #145

update workflow to auto-publish

update workflow to auto-publish #145

Workflow file for this run

name: Build, Test, and Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests
run: dotnet test --no-build --configuration Release
- name: Pack
run: dotnet pack --no-build --configuration Release --output ./nupkg
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish to GitHub Packages
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.GPM_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json