This repository includes a GitHub Action workflow that automatically builds, tests, and publishes the NuGet package.
- NuGet API Key: You need to create an API key from NuGet.org
- GitHub Secret: Add your NuGet API key as a repository secret:
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
NUGET_API_KEY - Value: Your NuGet API key
The workflow automatically triggers when you push a version tag:
# Create and push a version tag
git tag v1.0.0
git push origin v1.0.0
# Or create with annotation
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0The workflow will:
- Extract version from the tag (e.g.,
v1.0.0→1.0.0) - Build and test the project
- Create NuGet package with the version
- Publish to NuGet.org
- Create a GitHub Release with the package attached
You can manually trigger the workflow from GitHub:
- Go to repository → Actions → "Publish NuGet Package"
- Click "Run workflow"
- Enter the version number (e.g.,
1.0.1) - Click "Run workflow"
Follow Semantic Versioning:
- MAJOR.MINOR.PATCH (e.g., 1.2.3)
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Examples:
v1.0.0- Initial releasev1.1.0- Added new featurev1.1.1- Bug fixv2.0.0- Breaking changes
Always test the package build locally before publishing:
# Build the project
dotnet build --configuration Release
# Run tests
dotnet test --configuration Release
# Create package (without publishing)
dotnet pack --configuration Release --output ./artifacts
# Inspect the package
unzip -l ./artifacts/WebNet.LiteGraphExtensions.GraphRepositories.*.nupkgThe GitHub Action workflow (publish-nuget.yml) performs these steps:
- Checkout: Gets the repository code
- Setup .NET: Installs .NET 10.0
- Extract Version: Gets version from tag or input
- Restore: Restores NuGet dependencies
- Build: Builds in Release configuration
- Test: Runs all unit tests
- Pack: Creates NuGet package with metadata
- Publish: Pushes to NuGet.org
- Artifacts: Uploads package to GitHub
- Release: Creates GitHub release (for tag pushes)
The package includes:
- PackageId: WebNet.LiteGraphExtensions.GraphRepositories
- Title: LiteGraph Repository Extensions
- Description: Full implementation descriptions
- Tags: litegraph, graph, database, repository, duckdb, fastdb, litedb
- License: MIT
- README: Included in package
- Symbols: Debug symbols included (.snupkg)
- Ensure all tests pass locally
- Check .NET version compatibility
- Verify all dependencies are restored
- Verify
NUGET_API_KEYsecret is set correctly - Check API key hasn't expired on NuGet.org
- Ensure API key has "Push" permissions
- NuGet doesn't allow overwriting versions
- Increment the version number
- Delete the tag and recreate with new version
- NuGet indexing can take 10-15 minutes
- Check workflow logs for errors
- Verify package passed validation
To publish an update:
# Make your changes
git add .
git commit -m "Your changes"
git push
# Create new version tag
git tag v1.0.1
git push origin v1.0.1If you need to unlist a version:
- Go to NuGet.org
- Find your package
- Select the version
- Click "Unlist"
Note: Unlisted packages can still be installed if version is specified explicitly.
Each tagged release creates a GitHub Release with:
- Release notes (auto-generated from commits)
- NuGet package (.nupkg) attached
- Symbols package (.snupkg) attached
View releases at: https://github.com/YOUR_USERNAME/WebNet.LiteGraphExtensions.GraphRepositories/releases