summaryrefslogtreecommitdiffhomepage
path: root/android/scripts
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2025-02-03 16:22:28 +0100
committerOskar <oskar@mullvad.net>2025-02-04 13:06:23 +0100
commit3e788fcb7190a560dfc5935a1ce2800b8846aa40 (patch)
tree0b58f520464a4779a051d38ec2377c85ac504a5d /android/scripts
parent0a45b64b09f6e35ca24bb5a10ddffbafe279d44d (diff)
downloadmullvadvpn-3e788fcb7190a560dfc5935a1ce2800b8846aa40.tar.xz
mullvadvpn-3e788fcb7190a560dfc5935a1ce2800b8846aa40.zip
Update Android prepare release script
Diffstat (limited to 'android/scripts')
-rwxr-xr-xandroid/scripts/prepare-release.sh82
1 files changed, 17 insertions, 65 deletions
diff --git a/android/scripts/prepare-release.sh b/android/scripts/prepare-release.sh
index 4170b0fbe9..00dc1b81ef 100755
--- a/android/scripts/prepare-release.sh
+++ b/android/scripts/prepare-release.sh
@@ -5,19 +5,11 @@
set -eu
-ANDROID="false"
-DESKTOP="false"
-VERSION_METADATA_ARGS=""
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "$SCRIPT_DIR/../.."
for argument in "$@"; do
case "$argument" in
- "--android")
- ANDROID="true"
- ;;
- "--desktop")
- DESKTOP="true"
- VERSION_METADATA_ARGS+="--desktop "
- ;;
-*)
echo "Unknown option \"$argument\""
exit 1
@@ -34,31 +26,12 @@ if [[ -z ${PRODUCT_VERSION+x} ]]; then
exit 1
fi
-if [[ "$ANDROID" != "true" && "$DESKTOP" != "true" ]]; then
- echo "Please specify if the release is for the desktop app and/or for Android app."
- echo "For example: --android --desktop"
- 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
-desktop_changes_path=desktop/packages/mullvad-vpn/changes.txt
-if [[ $DESKTOP == "true" && $(grep "CHANGE THIS BEFORE A RELEASE" $desktop_changes_path) != "" ]]; then
- echo "It looks like you did not update $desktop_changes_path"
- exit 1
-fi
-
-if [[ "$DESKTOP" == "true" && $(grep "^## \\[$PRODUCT_VERSION\\] - " 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
-
-if [[ "$ANDROID" == "true" &&
- $PRODUCT_VERSION != *"alpha"* &&
+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?"
@@ -66,48 +39,27 @@ if [[ "$ANDROID" == "true" &&
exit 1
fi
-if [[ "$ANDROID" == "true" ]]; then
- 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
-fi
-
-if [[ "$DESKTOP" == "true" ]]; then
- echo "$PRODUCT_VERSION" > dist-assets/desktop-product-version.txt
- git commit -S -m "Update desktop app version to $PRODUCT_VERSION" \
- dist-assets/desktop-product-version.txt
-fi
+echo "Generate relays.json"
+mkdir dist-assets/relays
+cargo run -q -p mullvad-api --bin relay_list > dist-assets/relays/relays.json
-if [[ "$ANDROID" == "true" ]]; then
- 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
-fi
+git commit -S -m "Add relay list to bundle with $PRODUCT_VERSION" \
+ dist-assets/relays/relays.json
-NEW_TAGS=""
+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
-if [[ "$ANDROID" == "true" ]]; then
- echo "Tagging current git commit with release tag android/$PRODUCT_VERSION..."
- git tag -s "android/$PRODUCT_VERSION" -m "android/$PRODUCT_VERSION"
- NEW_TAGS+=" android/$PRODUCT_VERSION"
-fi
-if [[ "$DESKTOP" == "true" ]]; then
- echo "Tagging current git commit with release tag $PRODUCT_VERSION..."
-
- git tag -s "$PRODUCT_VERSION" -m "$PRODUCT_VERSION"
- NEW_TAGS+=" $PRODUCT_VERSION"
-fi
+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$NEW_TAGS"
+echo "| $ git push origin $PRODUCT_VERSION"
echo "================================================="