Previously we calculated the build number to use by counting git commits.
This can be problematic when uploading builds from multiple branches, as the commit count is branch-dependent and so the build numbers can go down or even collide.
This version introduces an alternative --increment-tag
option.
With this option set to true, we instead search the repo for existing build tags in the format vX.Y{.Z}-BUILD-PLATFORM
.
We extract all tags for the platform we're building for, and find the one with the highest build number.
We then calculate the new build number by adding 1 to the highest build we found.