Skip to content

Commit 56b1b6f

Browse files
committed
Add script to finish stable releases
1 parent a34e837 commit 56b1b6f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

scripts/finish-stable-release.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -e
5+
6+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
7+
if [[ "${CURRENT_BRANCH}" != "release-next" ]]; then
8+
echo "Error: Script must be run from the 'release-next' branch."
9+
exit 1
10+
fi
11+
12+
if [[ -n $(git status --porcelain) ]]; then
13+
echo "Error: Your git working directory is not clean. Please commit or stash your changes."
14+
exit 1
15+
fi
16+
17+
git pull
18+
git checkout main
19+
git pull
20+
git merge release-next --no-edit
21+
22+
if [[ -n $(git status --porcelain) ]]; then
23+
echo "Error: Your git working directory is not clean after the merge to main."
24+
exit 1
25+
fi
26+
27+
git push
28+
29+
git checkout dev
30+
git pull
31+
git merge release-next --no-edit
32+
33+
if [[ -n $(git status --porcelain) ]]; then
34+
echo "Error: Your git working directory is not clean after the merge to dev."
35+
exit 1
36+
fi
37+
38+
git push
39+
40+
set +e
41+
set +x

0 commit comments

Comments
 (0)