This guide covers how to publish new versions of ElBruno.LocalEmbeddings, ElBruno.LocalEmbeddings.ImageEmbeddings, ElBruno.LocalEmbeddings.KernelMemory, and ElBruno.LocalEmbeddings.VectorData to NuGet.org using GitHub Actions and NuGet Trusted Publishing (keyless, OIDC-based).
| Package | Project | Description |
|---|---|---|
ElBruno.LocalEmbeddings |
src/ElBruno.LocalEmbeddings/ |
Core library — local ONNX embedding generation |
ElBruno.LocalEmbeddings.ImageEmbeddings |
src/ElBruno.LocalEmbeddings.ImageEmbeddings/ |
Companion — CLIP-based image embeddings |
ElBruno.LocalEmbeddings.KernelMemory |
src/ElBruno.LocalEmbeddings.KernelMemory/ |
Companion — Kernel Memory adapter + extensions |
ElBruno.LocalEmbeddings.VectorData |
src/ElBruno.LocalEmbeddings.VectorData/ |
Companion — Microsoft.Extensions.VectorData integration |
Maintenance rule: If a new packable library is added under
src/, update.github/workflows/publish.ymlin the same PR so the new project is packed/pushed, and add a matching NuGet Trusted Publishing policy.
These steps only need to be done once.
- Sign in to nuget.org
- Click your username → Trusted Publishing
- Add a policy for each package with these values:
| Setting | Value |
|---|---|
| Repository Owner | elbruno |
| Repository | elbruno.localembeddings |
| Workflow File | publish.yml |
| Environment | release |
You need to create this policy four times — once per package:
-
ElBruno.LocalEmbeddings -
ElBruno.LocalEmbeddings.ImageEmbeddings -
ElBruno.LocalEmbeddings.KernelMemory -
ElBruno.LocalEmbeddings.VectorDataNote: For new packages that don't exist on NuGet.org yet, you must first push them once (the workflow handles this). After the initial push, add the Trusted Publishing policy so future publishes are keyless.
- Go to the repo Settings → Environments
- Create an environment called
release- Optionally add required reviewers if you want a manual approval gate before publishing
- Go to Settings → Secrets and variables → Actions
- Add a repository secret:
- Name:
NUGET_USER - Value:
elbruno(your NuGet.org profile name — not your email)
- Name:
This is the standard workflow — the version is derived from the release tag.
-
Update the version in all four csproj files:
src/ElBruno.LocalEmbeddings/ElBruno.LocalEmbeddings.csprojsrc/ElBruno.LocalEmbeddings.ImageEmbeddings/ElBruno.LocalEmbeddings.ImageEmbeddings.csprojsrc/ElBruno.LocalEmbeddings.KernelMemory/ElBruno.LocalEmbeddings.KernelMemory.csprojsrc/ElBruno.LocalEmbeddings.VectorData/ElBruno.LocalEmbeddings.VectorData.csproj
<Version>1.2.0</Version>
-
NuGet icon source (already configured):
nuget_images/icon_03.png- Packed into each
.nupkgasicon_03.pngvia<PackageIcon>icon_03.png</PackageIcon>
-
Commit and push the version change to
main -
Create a GitHub Release:
- Go to the repo → Releases → Draft a new release
- Create a new tag:
v1.2.0(must match the version in the csproj) - Fill in the release title and notes
- Click Publish release
-
The Publish to NuGet workflow runs automatically:
- Strips the
vprefix from the tag → uses1.2.0as the package version - Builds, tests, packs, and pushes to NuGet.org
- Strips the
Use this as a fallback or for testing.
- Go to the repo → Actions → Publish to NuGet
- Click Run workflow
- Optionally enter a version (if left empty, the version from the csproj is used)
- Click Run workflow
The workflow (.github/workflows/publish.yml) uses NuGet Trusted Publishing — no long-lived API keys are needed.
GitHub Release created (e.g. v1.2.0)
→ GitHub Actions triggers publish.yml
→ Builds + tests all projects
→ Packs four .nupkg files (LocalEmbeddings, ImageEmbeddings, KernelMemory, VectorData)
→ Requests an OIDC token from GitHub
→ Exchanges the token with NuGet.org for a temporary API key (valid 1 hour)
→ Pushes all packages to NuGet.org
→ Temp key expires automatically
The workflow determines the package version in this order:
- Release tag — if triggered by a GitHub Release (strips leading
v) - Manual input — if triggered via workflow dispatch with a version specified
- csproj fallback — reads
<Version>fromsrc/ElBruno.LocalEmbeddings/ElBruno.LocalEmbeddings.csproj
| Problem | Solution |
|---|---|
| Workflow fails at "NuGet login" | Verify the Trusted Publishing policy on nuget.org matches the repo owner, repo name, workflow file, and environment exactly |
NUGET_USER secret not found |
Add the secret in GitHub repo Settings → Secrets → Actions |
| Package already exists | The --skip-duplicate flag prevents failures when re-pushing an existing version. Bump the version number instead |
| OIDC token errors | Ensure id-token: write permission is set in the workflow job |
- NuGet Trusted Publishing — Official docs on keyless OIDC-based publishing
- NuGet/login GitHub Action — The action that exchanges OIDC tokens for temporary NuGet API keys
- OpenID Connect (OIDC) in GitHub Actions — How GitHub Actions OIDC tokens work
- GitHub Actions: Creating and Using Environments — How to configure the
releaseenvironment with approval gates - NuGet Package Versioning — Best practices for SemVer versioning
- ElBruno.LocalEmbeddings on NuGet.org — The published package page