@@ -142,6 +142,51 @@ We use Cake for our build and deployment process. The way the release process is
142142 and other distribution channels.
1431439 . The issues and pull requests will get updated with message specifying in which release it was included.
144144
145+ ### NuGet Trusted Publishing
146+
147+ NuGet packages are published to nuget.org using [ Trusted Publishing] ( https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing ) ,
148+ which replaces long-lived API keys with short-lived, identity-based tokens issued by GitHub Actions OIDC.
149+
150+ ** How it works:**
151+
152+ 1 . The publish workflow requests a GitHub OIDC token scoped to ` https://www.nuget.org ` .
153+ 2 . That token is exchanged with the nuget.org token service for a short-lived API key.
154+ 3 . Packages are pushed using that short-lived key — no long-lived secret is stored or rotated.
155+
156+ ** One-time setup on nuget.org:**
157+
158+ Trusted Publishing is configured once for the repository and workflow — not per package. A single trusted
159+ publisher entry covers every package pushed by the same workflow run.
160+
161+ 1 . Sign in to [ nuget.org] ( https://www.nuget.org ) as a package owner.
162+ 2 . Go to ** Account settings** → ** Trusted Publishers** (or navigate to any of the
163+ [ GitVersion packages] ( https://www.nuget.org/profiles/GitTools ) and open ** Manage package** → ** Settings** →
164+ ** Trusted Publishers** ).
165+ 3 . Click ** Add trusted publisher** and fill in the following fields:
166+
167+ | Field | Value |
168+ | ------------------------| -----------------|
169+ | ** Publisher type** | GitHub Actions |
170+ | ** Owner** | ` GitTools ` |
171+ | ** Repository** | ` GitVersion ` |
172+ | ** Workflow file name** | ` ci.yml ` |
173+ | ** Environment** | * (leave blank)* |
174+
175+ 4 . Click ** Add** to save the entry.
176+
177+ > ** Note:** nuget.org will only issue a short-lived key when the OIDC claims from the workflow run match * all*
178+ > registered fields exactly. A mismatch on any field (e.g. wrong workflow file name) will cause the token
179+ > exchange to fail and the publish step will fall back to the static ` NUGET_API_KEY ` .
180+
181+ ** Verification and troubleshooting:**
182+
183+ - If the OIDC token exchange fails the workflow falls back to a static ` NUGET_API_KEY ` environment variable
184+ loaded from 1Password via the ` gittools/cicd/nuget-creds@v1 ` action. Check the "Publishing to Nuget.org" log
185+ group for error details.
186+ - The publish job requires ` id-token: write ` permission, which is declared in ` .github/workflows/_publish.yml ` .
187+ - If a package fails to publish with a permissions error, verify that nuget.org Trusted Publishing is configured
188+ and that the owner, repository, and workflow file name match exactly.
189+
145190## Code Style
146191
147192In order to apply the code style defined by by the ` .editorconfig ` file you can use [ ` dotnet-format ` ] ( https://github.com/dotnet/format ) .
0 commit comments