work around slnx issues #146
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, 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 src | |
dotnet restore test | |
dotnet restore benchmark | |
- name: Build | |
run: | | |
dotnet build --no-restore --configuration Release src | |
dotnet build --no-restore --configuration Release test | |
dotnet build --no-restore --configuration Release benchmark | |
- name: Run tests | |
run: dotnet test --no-build --configuration Release test | |
- name: Pack | |
run: dotnet pack src --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 |