Skip to content

Commit

Permalink
chore: make sure versioned files are up to date, omit the -next suffix
Browse files Browse the repository at this point in the history
Change-Id: Ic73ebf54c30cc9e9819ee912935434c5c77ca185
Signed-off-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
nickboldt committed Sep 18, 2023
1 parent b2c8695 commit 640ef89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function update_versioned_files() {
local VER=$1
OLD_VER=$(cat VERSION); OLD_VER=${OLD_VER%-*}
for file in README.md cmd/configbump/main.go; do
sed_in_place -e "s@${OLD_VER}@${VER}@g" $file
sed_in_place -r -e "s@${OLD_VER}@${VER}@g" $file
done
echo "${VER}-next" > VERSION
echo "${VER}" > VERSION
}

bump_version () {
Expand Down Expand Up @@ -143,10 +143,10 @@ git checkout "${BASEBRANCH}"
if [[ "${BASEBRANCH}" != "${BRANCH}" ]]; then
# bump the y digit, if it is a major release
[[ $BRANCH =~ ^([0-9]+)\.([0-9]+)\.x ]] && BASE=${BASH_REMATCH[1]}; NEXT=${BASH_REMATCH[2]}; (( NEXT=NEXT+1 )) # for BRANCH=7.10.x, get BASE=7, NEXT=11
NEXT_VERSION_Y="${BASE}.${NEXT}.0-next"
NEXT_VERSION_Y="${BASE}.${NEXT}.0"
bump_version "${NEXT_VERSION_Y}" "${BASEBRANCH}"
fi
# bump the z digit
[[ $VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]] && BASE="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"; NEXT="${BASH_REMATCH[3]}"; (( NEXT=NEXT+1 )) # for VERSION=7.7.1, get BASE=7.7, NEXT=2
NEXT_VERSION_Z="${BASE}.${NEXT}-next"
NEXT_VERSION_Z="${BASE}.${NEXT}"
bump_version "${NEXT_VERSION_Z}" "${BRANCH}"

0 comments on commit 640ef89

Please sign in to comment.