Skip to content

Commit a588989

Browse files
authored
Merge pull request #7875 from vector-im/feature/bma/releaseScript3
Release script update
2 parents 5606730 + 5ee3eef commit a588989

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

tools/release/releaseScript.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ fi
8787

8888
printf "OK\n"
8989

90+
printf "\n================================================================================\n"
91+
printf "Ensuring main and develop branches are up to date...\n"
92+
93+
git checkout main
94+
git pull
95+
git checkout develop
96+
git pull
97+
9098
printf "\n================================================================================\n"
9199
# Guessing version to propose a default version
92100
versionMajorCandidate=`grep "ext.versionMajor" ./vector-app/build.gradle | cut -d " " -f3`
@@ -103,14 +111,6 @@ versionMinor=`echo ${version} | cut -d "." -f2`
103111
versionPatch=`echo ${version} | cut -d "." -f3`
104112
nextPatchVersion=$((versionPatch + 2))
105113

106-
printf "\n================================================================================\n"
107-
printf "Ensuring main and develop branches are up to date...\n"
108-
109-
git checkout main
110-
git pull
111-
git checkout develop
112-
git pull
113-
114114
printf "\n================================================================================\n"
115115
printf "Starting the release ${version}\n"
116116
git flow release start ${version}
@@ -190,6 +190,9 @@ yes | towncrier build --version "v${version}"
190190
printf "\n================================================================================\n"
191191
read -p "Check the file CHANGES.md consistency. It's possible to reorder items (most important changes first) or change their section if relevant. Also an opportunity to fix some typo, or rewrite things. Do not commit your change. Press enter when it's done."
192192

193+
# Get the changes to use it to create the GitHub release
194+
changelogUrlEncoded=`git diff CHANGES.md | grep ^+ | tail -n +2 | cut -c2- | jq -sRr @uri | sed s/\(/%28/g | sed s/\)/%29/g`
195+
193196
printf "\n================================================================================\n"
194197
printf "Committing...\n"
195198
git commit -a -m "Changelog for version ${version}"
@@ -263,7 +266,7 @@ else
263266
fi
264267

265268
printf "\n================================================================================\n"
266-
printf "Wait for the GitHub action https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%3Amain to build the 'main' branch.\n"
269+
printf "Wait for the GitHub action https://github.com/vector-im/element-android/actions/workflows/build.yml?query=branch%%3Amain to build the 'main' branch.\n"
267270
read -p "After GHA is finished, please enter the artifact URL (for 'vector-gplay-release-unsigned'): " artifactUrl
268271

269272
printf "\n================================================================================\n"
@@ -354,10 +357,15 @@ apkPath="${targetPath}/vector-gplay-arm64-v8a-release-signed.apk"
354357
adb -d install ${apkPath}
355358

356359
read -p "Please run the APK on your phone to check that the upgrade went well (no init sync, etc.). Press enter when it's done."
357-
# TODO Get the block to copy from towncrier earlier (be may be edited by the release manager)?
358-
read -p "Create the release on gitHub from the tag https://github.com/vector-im/element-android/tags, copy paste the block from the file CHANGES.md. Press enter when it's done."
359360

360-
read -p "Add the 4 signed APKs to the GitHub release. They are located at ${targetPath}. Press enter when it's done."
361+
printf "\n================================================================================\n"
362+
githubCreateReleaseLink="https://github.com/vector-im/element-android/releases/new?tag=v${version}&title=Element%%20Android%%20v${version}&body=${changelogUrlEncoded}"
363+
printf "Creating the release on gitHub.\n"
364+
printf "Open this link: ${githubCreateReleaseLink}\n"
365+
printf "Then\n"
366+
printf " - click on the 'Generate releases notes' button\n"
367+
printf " - Add the 4 signed APKs to the GitHub release. They are located at ${targetPath}\n"
368+
read -p ". Press enter when it's done. "
361369

362370
printf "\n================================================================================\n"
363371
printf "Message for the Android internal room:\n\n"

0 commit comments

Comments
 (0)