diff --git a/.github/workflows/csharp_release.yml b/.github/workflows/csharp_release.yml index 30e32a43..d0bbba89 100644 --- a/.github/workflows/csharp_release.yml +++ b/.github/workflows/csharp_release.yml @@ -213,6 +213,8 @@ jobs: name: Publish package to NuGet after reviewing the artifact needs: [ variables, pack ] runs-on: ubuntu-latest + permissions: + id-token: write # Review the `nuget-package` artifact ensuring the dlls are # organized before approving. environment: 'i-reviewed-nuget-package-artifact' @@ -226,6 +228,11 @@ jobs: path: ./nuget - name: Setup .NET uses: actions/setup-dotnet@v4 + - name: NuGet login + uses: NuGet/login@v1 + id: nuget-login + with: + user: ${{ secrets.NUGET_USER }} - name: Publish NuGet package run: | - dotnet nuget push ./nuget/Optimizely.SDK.${{ env.VERSION }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + dotnet nuget push ./nuget/Optimizely.SDK.${{ env.VERSION }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}