From 011b3723e27d7b76b91227de8dd2e19b0bd09b3d Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Thu, 9 Jul 2026 23:33:37 +0600 Subject: [PATCH] [FSSDK-12875] trusted publishing --- .github/workflows/csharp_release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 }}