In the last episode we grabbed the most recent release tag. That worked briliantly. To strip off the leading v in the v3.12.0 I used something like ${last_release_tag:1} which gives the correct value. Ran it through the decompose_version to break it apart, and boom! Got me a version number I can manipulate. That is actually primarily to remove micro version which effectively incidates emergency patches. Once we have our most recently released version we need to check to see if the release candidate branch exists.

Arthimatic addition isn’t something I do often in shell scripts. Lucky for me and you someone has already figured that out! For the minor version I can do something like $((release_minor + 1)) and it’s done. Next up is checking to see if the branches exist in the remote. Looks like someone found the local result. That is great, however I know the first complaint I’ll have is because it exists in the remotes but not hte locals. After some searching I found someone’s strange way of updating a branch. Turns out I need refs/remotes/origin/$BRANCH_NAME for the path for show-ref --verify.

Works like a charm. I think.