Merge pull request #5 from miniduikboot/feature/update-gha #12
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: CI | |
| on: [ "push", "pull_request" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 8.x | |
| - name: Run the Cake script | |
| uses: cake-build/cake-action@v3 | |
| with: | |
| verbosity: Diagnostic | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: nuget packages | |
| path: ./*/bin/Release*/*.nupkg | |
| # Use NuGet trusted publishing: https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing | |
| - name: NuGet login | |
| uses: NuGet/login@v1 | |
| id: login | |
| if: github.ref_type == 'tag' | |
| with: | |
| user: "${{ secrets.NUGET_USER }}" | |
| - name: Push NuGet package | |
| if: github.ref_type == 'tag' | |
| run: | | |
| dotnet nuget push ./{Hazel,Impostor.Hazel.Abstractions}/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} |