Skip to content

Commit

Permalink
Improve update-version.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Aug 7, 2024
1 parent f14922f commit 9298a00
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
## Usage
# bash update-version.sh <new_version>

# Workaround for MacOS where BSD sed doesn't support the flags
# Install MacOS gsed with `brew install gnu-sed`
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) sedCmd=sed;;
Darwin*) sedCmd=gsed;;
*) echo "Unknown OS"; exit 1;;
esac


# Format is YY.MM.PP - no leading 'v' or trailing 'a'
NEXT_FULL_TAG=$1

Expand All @@ -28,7 +18,7 @@ CURRENT_MINOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}')
CURRENT_PATCH=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}' | tr -d 'a')
CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}

#Get <major>.<minor> for next version
# Get <major>.<minor> for next version
NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}')
NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
Expand All @@ -37,7 +27,7 @@ echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
$sedCmd -i.bak ''"$1"'' $2 && rm -f ${2}.bak
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

sed_runner "/RAPIDS_VER=/ s/[0-9][0-9].[0-9][0-9]/${NEXT_SHORT_TAG}/" ci/conda-pack.sh
Expand Down

0 comments on commit 9298a00

Please sign in to comment.