Skip to content

Commit 42803ca

Browse files
authored
Let the release script base the on other branches in addition to master (#7399)
1 parent 996e08b commit 42803ca

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

scripts/interactive-release.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ check-and-open-plutus-pr() {
115115

116116

117117
open-plutus-pr() {
118+
local BASE_BRANCH=$(compute-base-branch)
118119
local PR_BRANCH="release/$VERSION"
120+
tell "I will stash your changes and create a new branch $PR_BRANCH from $BASE_BRANCH"
119121

120-
tell "I will stash your changes and create a new branch $PR_BRANCH from master"
121-
122+
exit 1
122123
git stash
124+
git fetch --all
123125
git branch -D $PR_BRANCH || true
124126
git checkout -b $PR_BRANCH || true
125-
git pull --rebase origin master
127+
git pull --rebase origin $BASE_BRANCH
126128

127129
local RELEASE_PACKAGES=(
128130
"plutus-core"
@@ -159,7 +161,7 @@ open-plutus-pr() {
159161
--body "Release $VERSION" \
160162
--label "No Changelog Required" \
161163
--head $PR_BRANCH \
162-
--base master \
164+
--base $BASE_BRANCH \
163165
| grep "https://")
164166

165167
tell "The release PR has been created at $PR_URL"
@@ -394,6 +396,18 @@ detect-old-version() {
394396
}
395397

396398

399+
compute-base-branch() {
400+
# If we are releasing a major.minor.0.0 version, we branch off master
401+
# Otherwise, we branch off the latest major.minor.0.0 release branch
402+
IFS='.' read -r MAJOR MINOR PATCH BUILD <<< $VERSION
403+
if [[ $PATCH -eq 0 && $BUILD -eq 0 ]]; then
404+
echo "master"
405+
else
406+
echo "release/$MAJOR.$MINOR.0.0"
407+
fi
408+
}
409+
410+
397411
compute-new-version() {
398412
local OLD_VERSION=$1
399413
IFS='.' read -r MAJOR MINOR PATCH BUILD <<< $OLD_VERSION

0 commit comments

Comments
 (0)