rehansaeed.github.io
rehansaeed.github.io copied to clipboard
[Comment] The Easiest Way to Version NuGet Packages
https://rehansaeed.com/the-easiest-way-to-version-nuget-packages/
Everything in this article was interesting to me and a good read, I have to take issue with the one paragraph because I think you probably werent approaching it correctly at the time.
I've also generated version numbers based on the automatically incrementing continuous integration (CI) build number but how do you turn one number into three? Well in my case I hard coded a major or minor version and used the CI build number for the patch version. Using this method lets you tie a package version back to a CI build and through inference a Git commit but it's less than ideal.
You wouldnt make one number into three. If you are storing version numbers in source control then you are just creating churn for yourself. Generally its only when you are ready to make a release that you will know if there are breaking changes, non-breaking features, and/or patches, so its only then when you would increment the major/minor as a simple manual activity in the build definition.
CI builds are for making sure feature or topic branches are going to compile and test properly if merged to master/main. They dont create deployable artifacts because they wont ever come from the actual master or release branches.
For any of the approaches mentioned, whenever you create artifacts from a build pipeline the repo needs to be tagged with the version/build number. Theres no inference at any point once you do that, and no need to have such unfriendly version numbers with all the commit hashes, etc.