Autotagging and versioning for C# app with AppVeyor and Git

I needed a way to auto-tag my release when I’m modifying the AssemblyInfo.cs file in my C# application.

I created a pre-commit, post-commit and simple version.sh file to do so:

The version.sh contain which file need to be monitored. When this file is changed and part of the commit, the new version will be extracted. (please be sure you only have one

[assembly: AssemblyVersion("3.4.2.*")]

in your Assembly file). The version need to be specified as shown (X.X.X.X) where the last X is the build version (that I let Visual Studio manage and don’t consider relevant for a tag).

pre-commit

Check for version change, if it’s the case, change also the version the appveyor.yml file and add it to the commit.

post-commit

If the version change, add a new tag using the commit message and the version extracted from the AssemblyInfo.cs file.

 

Credits to entreprehero for the image

Antoine Aflalo Written by:

2 Comments

  1. andreas bauer
    12th April 2016
    Reply

    Does this mean this works only on linux? Or are this scripts run on github .com gruns on linux they are running there…

Leave a Reply to Antoine Aflalo Cancel reply

Your email address will not be published. Required fields are marked *