...
We have a structure of Git branches similar to this:
...
Releases are done only from the 'stable' branch once QA gives the greenlight.
...
The script that was prepared is simple, about 130 lines. The operation of the script is roughly described in the following diagram:
...
This diagram applies to minor releases. The merge request is still a manual step, so it can be reviewed if needed before the automate steps take control. For hotfix releases, there is no merge request involved, but the staging branch is still kept up-to-date at the end.
...