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

4.x: Add version check to release script #8481

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion etc/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2018, 2023 Oracle and/or its affiliates.
# Copyright (c) 2018, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -175,6 +175,14 @@ update_version(){
}

release_build(){

VERSION_FROM_BRANCH_NAME=$(git branch --show-current | cut -d- -f2)
if [ "${FULL_VERSION}" != "${VERSION_FROM_BRANCH_NAME}" ]; then
echo "ERROR: version derived from pom files (${FULL_VERSION}) does not match version used in branch name (${VERSION_FROM_BRANCH_NAME})."
echo "Failing release build"
exit 1
fi

# Do the release work in a branch
local GIT_BRANCH="release/${FULL_VERSION}"
git branch -D "${GIT_BRANCH}" > /dev/null 2>&1 || true
Expand Down