Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stable branch to release.sh #2236

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ prerelease=false
echo $version | grep '.*rc.*' >/dev/null
[ $? -eq 0 ] && prerelease=true

stable_branch=stable

ref=$(git symbolic-ref HEAD)
[ $? -ne 0 ] && echo 'Error: Failed current branch' && exit 1
branch=${ref##*/}
Expand Down Expand Up @@ -133,6 +135,20 @@ echo 'Pushing tag...'
[ -z "$DRY_RUN" ] && git push $remote $version >/dev/null || true
[ $? -ne 0 ] && echo -e '\nError: Failed to push tag' && exit 1

# Point stable branch to latest version tag
echo 'Updating stable branch...'
if [ -z "$DRY_RUN" ]
then
# Check if stable branch does not exist
git rev-list --max-count=1 $stable_branch >/dev/null 2>/dev/null
[ $? -ne 0 ] && echo -e '\nWarning: Creating stable branch for a first time' && git branch $stable_branch
# Fast forward and push stable branch
git checkout $stable_branch
git merge --ff $version
git push $remote $stable_branch >/dev/null || true
git checkout $branch
fi

# Create github release
body() {
cat <<EOF
Expand Down