name: create-next-version-branch
Automate the creation of development branches and GitHub Release for a new GROWI version.
The argument $ARGUMENTS must be a branch name in the format dev/{major}.{minor}.x (e.g., dev/7.5.x).
$ARGUMENTS to extract {major} and {minor} from the dev/{major}.{minor}.x patterndev/{number}.{number}.xDEV_BRANCH: dev/{major}.{minor}.xRELEASE_BRANCH: release/{major}.{minor}.xTAG_NAME: v{major}.{minor}.x-baseRELEASE_TITLE: v{major}.{minor}.x Base ReleaseCreate and push DEV_BRANCH from the current HEAD:
git checkout -b {DEV_BRANCH}
git push origin {DEV_BRANCH}
Create a GitHub Release using gh release create:
gh release create {TAG_NAME} \
--target {DEV_BRANCH} \
--title "{RELEASE_TITLE}" \
--notes "The base release for release-drafter to avoid \`Error: GraphQL Rate Limit Exceeded\`
https://github.com/release-drafter/release-drafter/issues/1018" \
--latest=false \
--prerelease=false
--latest=false: Do NOT set as latest release--prerelease=false: Do NOT set as pre-releaseRun the following command and confirm that targetCommitish equals DEV_BRANCH:
gh release view {TAG_NAME} --json targetCommitish
If targetCommitish does not match, display an error and stop
From the same commit (still on DEV_BRANCH), create and push RELEASE_BRANCH:
git checkout -b {RELEASE_BRANCH}
git push origin {RELEASE_BRANCH}
Display a summary of all created resources:
Created:
- Branch: {DEV_BRANCH} (pushed to origin)
- Branch: {RELEASE_BRANCH} (pushed to origin)
- GitHub Release: {RELEASE_TITLE} (tag: {TAG_NAME}, target: {DEV_BRANCH})
DEV_BRANCH already exists on the remote, warn the user and ask how to proceedRELEASE_BRANCH already exists on the remote, warn the user and ask how to proceedTAG_NAME already exists, warn the user and ask how to proceedgh CLI is not authenticated, instruct the user to run gh auth login