I am looking for a good process to control the version number of my project when my main branch has GitHub branch protection.
In an ideal world, when you merged with the release branch, your continuous integration server ran its tests, and then automatically increased the version number of your project and returned back to your SCM system.
However, with branch protection, you cannot commit your branch without a Pull request, so you have catch-22 where your CI server cannot click on your secure branch when trying to update the version number.
I can come up with several works, all of which are optimal:
- Lift the system so that your CI server makes a PR to update the version. I'm not sure that you can even do this with GitHub, but even so, two Pull requests are generated for each "real" PR, which is inconvenient.
- Remove branch protection - now anyone can push something to the branches, and you must manage your developers using the manual process.
- Update the version manually before requesting a migration. this is slightly better than # 2, but it opens the door for developers to make mistakes when choosing a new version number or merging the desired version number with the wrong branch.
I hope there are other options that I have not thought about.
We use Javascript and npm, but I believe that the problem is agnostic of the language, of course, the same problem will exist with Java and Maven, for example.
github versioning
Jbcp
source share