I want to add a version on my Laravel app automatically when some new code is pushed in any branch, preferably using the SemVer convention.
I have found packages such as https://github.com/antonioribeiro/version and though this does solve the issue of actually having a consistent versioning system, I cannot figure out a way to automate the process.
More specifically I would like the version to be bumped up whenever changes are pushed to the repo, and ideally this should have to be consistent across all branches.
Also I would like this solution to work across all developers in the team (so preferably no local config).
Currently I am using bitbucket for repo hosting and Laravel Forge for development.
I am thinking that Bitbucket Pipelines would be of use, but I cannot think how this would work. The main problem I have is that if I use bitbucket to up the version and then commit and push this automatically then that would trigger another circle of upping the version and so on.
So ideally I would like the following workflow:
- Changes are commited
- (App version bump) //This can happen here
- New changes are pushed
- (App version bump) //Or here
I might be overthinking it so has anyone been in the same situation/has any ideas?
Thanks