fix build #26
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: Build, Test, and Deploy | |
| on: [push, release, workflow_dispatch] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: NuGet login | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{secrets.NUGET_USER}} | |
| - name: Build | |
| run: dotnet build --configuration Release | |
| - name: Run tests | |
| run: dotnet test --no-build --configuration Release | |
| - 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 -s https://api.nuget.org/v3/index.json --api-key ${{steps.login.NUGET_API_KEY}} | |