Skip to content

Commit 9ada9cc

Browse files
committed
update script
1 parent acae907 commit 9ada9cc

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

scripts/change-version-to

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ build_docker() {
3434

3535
on_success() {
3636
local VERSION=$1
37+
local BRANCHNAME=$2
3738
local SUFFIX=""
3839

39-
if [ ! -z "$2" ]; then
40-
SUFFIX=$2
40+
if [ ! -z "$3" ]; then
41+
SUFFIX=$3
4142
fi
4243

4344
local DEFAULT_MSG="Update CLI version to $VERSION$SUFFIX"
@@ -58,11 +59,11 @@ on_success() {
5859
git tag -a $VERSION$SUFFIX -m "version $VERSION$SUFFIX"
5960

6061
echo "Pushing to Github"
61-
git push origin $VERSION$SUFFIX
62+
git push origin $BRANCHNAME
6263

6364
echo "Generating release $VERSION$SUFFIX"
6465
curl --data "{\"tag_name\": \"$VERSION$SUFFIX\",
65-
\"target_commitish\": \"master\",
66+
\"target_commitish\": \"$BRANCHNAME\",
6667
\"name\": \"v$VERSION$SUFFIX\",
6768
\"body\": \"Release of version $VERSION$SUFFIX\",
6869
\"draft\": false,
@@ -84,43 +85,45 @@ if [ $# -eq 0 ]; then
8485
fi
8586

8687
VERSION=$1
87-
88+
BRANCHNAME=""
8889
## STANDARD VERSION
8990

9091
if [[ $VERSION == 1.3.* ]]; then
91-
switch_to_branch "1.3.x"
92+
BRANCHNAME="1.3.x"
9293
elif [[ $VERSION == 1.4.* ]]; then
93-
switch_to_branch "1.4.x"
94+
BRANCHNAME="1.4.x"
9495
elif [[ $VERSION == 1.5.* ]]; then
95-
switch_to_branch "master"
96+
BRANCHNAME="master"
9697
fi
9798

99+
switch_to_branch $BRANCHNAME
98100
replace_files_with $VERSION
99101
build_docker $VERSION
100102
DOCKER_BUILD_RESULT=$?
101103

102104
if [ $DOCKER_BUILD_RESULT -eq 0 ]; then
103-
on_success $VERSION
105+
on_success $VERSION $BRANCHNAME
104106
else
105107
on_error
106108
fi
107109

108110
## CHROMIUM VERSION
109111

110112
if [[ $VERSION == 1.3.* ]]; then
111-
switch_to_branch "1.3.x-chromium"
113+
BRANCHNAME="1.3.x-chromium"
112114
elif [[ $VERSION == 1.4.* ]]; then
113-
switch_to_branch "1.4.x-chromium"
115+
BRANCHNAME="1.4.x-chromium"
114116
elif [[ $VERSION == 1.5.* ]]; then
115-
switch_to_branch "1.5.x-chromium"
117+
BRANCHNAME="1.5.x-chromium"
116118
fi
117119

120+
switch_to_branch $BRANCHNAME
118121
replace_files_with $VERSION "-chromium"
119122
build_docker $VERSION "-chromium"
120123
DOCKER_BUILD_RESULT=$?
121124

122125
if [ $DOCKER_BUILD_RESULT -eq 0 ]; then
123-
on_success $VERSION "-chromium"
126+
on_success $VERSION $BRANCHNAME "-chromium"
124127
else
125128
on_error
126129
fi

0 commit comments

Comments
 (0)