This document describes the automated NuGet publishing system for Blazor Blueprint.
Blazor Blueprint uses a monorepo with independent package versioning. Each of the five packages can be released independently with its own version number:
- BlazorBlueprint.Primitives - Headless UI primitives
- BlazorBlueprint.Components - Styled components
- BlazorBlueprint.Icons.Lucide - Lucide icon library
- BlazorBlueprint.Icons.Heroicons - Heroicons library
- BlazorBlueprint.Icons.Feather - Feather icon library
To release a package, simply run the appropriate script:
./scripts/release-primitives.sh 1.0.0-beta.4
./scripts/release-components.sh 1.1.0-beta.2
./scripts/release-icons-lucide.sh 1.0.3
./scripts/release-icons-heroicons.sh 1.0.0-beta.1
./scripts/release-icons-feather.sh 1.0.0-beta.1That's it! The rest is automated.
Each package has a dedicated release script that:
- Validates the version format (semantic versioning)
- Checks for uncommitted changes (prevents dirty releases)
- Confirms with you before proceeding
- Creates a git tag (e.g.,
primitives/v1.0.0-beta.4) - Pushes the tag to GitHub
Tags follow the pattern: <package>/v<version>
Examples:
primitives/v1.0.0-beta.4components/v1.1.0-beta.2icons-lucide/v1.0.3icons-heroicons/v1.0.0-beta.1icons-feather/v1.0.0-beta.1
Each project uses MinVer to automatically calculate the package version from git tags.
Configuration (in each .csproj file):
<MinVerTagPrefix>primitives/v</MinVerTagPrefix> <!-- or icons-lucide/v, etc. -->
<MinVerDefaultPreReleaseIdentifiers>beta.0</MinVerDefaultPreReleaseIdentifiers>How it works:
- Tag
primitives/v1.0.0-beta.4→ Version1.0.0-beta.4 - Tag
icons-lucide/v1.0.3→ Version1.0.3 - Tag
components/v2.0.0→ Version2.0.0 - No matching tag → Version
0.0.0-beta.0.<commit-count>
When a tag is pushed, GitHub Actions automatically:
- Detects which package to build (from tag prefix)
- Restores dependencies
- Builds the project (Release configuration)
- Packs the NuGet package (MinVer sets version automatically)
- Verifies the package version matches the tag
- Publishes to NuGet.org
Workflows:
.github/workflows/nuget-publish.yml- Triggered by tag pushes.github/workflows/ci.yml- Runs on all PRs and pushes to main
Each package can have a different version number:
BlazorBlueprint.Primitives 1.2.0
BlazorBlueprint.Components 1.1.5
BlazorBlueprint.Icons.Lucide 1.0.3
BlazorBlueprint.Icons.Heroicons 1.0.0-beta.1
BlazorBlueprint.Icons.Feather 1.0.0-beta.1
This allows you to:
- Release bug fixes for one package without bumping others
- Evolve packages at different paces
- Clearly communicate changes to consumers
Follow Semantic Versioning:
- Major (1.0.0 → 2.0.0): Breaking changes
- Minor (1.0.0 → 1.1.0): New features (backward compatible)
- Patch (1.0.0 → 1.0.1): Bug fixes (backward compatible)
- Pre-release (1.0.0-beta.1): Beta versions
For beta versions, use the format: X.Y.Z-beta.N
Examples:
1.0.0-beta.1- First beta1.0.0-beta.2- Second beta1.0.0- Stable release
Before releasing a package:
- ✅ All changes committed - No uncommitted files
- ✅ Tests passing - Run
dotnet buildand verify - ✅ README updated - Document new features/changes
- ✅ Version decided - Choose appropriate semantic version
- ✅ NUGET_API_KEY configured - Required for first release
-
Get NuGet API key:
- Go to https://www.nuget.org/account/apikeys
- Create a new API key with "Push" permissions
- Scope it to the BlazorBlueprint.* packages
-
Add to GitHub Secrets:
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
NUGET_API_KEY - Value: (paste your NuGet API key)
-
Test the workflow:
./scripts/release-primitives.sh 1.0.0-beta.1
Monitor releases at: https://github.com/blazorblueprintui/ui/actions
Each release creates a workflow run showing:
- Build logs
- Pack output
- Publish status
- Direct link to NuGet package
Packages appear at:
- https://www.nuget.org/packages/BlazorBlueprint.Primitives
- https://www.nuget.org/packages/BlazorBlueprint.Components
- https://www.nuget.org/packages/BlazorBlueprint.Icons.Lucide
- https://www.nuget.org/packages/BlazorBlueprint.Icons.Heroicons
- https://www.nuget.org/packages/BlazorBlueprint.Icons.Feather
Note: It may take 5-10 minutes for packages to appear on NuGet.org after publishing.
git status
git add .
git commit -m "Your commit message"Ensure version follows semantic versioning:
- ✅
1.0.0 - ✅
1.0.0-beta.1 - ✅
2.1.3-alpha.2 - ❌
v1.0.0(no 'v' prefix) - ❌
1.0(must have three parts)
Delete the tag if you need to recreate it:
# Example for primitives
git tag -d primitives/v1.0.0-beta.4
git push origin :refs/tags/primitives/v1.0.0-beta.4
# Example for icons
git tag -d icons-lucide/v1.0.3
git push origin :refs/tags/icons-lucide/v1.0.3This usually means the git tag doesn't match the MinVer configuration.
Check:
- Tag format:
icons-lucide/v1.0.3(note the prefix) - MinVerTagPrefix in
.csproj:<MinVerTagPrefix>icons-lucide/v</MinVerTagPrefix>
Check:
- NUGET_API_KEY secret is configured
- Build succeeds locally:
dotnet build -c Release - Workflow logs for specific errors
If automation fails, you can release manually:
# Build and pack
dotnet pack src/BlazorBlueprint.Primitives/BlazorBlueprint.Primitives.csproj -c Release -o ./packages
# Publish to NuGet
dotnet nuget push ./packages/BlazorBlueprint.Primitives.*.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.jsonNote: Manual releases won't have the git tag versioning benefits.
- Release often - Small, frequent releases are better than large infrequent ones
- Test before releasing - Always run
dotnet buildlocally first - Document changes - Update README or CHANGELOG for significant changes
- Use pre-release versions - Use
-beta.Xsuffix until stable - Coordinate dependencies - If Components depends on new Primitives features, release Primitives first
git checkout -b feature/my-new-feature
# Make changes
dotnet build
git commit -m "Add new feature"
git push origin feature/my-new-featuregit checkout main
git merge feature/my-new-feature
git push origin main
# Release with new version
./scripts/release-primitives.sh 1.1.0Runs on every PR and push to main:
- Builds all projects
- Runs tests (if any)
- Creates NuGet packages (as artifacts)
- Verifies package creation
Purpose: Ensure code quality and catch issues early
Triggered by tag pushes:
- Builds specific package
- Publishes to NuGet.org
- Only runs for tagged releases
Purpose: Automate releases and reduce human error
Questions or Issues?
If you encounter problems with the release system, check:
- This guide's Troubleshooting section
- GitHub Actions workflow logs
- Open an issue on the repository