Instructions for publishing ivy-design-system to both npm and NuGet registries.
This package is dual-published: it's available as ivy-design-system on npm and Ivy.DesignSystem on NuGet.org.
The easiest way to publish is using the automated GitHub Actions workflow.
-
GitHub Secrets configured in repository settings:
NPM_TOKEN- npm authentication tokenNUGET_API_KEY- NuGet.org API key
-
Version synchronized between
package.jsonandIvy.DesignSystem.csproj
-
Update version using the sync script:
npm run sync-version 1.0.1
-
Commit changes:
git add package.json Ivy.DesignSystem.csproj git commit -m "chore: bump version to 1.0.1" -
Create and push tag:
git tag v1.0.1 git push && git push --tags -
Monitor the workflow:
- Go to Actions tab on GitHub
- Watch the "Publish Packages" workflow
- Verify both npm and NuGet packages are published
- ✅ Validates version synchronization
- ✅ Builds the design system
- ✅ Verifies C# compilation
- ✅ Runs
dotnet formatcheck - ✅ Creates NuGet package
- ✅ Publishes to npm
- ✅ Publishes to NuGet.org
- ✅ Creates GitHub Release
If you need to publish manually (not recommended):
- npm account with publishing permissions
- Access to
ivy-design-systempackage name on npm - NuGet.org account with API key
- .NET 8.0 SDK installed
- Package built and tested locally
- Versions are synchronized:
npm run sync-version(no arguments to check) - All tests pass:
npm test - Build succeeds:
npm run build - C# compiles:
dotnet build Ivy.DesignSystem.csproj - C# code is formatted:
dotnet format Ivy.DesignSystem.csproj --verify-no-changes - Documentation is up to date
- All changes are committed and pushed to GitHub
npm run sync-version 1.0.1This updates both package.json and Ivy.DesignSystem.csproj.
npm run clean
npm run build
dotnet build Ivy.DesignSystem.csproj --configuration Releasenpm:
npm pack --dry-runNuGet:
dotnet pack Ivy.DesignSystem.csproj --configuration Release --output ./nupkgnpm:
npm loginNuGet:
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.orgnpm:
npm publish --access publicNuGet:
dotnet nuget push ./nupkg/*.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.jsonnpm:
npm info ivy-design-systemNuGet:
dotnet tool install -g NuGet.CommandLine
nuget list Ivy.DesignSystemOr visit: https://www.nuget.org/packages/Ivy.DesignSystem
git tag v1.0.1
git push origin v1.0.1Then create a release on GitHub with release notes.
This project follows Semantic Versioning:
- Major (X.0.0): Breaking changes to token names or structure
- Minor (0.X.0): New tokens or non-breaking enhancements
- Patch (0.0.X): Bug fixes or documentation updates
Always use the sync script to keep versions synchronized:
# Patch release (1.0.0 → 1.0.1)
npm run sync-version 1.0.1
# Minor release (1.0.0 → 1.1.0)
npm run sync-version 1.1.0
# Major release (1.0.0 → 2.0.0)
npm run sync-version 2.0.0Then commit and tag:
git add package.json Ivy.DesignSystem.csproj
git commit -m "chore: bump version to X.Y.Z"
git tag vX.Y.Z
git push && git push --tagsThe build script automatically validates version synchronization. If versions don't match:
# Check current versions
npm run sync-version
# Output:
# Current versions:
# npm: 1.0.0
# NuGet: 1.0.1
# ⚠️ WARNING: Version mismatch detected!Ensure you:
- Are logged in:
npm whoami - Have access to the
ivy-design-systempackage - Using
--access publicflag
Common issues:
- Invalid API key: Get a new key from https://www.nuget.org/account/apikeys
- Package already exists: Bump version number
- Duplicate version: Can't republish the same version
If npm run build fails with version mismatch:
npm run sync-version 1.0.0 # Sync to correct version
npm run build # Try againEnsure .NET SDK is installed:
dotnet --version # Should show 8.0.x or higher
dotnet build Ivy.DesignSystem.csprojCheck:
- Secrets are configured:
NPM_TOKENandNUGET_API_KEYin repository settings - Tag format is correct: Must be
vX.Y.Z(e.g.,v1.0.0) - Versions are synchronized: Run
npm run sync-versionbefore tagging
| Command | Description |
|---|---|
npm run build |
Build all outputs (CSS, Tailwind, JS/TS, C#) |
npm run dev |
Watch mode (auto-rebuild on changes) |
npm run clean |
Remove build artifacts |
npm run sync-version |
Sync versions between package.json and .csproj |
npm test |
Run tests (placeholder) |
dotnet build |
Compile C# code |
dotnet pack |
Create NuGet package |
dotnet format |
Format C# code |
After publishing a new version:
- ✅ Verify npm package: https://www.npmjs.com/package/ivy-design-system
- ✅ Verify NuGet package: https://www.nuget.org/packages/Ivy.DesignSystem
- ✅ Test installation in sample projects
- ✅ Update dependent projects (Ivy-Web, Ivy-Framework)
- ✅ Update documentation if needed
- ✅ Announce the release (Discord, GitHub Discussions)
- ✅ Monitor for issues
To enable automated publishing, configure these secrets in your GitHub repository:
- Go to https://www.npmjs.com/settings/your-username/tokens
- Create a new "Automation" token
- Copy the token
- Add to GitHub: Settings → Secrets and variables → Actions → New repository secret
- Name:
NPM_TOKEN, Value: (paste token)
- Go to https://www.nuget.org/account/apikeys
- Create a new API key with "Push" permission
- Set glob pattern:
Ivy.DesignSystem - Copy the key
- Add to GitHub: Settings → Secrets and variables → Actions → New repository secret
- Name:
NUGET_API_KEY, Value: (paste key)
For issues with publishing:
- npm support: https://www.npmjs.com/support
- NuGet support: https://www.nuget.org/policies/Contact
- GitHub issues: https://github.com/Ivy-Interactive/Ivy-Design-System/issues