Merge pull request #85 from IsaMorphic/feature/fix-ci-publish #7
Workflow file for this run
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: NuGet | |
| on: | |
| push: | |
| tags: ["*"] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore all dependencies | |
| run: dotnet restore | |
| - name: Build QuadrupleLib.Tests | |
| run: dotnet build QuadrupleLib.Tests --no-restore --framework net10.0 | |
| - name: Test QuadrupleLib | |
| run: dotnet test --no-build --verbosity normal --framework net10.0 | |
| - name: Build QuadrupleLib (Release) | |
| run: dotnet build QuadrupleLib --no-restore --configuration Release | |
| - name: Create NuGet packages | |
| run: dotnet pack --no-build --output build/ | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USERNAME }} | |
| - name: Publish to NuGet | |
| run: dotnet nuget push --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json build/**/*.nupkg --skip-duplicate | |
| - name: Create new release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: build/**/*.nupkg | |
| generateReleaseNotes: true |