If you are a friend of git flow and use tagging in your release flow, I'm sure you struggle with manually determining the latest git tag and then creating a matching release branch is a tedious task. What if there was a way to automate this process to save time, effort and errors?
This script automates:
- 🥇 Release tagging
- 🥇 Matching release branch creation for major and minor releases
- 🥇 prevent you for create tags with no relevant changes
The shell script:
- 🎂 Provieds an init action,
- 🎊 Fetch the latest Git tag,
- 🚑 Prompts the user to increase the major, minor, or patch version,
- 📽️ Fetch the last tag depending on the user's choice,
- 👾 Check if there a exiting release branch like "release/v1.1.0" based on the new tag,
- 🥇 Validate changes in the release branch, before a new tag will pushed,
composer require derpixler/git-tag-release-automator
./vendor/bin/git-tag-release-automator
❯ ./vendor/bin/git-tag-release-automator
Latest tag: v1.1.0
Which part of the version do you want to increase: Major (M), Minor (m) or Patch (p)? (M.m.p)
Your choice: p
Switched to existing release branch release/v1.1.0
Git tag v1.1.1 created and pushed successfully.
❯ ./vendor/bin/git-tag-release-automator
There are no existing tags. Do you want to create a tag starting with 'v'? (y/n)
Your choice: y
No "release/v1.0.0" found, create one? (y/n)
Your choice: y
Release branch "release/v1.0.0" created.
Now you can merge into "release/v1.0.0" and create tags.
❯ ./vendor/bin/git-tag-release-automator
Latest tag: v1.4.1
Which part of the version do you want to increase: Major (M), minor (m) or patch (p)?
Your choice: m
No "release/v1.5.0" found, create one? (y/n)
Your choice: y
Release branch "release/v1.5.0" created.
Now you can merge into "release/v1.5.0" and create tags.
❯ ./vendor/bin/git-tag-release-automator
Latest tag: v1.4.1
Which part of the version do you want to increase: Major (M), minor (m) or patch (p)?
Your choice: m
Git tag v1.5.0 created and pushed successfully.
❯ ./vendor/bin/git-tag-release-automator
Latest tag: v1.5.0
Which part of the version do you want to increase: Major (M), minor (m) or patch (p)?
Your choice: p
Git tag v1.5.1 created and pushed successfully.
- Name: René Reimann
- Email: [email protected]
- LinkedIn: https://www.linkedin.com/in/rene-reimann-18b50a127
- GitHub: https://github.com/derpixler