This document explains how to use the GitHub Actions workflow to deploy the FluentUI.Blazor.Community.Components package to NuGet.org under the Community.Toolkit.For.Blazor organization.
- Create a NuGet.org account at https://nuget.org
- Generate an API key with permissions to push packages under the
Community.Toolkit.For.Blazororganization - Add the API key as a repository secret:
- Go to your repository settings
- Navigate to 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 to the repository:
# Create and push a release tag
git tag v1.0.1
git push origin v1.0.1Tag Format: Use semantic versioning with a v prefix (e.g., v1.0.0, v1.2.3, v2.0.0-beta.1)
You can manually trigger the deployment from GitHub Actions:
- Go to the Actions tab in your repository
- Select the Deploy to NuGet workflow
- Click Run workflow
- Enter the version number (e.g.,
1.0.1) - Choose if it's a prerelease (optional)
- Click Run workflow
The deployment workflow performs the following steps:
- Version Validation - Ensures the version follows semantic versioning
- Environment Setup - Installs .NET 9.0 SDK
- Version Update - Updates
Directory.Build.propswith the target version - Build - Restores dependencies and builds the solution in Release mode
- Test - Runs unit tests (continues even if some tests fail)
- Package - Creates NuGet packages with symbols
- Upload Artifacts - Saves packages as GitHub Actions artifacts
- Publish - Pushes packages to NuGet.org
- Summary - Provides deployment summary and links
The workflow creates two packages:
- Main Package:
FluentUI.Blazor.Community.Components.{version}.nupkg - Symbol Package:
FluentUI.Blazor.Community.Components.{version}.snupkg
Both packages are uploaded to NuGet.org for public consumption.
- The workflow automatically updates the version in
Directory.Build.props - Version format must follow semantic versioning (e.g.,
1.0.0,1.2.3-beta.1) - For tagged releases, the version is extracted from the tag name (removing the
vprefix) - For manual runs, you specify the version as input
- Check the Actions tab for workflow execution status
- Packages are available as artifacts even before NuGet publication
- The workflow provides a summary with direct links to the published package
- Failed deployments will show detailed error messages
- The
NUGET_API_KEYsecret is required and should be kept secure - The workflow uses the
NuGetenvironment for additional protection - Only repository maintainers with appropriate permissions can trigger deployments
- Missing API Key: Ensure
NUGET_API_KEYis set in repository secrets - Invalid Version: Check that version follows semantic versioning format
- Duplicate Package: NuGet.org doesn't allow overwriting existing versions
- Permission Errors: Ensure the API key has permissions for the package
- Check the workflow logs in the Actions tab for detailed error messages
- Review the NuGet.org documentation for package management
- Open an issue in the repository for workflow-related problems