You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `NUGET_TRUSTED_PUBLISHER` | Optional | Set to any value to use NuGet [Trusted Publisher](https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing) authentication (OIDC). Requires a supported ambient identity (i.e. CI/CD environment). |
194
+
| `NUGET_USERNAME` | for Trusted Publisher auth | NuGet.org username (profile name, not email address) for Trusted Publisher authentication. |
195
+
| `NUGET_AUDIENCE` | Optional | OIDC audience for token generation (defaults to `https://www.nuget.org`) |
196
+
| `NUGET_TOKEN_SERVICE_URL` | Optional | NuGet token service endpoint (defaults to `https://www.nuget.org/api/v2/token`) |
197
+
| `NUGET_API_KEY` | Optional | [NuGet API Key](https://www.nuget.org/account/apikeys) with "Push" permissions. Not required when using Trusted Publishers. Also set to use a short-lived NuGet API key via e.g. <https://github.com/NuGet/login> |
198
+
| `NUGET_SERVER` | Optional | NuGet Server URL (defaults to nuget.org) |
199
+
200
+
### Trusted Publishers
201
+
202
+
NuGet [Trusted Publishers](https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing) allows publishing without API keys by using OpenID Connect (OIDC) authentication between a trusted third-party service and NuGet.org.
203
+
204
+
**Trusted Publisher Setup:**
205
+
206
+
1. Configure your NuGet.org project to use a [Trusted Publisher](https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing)
207
+
2. Set `NUGET_TRUSTED_PUBLISHER=1` in your workflow environment
208
+
3. Set `NUGET_USERNAME` to your NuGet.org username (profile name)
209
+
4. No `NUGET_API_KEY` needed
210
+
211
+
**Requirements:**
212
+
213
+
* **GitHub Actions**: Your workflow must have `id-token: write` permission.
214
+
* **Python 3**: Required when using Trusted Publishers without providing `NUGET_API_KEY`. The `id` package is automatically installed.
195
215
196
216
**Publish to GitHub Packages**\
197
217
You can publish to GitHub Packages instead, with the following options:
0 commit comments