Merge pull request #39 from NavneetHegde/UpdateWithNewExtensionUsingAI #26
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 and Publish Nuget | |
| on: | |
| push: | |
| branches: | |
| - release/* | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-22.04 # or ubuntu-latest if using include-runtime | |
| permissions: | |
| id-token: write # enable GitHub OIDC token issuance for this job | |
| strategy: | |
| matrix: | |
| dotnet-version: [8.x, 9.x] # test all supported versions | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK and runtime | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| include-runtime: true | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run Tests | |
| run: dotnet test --configuration Release --no-build --verbosity normal -maxcpucount:1 | |
| - name: Pack | |
| run: dotnet pack --configuration Release --no-build --output ./nupkg | |
| # Upload artifact for later publishing | |
| - name: Upload NuGet package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nupkg | |
| path: ./nupkg/*.nupkg | |
| publish: | |
| needs: build-and-test | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Download NuGet package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nupkg | |
| path: ./nupkg | |
| - name: Nuget Login (OIDC + temp API Key) | |
| uses: Nuget/login@v1 | |
| id: login | |
| with: | |
| user: ${{secrets.NUGET_USER}} | |
| - name: Nuget push | |
| run: dotnet nuget push nupkg/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json | |