This guide covers how the ElBruno.OllamaMonitor global tool package is published using OIDC Trusted Publishing, following the same release model used in ElBruno.LocalLLMs.
| Package | Project | NuGet |
|---|---|---|
ElBruno.OllamaMonitor |
src/ElBruno.OllamaMonitor.Tool/ElBruno.OllamaMonitor.Tool.csproj |
nuget.org/packages/ElBruno.OllamaMonitor |
Click Add trusted publisher and fill in:
| Field | Value |
|---|---|
| Repository owner | elbruno |
| Repository name | ElBruno.OllamaMonitor |
| Workflow file | publish.yml |
| Environment | release |
release EnvironmentreleaseNUGET_USER SecretAdd a repository secret:
| Name | Value |
|---|---|
NUGET_USER |
Your NuGet.org profile username |
No
NUGET_API_KEYsecret is required. The workflow exchanges GitHub OIDC identity for a short-lived NuGet API key.
mainv0.5.0publish.yml.nupkg to NuGet.orgThe publish workflow follows the same pattern as ElBruno.LocalLLMs, adapted for this Windows desktop tool:
build/Pack-Tool.ps1 to package the global tool and inject the WPF desktop payloadNuGet/login@v1.nupkg as a workflow artifactThe workflow uses this priority order:
| Priority | Source | When |
|---|---|---|
| 1 | Release tag | release event — v0.5.0 becomes 0.5.0 |
| 2 | Manual input | workflow_dispatch with version specified |
| 3 | csproj fallback | Reads <Version> from src/ElBruno.OllamaMonitor.Tool/ElBruno.OllamaMonitor.Tool.csproj |
Versions are validated against ^[0-9]+\.[0-9]+\.[0-9]+.
| Symptom | Cause | Fix |
|---|---|---|
403 Forbidden on NuGet push |
Trusted Publishing policy mismatch | Verify repo owner, repo name, workflow file, and environment match exactly |
OIDC token exchange failed |
Missing id-token: write permission |
Ensure the publish job grants id-token: write |
NUGET_USER missing |
Repository secret not configured | Add the NUGET_USER secret |
| Publish workflow does not run | Release not published | Use a published GitHub Release, not only a tag |
| Package builds locally but not in CI | Windows-specific packaging step | Ensure the workflow runs on windows-latest |