diff --git a/.github/workflows/publish-nuget.yaml b/.github/workflows/publish-nuget.yaml index 4db824f..03dcafc 100644 --- a/.github/workflows/publish-nuget.yaml +++ b/.github/workflows/publish-nuget.yaml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -30,9 +31,17 @@ jobs: -p:PackageVersion=${{ steps.version.outputs.VERSION }} --output ./nupkg + - name: Sign in to NuGet.org with OIDC + id: nuget-login + uses: NuGet/login@v1 + with: + user: ${{ secrets.NUGET_USER }} + - name: Push to NuGet.org + env: + NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} run: > dotnet nuget push ./nupkg/*.nupkg - --api-key ${{ secrets.NUGET_API_KEY }} + --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate