Skip to content

Collaborators: Creating a new NuGet release

Andreas Gullberg Larsen edited this page Jul 21, 2019 · 1 revision

This guide is intended for collaborators with write access, but the same steps could be followed in a pull request.

NuGet Packages

We currently have 3 nugets:

UnitsNet (Core)

The core nuget holds all the widely used units and conversions. More specialized, engineering or scientific domain specific units may later come as additional nugets.

There is an additional WindowsRuntimeComponent target, which has a limited and slightly different public API surface in order to be compatible with WinJS and C++ UWP apps. See "Creating Windows Runtime Components in C# and Visual Basic" and #150.

UnitsNet.Serialization.JsonNet (pre-release)

Serialization using Json.NET. This is currently considered experimental and the version has suffix -alpha to make it a nuget prerelease.

Versioning

We follow semver versioning and we strive to maintain backwards compatibility. A wishlist of breaking changes is maintained in #180.

Each nuget has its own .nuspec and can do its own versioning, but the core nugets are typically versioned together.

Creating a new release

The master branch is our stable branch and should be more or less release ready at any given time. Our build server will automatically attempt to publish all the nugets on every master commit, and silently fails on versions that are already published. If any of the .nuspec files have a different version (should be a newer version), its nuget will be published with that version.

Core

Locally with the git command line:

  1. Add a single commit that updates version of UnitsNet.nuspec and UnitsNet.WindowsRuntimeComponent.nuspec
  2. Title of commit: "UnitsNet: 3.47.0"
  3. Push to origin/master (this repo) or create pull request
  4. Add an annotated tag "3.47.0" with a bullet list of changes, preferably prefixed with the GitHub issue number for the relevant issue/PR. This will show up on the Release page.
  5. Push tag to origin/master (this repo)

Note: You can use Build/bump-version-minor.bat and Build/bump-version-patch.bat to automatically perform steps 1 and 2, but you need to manually edit the tag content as in step 2, either in git or at the Release page.

From the GitHub website:

  1. Edit the .nuspec files (two commits instead of one, use filename in commit title)
  2. Create a release at the Release page, this is the annotated tag in step 4

Example commit: UnitsNet: 3.46.1

UnitsNet.Serialization.Json

Same as for Core, except:

  • Update the UnitsNet.Serialization.Json.nuspec file
  • Title of commit: "JsonNet: 1.0.0-alpha5"
  • Title of tag: "JsonNet/1.0.0-alpha5"
  • Description in annotated tag should only include changes relevant to serialization

Example commit: JsonNet: 1.0.0-alpha5