I have a project hosted on Github, and I would like to set it up such that the project has a version number, and the version number is only updated when the master branch is updated, either directly by a push, or via a merged Pull Request.
Is there any way to let git/Bitbucket update a specific number in a specific file? It is OK if there is just a dedicated file for this purpose, containing a single number. I assume I will be able to write code that upon asking what version my project is using, will simply read that file. My project is a C# Web API project, although I'm not sure that matters much.