Skip to content

Publishing

SmartSql publishes all library packages to nuget.org as a coordinated set. This page covers the version management system, the CI/CD publishing pipeline, and the complete list of published NuGet packages.

At a Glance

AspectDetails
Registrynuget.org
Version Sourcebuild/version.props
Current Version4.1.68
CI TriggerGitHub release creation
Build Commanddotnet pack -c Release -o ./nuget
Push Commanddotnet nuget push "./nuget/*.nupkg"
LicenseApache-2.0

Version Management

All SmartSql packages share a single version number, centrally managed in build/version.props:

xml
<Project>
  <PropertyGroup>
    <VersionMajor>4</VersionMajor>
    <VersionMinor>1</VersionMinor>
    <VersionPatch>68</VersionPatch>
    <VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
  </PropertyGroup>
</Project>

The VersionPrefix property is computed from the three components and automatically applied to every project via Directory.Build.props (which imports build/version.props).

Versioning Strategy

ComponentIncrement WhenExample
Major (VersionMajor)Breaking API changes4.x.x -> 5.0.0
Minor (VersionMinor)New features, backward compatible4.1.x -> 4.2.0
Patch (VersionPatch)Bug fixes, no API changes4.1.67 -> 4.1.68

How to Increment

  1. Edit build/version.props
  2. Update the appropriate component (VersionMajor, VersionMinor, or VersionPatch)
  3. Commit the change
  4. Create a GitHub release (this triggers the publish pipeline)
mermaid
flowchart LR
    subgraph version["Version Update Flow"]
        style version fill:#161b22,stroke:#30363d,color:#e6edf3
        Edit["Edit<br>build/version.props"] --> Commit["Commit"]
        Commit --> Release["Create GitHub<br>Release"]
        Release --> CI["CI Pipeline<br>packs & publishes"]
    end

Publishing Pipeline

CI/CD Overview

Publishing is fully automated through GitHub Actions. The workflow triggers when a GitHub release is created.

mermaid
flowchart TD
    subgraph pipeline["NuGet Publishing Pipeline"]
        style pipeline fill:#161b22,stroke:#30363d,color:#e6edf3
        Trigger["GitHub Release Created"] --> Checkout["Checkout repository"]
        Checkout --> Setup["Setup .NET 6.0 SDK"]
        Setup --> Pack["dotnet pack -c Release -o ./nuget"]
        Pack --> Push["dotnet nuget push<br>'./nuget/*.nupkg'<br>to api.nuget.org"]
        Push --> Live["Packages available<br>on nuget.org"]
    end

Workflow Details

The publish workflow (.github/workflows/package-publish.yml) performs these steps:

StepCommandDescription
Setupactions/setup-dotnet@v2 with SDK 6.0.xInstall .NET SDK
Packdotnet pack -c Release -o ./nugetBuild and package all projects in Release mode
Pushdotnet nuget push "./nuget/*.nupkg" -s https://api.nuget.org/v3/index.json -k NUGET_API_KEYUpload all packages to nuget.org

Required Secrets

SecretPurpose
NUGET_API_KEYAPI key for publishing to nuget.org (set in repository secrets)

What Gets Published

The dotnet pack command produces one .nupkg for each library project (non-test, non-sample projects). All packages use the same version from build/version.props. The PackageId for each package defaults to the AssemblyName (which matches the project name).

NuGet Packages

Core Package

PackageDescriptionNuGet
SmartSqlCore ORM libraryNuGet

Extension Packages

PackageDescriptionNuGet
SmartSql.DIExtensionASP.NET Core DI integrationNuGet
SmartSql.DyRepositoryDynamic repository proxy generationNuGet
SmartSql.OptionsOptions-pattern configurationNuGet
SmartSql.AOPAOP transaction supportNuGet
SmartSql.ExtensionsGeneral extensionsNuGet
SmartSql.ScriptTagScript tag supportNuGet
SmartSql.DataConnectorData connector serviceNuGet

Caching Packages

PackageDescriptionNuGet
SmartSql.Cache.RedisRedis cache providerNuGet
SmartSql.Cache.SyncCache synchronizationNuGet
SmartSql.DistributedCacheDistributed cache abstractionNuGet

Bulk Insert Packages

PackageDescriptionNuGet
SmartSql.BulkBase bulk insert abstractionsNuGet
SmartSql.Bulk.SqlServerSQL Server bulk insertNuGet
SmartSql.Bulk.MsSqlServerMS SQL Server bulk insertNuGet
SmartSql.Bulk.MySqlMySQL bulk insertNuGet
SmartSql.Bulk.MySqlConnectorMySQL (MySqlConnector) bulk insertNuGet
SmartSql.Bulk.PostgreSqlPostgreSQL bulk insertNuGet

Synchronization Packages

PackageDescriptionNuGet
SmartSql.InvokeSyncData synchronization baseNuGet
SmartSql.InvokeSync.KafkaKafka sync transportNuGet
SmartSql.InvokeSync.RabbitMQRabbitMQ sync transportNuGet

Database Provider Packages

PackageDescriptionNuGet
SmartSql.OracleOracle database providerNuGet
SmartSql.TypeHandlerJSON and custom type handlersNuGet
SmartSql.TypeHandler.PostgreSqlPostgreSQL type handlersNuGet

Build Metadata

The Directory.Build.props file configures shared metadata applied to every package:

PropertyValueDescription
AuthorsAhoo Wang; nccPackage authors
PackageLicenseExpressionApache-2.0License identifier
PackageRequireLicenseAcceptanceTrueRequires license acceptance on install
DescriptionSmartSql = MyBatis + Cache(Memory | Redis) + ZooKeeper + R/W Splitting + Dynamic RepositoryPackage description
PackageTagsorm, sql, read-write-separation, cache, redis, dotnet-core, cross-platform, high-performance, distributed-computing, zookeeperSearch tags
PublishRepositoryUrltrueSourceLink: publish repository URL
EmbedUntrackedSourcestrueSourceLink: embed untracked sources

SourceLink is enabled via the Microsoft.SourceLink.GitHub package, which allows consumers to step into SmartSql source code from their debugger.

Release Checklist

Before creating a GitHub release to trigger publishing:

  1. Update version in build/version.props
  2. Run all tests -- dotnet test
  3. Build in Release mode -- dotnet build SmartSql.sln -c Release
  4. Pack locally -- dotnet pack -c Release -o ./nuget
  5. Verify package contents by examining .nupkg files
  6. Commit the version change
  7. Create a GitHub release with a tag matching the version (e.g., 4.1.68)
  8. The CI pipeline automatically packs and publishes all packages
mermaid
sequenceDiagram
autonumber
    participant Dev as Developer
    participant GH as GitHub
    participant CI as GitHub Actions
    participant NuGet as nuget.org

    Dev->>Dev: Update build/version.props
    Dev->>Dev: dotnet test
    Dev->>GH: Push version commit
    Dev->>GH: Create Release (tag: 4.1.68)
    GH->>CI: Trigger package-publish workflow
    CI->>CI: dotnet pack -c Release
    CI->>NuGet: dotnet nuget push *.nupkg
    NuGet-->>CI: Published
    CI-->>GH: Workflow complete

Cross-References

References

SourceDescription
.github/workflows/package-publish.ymlNuGet publish workflow
.github/workflows/integration-test.ymlCI test workflow (runs before publish)
build/version.propsVersion management
Directory.Build.propsShared package metadata and SourceLink

Released under the MIT License.