TickerNet docs Sponsored by Omniscient AI

ADR 0011 · Code and packages

Publish packages from CI with NuGet trusted publishing

Pushing a version tag on main builds, tests and publishes every TickerNet package to NuGet from GitHub Actions. The workflow gets a short-lived NuGet key through trusted publishing, so no API key is stored anywhere.

Status
Amended 2026-11-24: the workflow also records a signed build provenance attestation (actions/attest) for every .nupkg and .snupkg before publishing. Packages are not author-signed yet; nuget.org repository-signs them.
Decided
2026-11-23
Affects
.github/workflows/release.yaml, src/Directory.Build.props, package READMEs, assets/tickernet-icon.png
01

Context

TickerNet's packages weren't on NuGet. ADR 0005 removed TickerQ's publishing workflow, which used upstream secrets. A release process should be repeatable, should publish only tested code from main, and shouldn't depend on a long-lived API key that can leak or expire. The TickerNet. package ID prefix also needs protecting, as the pledge in GOVERNANCE.md promises.

02

Decision

  • .github/workflows/release.yaml runs when a tag vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-label is pushed. It refuses a tag that isn't on main. It builds the dashboard and every package with the tag's version, runs every test, packs, checks that all 9 packages are there, publishes them to nuget.org, and creates a GitHub release with the packages attached. A tag with a label (for example -preview.2) makes a prerelease.
  • Publishing uses NuGet trusted publishing: the workflow trades GitHub's OIDC token for a short-lived NuGet API key with NuGet/login. The policy on nuget.org names this repository, release.yaml and the nuget environment. The repository variable NUGET_USER names the nuget.org account that owns the policy. No NuGet key is stored in GitHub.
  • The job runs in the nuget GitHub environment, which only v* tags can deploy to.
  • The tag sets the version; Version in src/Directory.Build.props is the default for local builds.
  • Every package carries the TickerNet icon (assets/tickernet-icon.png) and a README written for nuget.org: absolute links, no images or GitHub-only markup. The core package uses src/TickerNet/README.md instead of the repository README.
  • The source generator is never packed on its own (IsPackable is false); it ships inside the TickerNet package.
  • The TickerNet. ID prefix is reserved on nuget.org for the account that publishes.
03

Alternatives considered

  • A NuGet API key in a repository secret. Rejected: a long-lived key can leak through a workflow change and has to be rotated by hand.
  • Publishing from a maintainer's machine. Rejected: not repeatable, and it skips the tests and the check that the code is on main.
  • Publishing on every push to main. Rejected: releases should be deliberate, with a chosen version.
04

Consequences

  • Before the first release, a maintainer sets up the nuget.org account, the trusted publishing policy, the NUGET_USER variable and the prefix reservation (CONTRIBUTING.md, Releasing). Until then a tag fails at the setup check, before anything is published.
  • Adding or removing a package means updating the package count check in release.yaml.
  • Anyone who can push a v* tag for a commit on main can publish, so tag rights are release rights.
05

Where it lives

  • .github/workflows/release.yaml
  • src/Directory.Build.props (icon), src/TickerNet.SourceGenerator/TickerNet.SourceGenerator.csproj (not packable)
  • src/TickerNet/README.md, src/TickerNet.Caching.StackExchangeRedis/README.md and the other package READMEs
  • assets/tickernet-icon.png
  • CONTRIBUTING.md, Releasing
06

Sources