From 5dc5c750e0c804f5e94c95807624af2b64b33f49 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 14 Sep 2023 15:34:32 -0500 Subject: [PATCH 1/2] Make previous version optional in release_pull_request.bash This also adds some documentation Signed-off-by: Addisu Z. Taddese --- source-repo-scripts/release_pull_request.bash | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/source-repo-scripts/release_pull_request.bash b/source-repo-scripts/release_pull_request.bash index 2f700ace4..4400267b8 100755 --- a/source-repo-scripts/release_pull_request.bash +++ b/source-repo-scripts/release_pull_request.bash @@ -14,28 +14,33 @@ # limitations under the License. # -# The script will open a pull request for a forward port. +# The script will open a pull request a release PR (actually opens the PR page in your web browser) # # Requires the 'gh' CLI to be installed. # # Usage: -# $ ./merge_forward_pull_request.bash +# $ ./release_pull_request.bash # -# For example, to merge `ign-rendering6` forward to `main`: +# For example, to release `gz-rendering7` 7.1.0 # -# ./merge_forward_pull_request.bash ign-rendering6 main +# ./release_pull_request.bash 7.1.0 gz-rendering7 +# +# Make sure you've checked out the branch that has the changes for the release +# and that the changes have been pushed. VERSION=${1} TO_BRANCH=${2} -PREV_VER=${3} -if [[ $# -ne 3 ]]; then - echo "./release_pull_request.bash " +if [[ $# -ne 2 ]]; then + echo "./release_pull_request.bash " exit 1 fi set -e +git fetch --tags +PREV_VER=$(git describe --tags --abbrev=0 | sed 's/.*_//') + LOCAL_BRANCH=$(git rev-parse --abbrev-ref HEAD) REMOTE_BRANCH=$(git rev-parse --abbrev-ref HEAD@{upstream}) REMOTE=${REMOTE_BRANCH/\/$LOCAL_BRANCH/} @@ -44,7 +49,10 @@ CURRENT_BRANCH="${REMOTE}:${LOCAL_BRANCH}" ORIGIN_URL=$(git remote get-url origin) ORIGIN_ORG_REPO=$(echo ${ORIGIN_URL} | sed -e 's@.*github\.com.@@' | sed -e 's/\.git//g') -PREV_TAG=$(git tag | grep "_${PREV_VER}$") +if [[ $PREV_VER == $VERSION ]] then + echo "Previous version ($PREV_VER) and current ($VERSION) version should be different" + exit 1 +fi TITLE="Prepare for ${VERSION} Release" From 477f2fa714a60840a0d24d778f088c51b377ac27 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 2 Nov 2023 14:17:01 +0100 Subject: [PATCH 2/2] Update source-repo-scripts/release_pull_request.bash Co-authored-by: Steve Peters --- source-repo-scripts/release_pull_request.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-repo-scripts/release_pull_request.bash b/source-repo-scripts/release_pull_request.bash index 4400267b8..2f32f207a 100755 --- a/source-repo-scripts/release_pull_request.bash +++ b/source-repo-scripts/release_pull_request.bash @@ -14,7 +14,7 @@ # limitations under the License. # -# The script will open a pull request a release PR (actually opens the PR page in your web browser) +# The script will open a pull request for a release PR (actually opens the PR page in your web browser) # # Requires the 'gh' CLI to be installed. #