This bash script automates the process of creating a new Github release with an incremented semver version. The script uses the gh
command line tool to grab the latest release version, increments the minor version, and then creates a new release with the newly generated semver tag.
This script assumes that your Github repository is using semver versioning and that your latest release version is in the format vX.Y.Z
. If your repository is using a different versioning scheme, or if the latest release version is not in the expected format, this script may not work as intended.
Before running this script, you must have the following installed on your system:
gh
command line toolawk
command line tool
- Open a terminal window and navigate to the directory containing the script.
- Add the script to your system's path by running the command
ln -s /path/to/release.sh /usr/local/bin/release
. - In the terminal, run the script by typing
release
followed by the branch name (if different from "main").
For example, to create a new release on the "my-feature-branch" branch, run the command:
release my-feature-branch
Note that the release.sh
file must be executable and located in a directory that is included in your system's $PATH
environment variable for the release
command to work. By running the ln -s
command as shown in step 4, you can link the script to the /usr/local/bin
directory, which is a common location for user-installed scripts.