diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0ab435..ee98d44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,11 @@ jobs: push-package: name: Release runs-on: ubuntu-latest + environment: nuget.org + permissions: + actions: read + contents: write + id-token: write steps: - name: Download workflow run details @@ -75,5 +80,11 @@ jobs: - name: Add nuget.org source run: dotnet nuget add source --name NUGET https://www.nuget.org + - name: NuGet login (OIDC trusted publishing) + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + id: nuget-login + with: + user: ${{ secrets.NUGET_USER }} + - name: Push to nuget.org - run: dotnet nuget push "$PACKAGE_FILEPATH" -s "NUGET" -k ${{ secrets.NUGET_API_KEY }} + run: dotnet nuget push "$PACKAGE_FILEPATH" -s "NUGET" -k ${{ steps.nuget-login.outputs.NUGET_API_KEY }}