From a3bbcf98c3b7fe45720bee5ace9fa07ae4ce5b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 8 May 2024 10:34:50 +0200 Subject: [PATCH] Write release version to `src/VERSION` in `update-changelog` and `release-update` (#14547) --- scripts/release-update.sh | 5 +++++ scripts/update-changelog.sh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/scripts/release-update.sh b/scripts/release-update.sh index ec9c9570636c..d705ce357f3e 100755 --- a/scripts/release-update.sh +++ b/scripts/release-update.sh @@ -11,6 +11,11 @@ set -eu CRYSTAL_VERSION=$1 +# Write dev version for next minor release into src/VERSION +minor_branch="${CRYSTAL_VERSION%.*}" +next_minor="$((${minor_branch#*.} + 1))" +echo "${CRYSTAL_VERSION%%.*}.${next_minor}.0-dev" > src/VERSION + # Edit PREVIOUS_CRYSTAL_BASE_URL in .circleci/config.yml sed -i -E "s|[0-9.]+/crystal-[0-9.]+-[0-9]|$CRYSTAL_VERSION/crystal-$CRYSTAL_VERSION-1|g" .circleci/config.yml diff --git a/scripts/update-changelog.sh b/scripts/update-changelog.sh index 777f65a60e3d..3d044eb79062 100755 --- a/scripts/update-changelog.sh +++ b/scripts/update-changelog.sh @@ -40,6 +40,10 @@ scripts/github-changelog.cr $VERSION > $current_changelog echo "Switching to branch $branch" git switch $branch 2>/dev/null || git switch -c $branch; +# Write release version into src/VERSION +echo "${VERSION}" > src/VERSION +git add src/VERSION + if grep --silent -E "^## \[$VERSION\]" CHANGELOG.md; then echo "Replacing section in CHANGELOG"