I am trying to understand trunk based development with semantic versioning for a Python project. Has anyone had any experience of adopting a trunk based development with semantic versioning for packages?
I store the semantic version in
On the trunk (main)
version.py:__version__ would be
1.0.0-SNAPSHOT and on the CI server each build would append the build number, e.g.
18.104.22.1684-SNAPSHOT. A change log would initially be empty for the semantic version number on the trunk (main).
When ready to release, a release branch would be created
release-1.0.x and any bug fixes, would be cherry-picked from trunk(main). A gitlab CI job would still run tests for commits on branches named
release-. The release branch may be tagged, e.g.
1.0.2 etc. until the release stabilises. This would bump the version number in
The change log could be finalised on the release-branch, however this would mean that it would have to be merged back to trunk (main). File
version.py would also presumably have to be merged back to trunk after it is has been bumped following hot fixes on the release branch. Is a merge from release to trunk(main) acceptable in trunk based development for change log and version files only?
The problem would be if a new release, e.g.
1.1.0-SNAPSHOT, was then prepared for, while release branch
1.0.x was still active. Then the version number would be out of synch between trunk and release.
How is this managed with trunk based development approach?