This project has moved and is read-only. For the latest updates, please go here.

Implement automatic semantic versioning?

Aug 4, 2014 at 12:18 PM
Hi, first of all thanks for this great script, it saved me a lot of days of coding.
But I'd like to ask you for one new simple feature:

In my project folder I'd like to have three Powershell script files named:
PushNewMajorVersion.ps1, PushNewMinorVersion.ps1 and PushNewPatchVersion.ps1

The idea for this is to have script, that loads target nuspec file and finds the next package version for either Major/Minor/Patch update, according to semantic versioning, builds nuget packge with this version and push it to our private repository.

This way any collegue can just run one of three scripts for publishing new NuGet package based on the changes in the new version.
Aug 6, 2014 at 10:36 PM
I might implement this if enough people ask for it. Right now thought it's easy to just open up the Config.ps1 and adjust the $versionNumber variable and then run the RunMeToUploadNuGetPackage.cmd script.

If you want to go ahead and create those scripts yourself though, it would be pretty simple. Just parse the $versionNumber variable's value from the Config.ps1 file, increment the desired digit, and then write the value back to Config.ps1 and call the RunMeToUploadNuGetPackage.cmd script. Pretty straight forward. The hardest part would be parsing out the version number, but you could just split on the period (.) to parse out the major, minor, and patch numbers.
Apr 13, 2017 at 7:05 AM
I think for this one I am going to say that you will need to create those 3 scripts yourself rather than them being included out-of-the-box. One of the main reasons for this is that while the version number is typically specified in an AssemblyInfo.cs file, it's possible that version number could be specified in some other file, and my scripts wouldn't have an easy way to determine for sure where that version is stored (unless I perhaps added that as an optional parameter in the Config.ps1 file). I'll think on this one a bit more.