Reputation: 27390
I'm looking for a solution for assembly versioning as part of Continuous Integration using TFS2015 and Git as a source control.
The tricky part is that I want to increment assembly version only when the project has changed since last build.
Previously I was using TFVC, which provides API for last changeset number for a specified directory and I created powershell, that updates the assemblyversion with current changeset number only when the sources in particular project has changed since last release. I also needed to store the changeset number somewhere on the build server so I know what versions has been released.
Upvotes: 1
Views: 476
Reputation: 19021
Have you looked at GitVersion:
https://github.com/GitTools/GitVersion
It does the work of calculating a Semantic Version number for the current state of your application, based on the history of your git repository. It knows when to increment the various portions of the build number, and you can then use the asserted version number to then package your application in nuget packages, etc.
Full disclosure: I am a maintainer on this project;.
Upvotes: 1