1
1
#! /usr/bin/env bash
2
2
3
- # Prepare release and testing branches before Suite freeze, bump beta version, and create a pull request.
3
+ # Run this script to freeze development of the next SUite version.
4
+ # Prepare release branch, push it to the release repository, bump beta version, and create a pull request.
4
5
# You need to have the permission to push to pretected branches in order to execute the script correctly.
6
+ # You need to have the permission to push to the release repository, otherwise that step is not performed.
5
7
# For security reasons, the script can only run locally as we do not have a shared GitHub token with the necessary permissions.
6
8
# If you want the script to automatically create a pull request to bump beta version, install and set up gh tool:
7
9
# brew install gh
@@ -32,8 +34,6 @@ CURRENT_VERSION_MONTH=$(echo "$CURRENT_VERSION" | cut -d '.' -f 2)
32
34
33
35
RELEASE_MONTH=" $CURRENT_VERSION_YEAR .$CURRENT_VERSION_MONTH "
34
36
RELEASE_VERSION=" $RELEASE_MONTH .1"
35
- TEST_UPGRADE_VERSION=" $(( CURRENT_VERSION_YEAR+ 10 )) .$CURRENT_VERSION_MONTH .1"
36
- TEST_DOWNGRADE_VERSION=" 0.$CURRENT_VERSION_YEAR .$CURRENT_VERSION_MONTH "
37
37
if [ " $CURRENT_VERSION_MONTH " == 12 ]; then
38
38
NEXT_VERSION_YEAR=" $(( CURRENT_VERSION_YEAR+ 1 )) "
39
39
NEXT_VERSION_MONTH=1
@@ -53,19 +53,12 @@ git add $FILEPATH
53
53
git commit -m " chore(suite): bump Suite version to $RELEASE_VERSION [RELEASE ONLY]"
54
54
git push --set-upstream $ORIGIN " $( git branch --show-current) "
55
55
56
- echo Creating testing branch " $TEST_UPGRADE_VERSION " ...
57
- git switch -c release/test-" $TEST_UPGRADE_VERSION " $MAIN_BRANCH
58
- sed -i ' ' -E " s/(\" suiteVersion\" : \" )[^\" ]*(\" .*$)/\1$TEST_UPGRADE_VERSION \2/" $FILEPATH
59
- git add $FILEPATH
60
- git commit -m " chore(suite): set Suite version to $TEST_UPGRADE_VERSION for testing [RELEASE ONLY]"
61
- git push --set-upstream $ORIGIN " $( git branch --show-current) "
62
-
63
- echo Creating testing branch " $TEST_DOWNGRADE_VERSION " ...
64
- git switch -c release/test-" $TEST_DOWNGRADE_VERSION " $MAIN_BRANCH
65
- sed -i ' ' -E " s/(\" suiteVersion\" : \" )[^\" ]*(\" .*$)/\1$TEST_DOWNGRADE_VERSION \2/" $FILEPATH
66
- git add $FILEPATH
67
- git commit -m " chore(suite): set Suite version to $TEST_DOWNGRADE_VERSION for testing [RELEASE ONLY]"
68
- git push --set-upstream $ORIGIN " $( git branch --show-current) "
56
+ echo Pushing to the release repository...
57
+ if ! OUTPUT=$( git push -f https://github.com/trezor/trezor-suite-release.git HEAD 2>&1 ) ; then
58
+ tput setaf 3
59
+ echo -e " Could not push to the release repository.\n${OUTPUT} "
60
+ tput sgr0
61
+ fi
69
62
70
63
echo Bumping beta version to " $BETA_VERSION " ...
71
64
git switch -c chore/bump-suite-version-" $BETA_VERSION " $MAIN_BRANCH
0 commit comments