Hacker News new | ask | show | jobs
by js2 1489 days ago
My repos have a `make_release {bump | tag}` script for this purpose. The repos have both a develop and a main branch. The develop branch always has the next version with a `-dev` suffix. e.g. `4.6.1-dev`.

Then, running `make_release tag`:

1. Sets the version to `4.6.1`, commits it, tags it.

2. Sets the version to `4.6.2-dev`, commits it.

I then merge the 4.6.1 tag to main and push main, develop, and the 4.6.1 tag to the repo.

If development calls for a minor or major release, that's what the `bump` option is for. It prompts for which part of the version string should be incremented and creates a commit doing just that.

Setting the version usually involves touching a couple of files. e.g. a source code constant and a podspec or some other metadata file. The script really helps preventing any mistakes.