On the automating build numbers side, `git describe` is really handy. By default it's {last annotated tag name}-{commit count since}-g{hash prefix of most recent commit}. (There's an optional --dirty flag to include a marker when the repo isn't clean status. There's options to control which tags are eligible for the first part.) It's basically a full build version identifier from a single command. Generally the only things to do to make it 'semver compliant' is to swap the second to last dash with plus and the last dash with a dot, depending on how you expect to use it with semver. (v1.2.3-18-g123456 => v1.2.3+18.g123456)
Bonus is that almost every git command that takes a "commitish" descriptor (git switch -c, git log, etc) can work with a `git describe` output as "commitish" name for a branch state.
Bonus is that almost every git command that takes a "commitish" descriptor (git switch -c, git log, etc) can work with a `git describe` output as "commitish" name for a branch state.