Skip to content

Commit ecab819

Browse files
committed
feat(scripts): remove testing branch creation, add push to release repo
1 parent e7d56f0 commit ecab819

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

scripts/prepare-release.sh

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

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.
45
# 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.
57
# For security reasons, the script can only run locally as we do not have a shared GitHub token with the necessary permissions.
68
# If you want the script to automatically create a pull request to bump beta version, install and set up gh tool:
79
# brew install gh
@@ -32,8 +34,6 @@ CURRENT_VERSION_MONTH=$(echo "$CURRENT_VERSION" | cut -d '.' -f 2)
3234

3335
RELEASE_MONTH="$CURRENT_VERSION_YEAR.$CURRENT_VERSION_MONTH"
3436
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"
3737
if [ "$CURRENT_VERSION_MONTH" == 12 ]; then
3838
NEXT_VERSION_YEAR="$((CURRENT_VERSION_YEAR+1))"
3939
NEXT_VERSION_MONTH=1
@@ -53,19 +53,12 @@ git add $FILEPATH
5353
git commit -m "chore(suite): bump Suite version to $RELEASE_VERSION [RELEASE ONLY]"
5454
git push --set-upstream $ORIGIN "$(git branch --show-current)"
5555

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
6962

7063
echo Bumping beta version to "$BETA_VERSION"...
7164
git switch -c chore/bump-suite-version-"$BETA_VERSION" $MAIN_BRANCH

0 commit comments

Comments
 (0)