Merge branch 'live' of https://github.com/WhatIsHeDoing/WhatIsHeDoing… #23
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 | |
| on: | |
| push: | |
| branches: | |
| - live | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - live | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', '**/*.csproj') }} | |
| restore-keys: ${{ runner.os }}-nuget- | |
| - name: Restore dependencies | |
| run: dotnet restore && dotnet tool restore | |
| - name: Run the build | |
| run: dotnet build --configuration Release | |
| - name: Run tests with coverage | |
| run: dotnet tool run dotnet-coverage collect "dotnet test" --output ./coverage.xml --output-format cobertura | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Pack the project | |
| run: dotnet pack --configuration Release --no-restore --output ${{ github.workspace }}/nuget | |
| - name: Publish the NuGet package | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: dotnet nuget push ${{ github.workspace }}/nuget/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |