summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2025-02-04 13:06:49 +0100
committerOskar <oskar@mullvad.net>2025-02-04 13:06:49 +0100
commitb9b74b3bef5d47f526fbe0bd13b34e2c28bd66a2 (patch)
tree0b58f520464a4779a051d38ec2377c85ac504a5d /android
parentb11bdc69ab935264a729a7a24376d56f2eda44e5 (diff)
parent3e788fcb7190a560dfc5935a1ce2800b8846aa40 (diff)
downloadmullvadvpn-b9b74b3bef5d47f526fbe0bd13b34e2c28bd66a2.tar.xz
mullvadvpn-b9b74b3bef5d47f526fbe0bd13b34e2c28bd66a2.zip
Merge branch 'improve-prepare-release-script'
Diffstat (limited to 'android')
-rwxr-xr-xandroid/scripts/prepare-release.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/android/scripts/prepare-release.sh b/android/scripts/prepare-release.sh
new file mode 100755
index 0000000000..00dc1b81ef
--- /dev/null
+++ b/android/scripts/prepare-release.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+
+# This script prepares for a release. Run it with the release version as the first argument and it
+# will update version numbers, commit and add a signed tag.
+
+set -eu
+
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "$SCRIPT_DIR/../.."
+
+for argument in "$@"; do
+ case "$argument" in
+ -*)
+ echo "Unknown option \"$argument\""
+ exit 1
+ ;;
+ *)
+ PRODUCT_VERSION="$argument"
+ ;;
+ esac
+done
+
+if [[ -z ${PRODUCT_VERSION+x} ]]; then
+ echo "Please give the release version as an argument to this script."
+ echo "For example: '2018.1-beta3' for a beta release, or '2018.6' for a stable one."
+ exit 1
+fi
+
+if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
+ echo "Dirty working directory! Will not accept that for an official release."
+ exit 1
+fi
+
+if [[ $PRODUCT_VERSION != *"alpha"* &&
+ $(grep "^## \\[android/$PRODUCT_VERSION\\] - " android/CHANGELOG.md) == "" ]]; then
+
+ echo "It looks like you did not add $PRODUCT_VERSION to the changelog?"
+ echo "Please make sure the changelog is up to date and correct before you proceed."
+ exit 1
+fi
+
+echo "Generate relays.json"
+mkdir dist-assets/relays
+cargo run -q -p mullvad-api --bin relay_list > dist-assets/relays/relays.json
+
+git commit -S -m "Add relay list to bundle with $PRODUCT_VERSION" \
+ dist-assets/relays/relays.json
+
+echo "$PRODUCT_VERSION" > dist-assets/android-version-name.txt
+ANDROID_VERSION="$PRODUCT_VERSION" cargo run -q --bin mullvad-version versionCode > \
+ dist-assets/android-version-code.txt
+git commit -S -m "Update android app version to $PRODUCT_VERSION" \
+ dist-assets/android-version-name.txt \
+ dist-assets/android-version-code.txt
+
+
+echo "Tagging current git commit with release tag android/$PRODUCT_VERSION..."
+git tag -s "android/$PRODUCT_VERSION" -m "android/$PRODUCT_VERSION"
+
+echo "================================================="
+echo "| DONE preparing for a release! |"
+echo "| Now push the tag created by this script |"
+echo "| after you have verified it is correct: |"
+echo "| $ git push origin $PRODUCT_VERSION"
+echo "================================================="