ProbabilisticDataStructures icon indicating copy to clipboard operation
ProbabilisticDataStructures copied to clipboard

Easy release management to nuget

Open mynkow opened this issue 6 years ago • 1 comments

The purpose of this PR is to make new releases to nuget trivial.

Goals:

  • you control when a new version is released
  • use semver for versioning
  • you should be able to do a release without leaving the dev environment ex: git push can do a release
  • support for prerelease packages

Releasing a patch version:

  1. Find the release notes file and add a new entry which has increased patch version. ex: Hot fix
#### 1.0.2 - 05.06.2018
* Hot fix

#### 1.0.1 - 05.06.2018
* Initial release
  1. git push

The result of these two simple steps is:

  • build triggered at AppVeyor which published a new nuget package to nuget.org because of the release notes we entered
  • nuget package is available as soon as nuget.org does its slow validations and indexing. Other providers are also supported but I will skip it for now
  • the commit which did the release is marked with a tag automatically => https://github.com/mynkow/ProbabilisticDataStructures/releases/tag/ProbabilisticDataStructures%401.0.1

Releasing a major or minor version:

  1. Create a branch with the following name: release-2.0.0 or release-1.1.0. Basically you fill the desired semver with a release- prefix.
  2. Do your magic development in that branch. If you want to test this in the wild just create a release notes. The release notes bellow produces two prerelease nuget packages (not at once of course)
#### 2.0.0-beta0002 - 11.06.2018
* Testing breaking changes

#### 2.0.0-beta0001 - 10.06.2018
* Testing new features

#### 1.0.2 - 05.06.2018
* Hot fix

#### 1.0.1 - 05.06.2018
* Initial release
  • the commit which did the release is marked with a tag automatically
  1. When you want to do a stable release you need to do a merge commit and edit the release notes like this:
#### 2.0.0 - 21.06.2018
* Testing breaking changes
* Testing new features

#### 1.0.2 - 05.06.2018
* Hot fix

#### 1.0.1 - 05.06.2018
* Initial release

How it works?

  1. a small script called Nyx is downloaded. It brings Cake + gitversion locally inside the repo. To make everything working you need to follow some simple conventions like:
  • project must be inside a src folder
  • project name and releasenotes.rn.md file name should match
  • git version needs a prefix with the project name to discover tags and to calculate proper versions
  • creating the release branches is a default behavior form gitversion
  1. A Cake task is invoked to build the project
  2. If AppVeyor has a nugetkey in EnvVar AND release notes are edited with next version AND that version is equal to the version calculated by gitversion then Nyx will just push the nuget package

TODO

  • Tests are not executed as part of the build

NOTES:

@mattlorimor if you like this flow we need to do the following

  • figure out nugetpackage name. If it is ProbabilisticDataStructures I will make you an owner
  • I will help you to setup AppVeyor. It takes 5 min with the left hand (if you are right handed)

Software is fun! Happy coding!

mynkow avatar Jun 05 '18 20:06 mynkow

@mynkow

I apologize for taking sooooooo incredibly long to even look at this.

It looks pretty good to me. Releasing to nuget is new to me, so help with it is greatly appreciated.

ProbabilisticDataStructures does make the most sense as a name to me. I can perform the necessary steps on AppVeyor once I know what they are.

Again, so sorry about taking so long to get to this!

mattlorimor avatar Dec 06 '18 06:12 mattlorimor