on: [push, pull_request] jobs: build-publish: runs-on: ubuntu-latest steps: - name: Clone repository uses: actions/checkout@v4 with: submodules: recursive - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - name: Build run: dotnet build - name: Test run: dotnet test --collect:"XPlat Code Coverage" - name: Pack run: dotnet pack --version-suffix ci.$GITHUB_RUN_NUMBER - name: Publish if: github.event_name == 'push' && github.ref_name == 'main' run: dotnet nuget push -s https://nuget.ellpeck.de/v3/index.json **/*.nupkg -k '${{ secrets.BAGET_KEY }}' -n