- Repo https://github.com/timabell/github-nuget-demo
- Nuget package https://www.nuget.org/packages/github-nuget-demo/
- Github hosted package https://github.com/timabell/github-nuget-demo/pkgs/nuget/github-nuget-demo (requires gh auth)
A demo of automatic publishing of a C# NuGet library to both GitHub Packages and nuget.org.
To use this template for your own project, configure these repository secrets (Settings → Secrets → Actions):
| Secret | Description |
|---|---|
NUGET_API_KEY |
API key from https://www.nuget.org/account/apikeys with push permissions |
The GITHUB_TOKEN for GitHub Packages is provided automatically.
GitHub Packages requires authentication even for public packages, making it impractical for public distribution. nuget.org allows anonymous access, so consumers can simply run:
dotnet add package GithubNugetDemoEvery commit to main triggers a build & test.
If there are release-worthy changes (commits with feat:, fix:, etc.), a release is created:
- Version calculation (via git-cliff)
- NuGet package creation
- Git tag creation
- GitHub Release with changelog
- Push to GitHub Packages
- Push to nuget.org
Commits with internal prefixes (ci:, refactor:, etc.) do not trigger a release.
If there are no release-worthy commits then no release is generated.
This project uses Conventional Commits format. Optionally include a scope in parentheses: feat(subsystem): add support for arrays.
| Prefix | Description |
|---|---|
feat: |
✨ New features |
fix: |
🐛 Bug fixes |
perf: |
⚡ Performance improvements |
doc: |
📚 Documentation changes |
style: |
🎨 Code style/formatting |
See cliff.toml for definitive list.
These are recommended for consistency but won't appear in user-facing changelogs:
| Prefix | Description |
|---|---|
refactor: |
Code restructuring without behaviour change |
test: |
Adding or updating tests |
ci: |
CI/CD pipeline changes |
build: |
Build system changes |
chore: |
Maintenance tasks |
Release notes are generated from all commits since the last tag, regardless of whether they're on main, in branches, or merge commits. When committing, think about what you want in the release notes:
- Use a release-note prefix (like
feat:orfix:) when the change is meaningful to library users - Use an internal prefix (like
refactor:orci:) for changes that don't affect users - Non-semantic commit messages (e.g. "WIP", "typo fix", "cleanup") are also ignored
This means you can commit freely during development without worrying about polluting release notes.
By default, each release increments the patch version (e.g. 0.0.1 → 0.0.2).
To bump minor or major versions, add a footer to your commit message:
feat: add new feature
bump: minor
feat: breaking change
bump: major
Preview release notes for the current version:
./release-notes.shPreview unreleased changes:
./release-notes.sh --preview