π Running the build separately #4
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 | |
| pull_request: | |
| branches: | |
| - live | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v5 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "6.0.x" | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Run the build | |
| run: dotnet build --configuration Release | |
| - name: Pack the project | |
| run: dotnet pack --configuration Release --no-restore --output ${{ github.workspace }}/nuget | |
| - name: Run tests | |
| run: dotnet test | |
| - name: Publish the NuGet package | |
| run: dotnet nuget push ${{ github.workspace }}/nuget/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |