From ccfaaeca6d844050c741af202d1a9c8c575a5c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Lindstr=C3=B6m?= Date: Thu, 5 Dec 2024 15:58:21 +0100 Subject: [PATCH] Enable automatic F-Droid publishing --- android/fdroid-build/env.sh | 2 +- dist-assets/android-version-code.txt | 1 + ...{android-product-version.txt => android-version-name.txt} | 0 mullvad-version/build.rs | 4 ++-- mullvad-version/src/main.rs | 3 +-- prepare-release.sh | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 dist-assets/android-version-code.txt rename dist-assets/{android-product-version.txt => android-version-name.txt} (100%) diff --git a/android/fdroid-build/env.sh b/android/fdroid-build/env.sh index c6c3e224b6f1..641257c02133 100755 --- a/android/fdroid-build/env.sh +++ b/android/fdroid-build/env.sh @@ -7,7 +7,7 @@ source "$HOME/.cargo/env" # Ensure Go compiler is accessible export GOROOT="$HOME/go" -export PATH="$PATH:$GOROOT/bin" +export PATH="$GOROOT/bin:$PATH" # Ensure Rust crates know which tools to use for cross-compilation export NDK_TOOLCHAIN_DIR="$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin" diff --git a/dist-assets/android-version-code.txt b/dist-assets/android-version-code.txt new file mode 100644 index 000000000000..81911bc4307b --- /dev/null +++ b/dist-assets/android-version-code.txt @@ -0,0 +1 @@ +24099000 diff --git a/dist-assets/android-product-version.txt b/dist-assets/android-version-name.txt similarity index 100% rename from dist-assets/android-product-version.txt rename to dist-assets/android-version-name.txt diff --git a/mullvad-version/build.rs b/mullvad-version/build.rs index d5f3859e98ed..72ebf588a0a7 100644 --- a/mullvad-version/build.rs +++ b/mullvad-version/build.rs @@ -8,7 +8,7 @@ use std::{ /// in dev builds. const GIT_HASH_DEV_SUFFIX_LEN: usize = 6; -const ANDROID_VERSION_FILE_PATH: &str = "../dist-assets/android-product-version.txt"; +const ANDROID_VERSION_FILE_PATH: &str = "../dist-assets/android-version-name.txt"; const DESKTOP_VERSION_FILE_PATH: &str = "../dist-assets/desktop-product-version.txt"; #[derive(Debug, Copy, Clone)] @@ -38,7 +38,7 @@ fn main() { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); fs::write(out_dir.join("product-version.txt"), product_version).unwrap(); fs::write( - out_dir.join("android-product-version.txt"), + out_dir.join("android-version-name.txt"), android_product_version, ) .unwrap(); diff --git a/mullvad-version/src/main.rs b/mullvad-version/src/main.rs index 2e83cf24ee69..7f9001ec6159 100644 --- a/mullvad-version/src/main.rs +++ b/mullvad-version/src/main.rs @@ -1,8 +1,7 @@ use mullvad_version::{PreStableType, Version}; use std::{env, process::exit}; -const ANDROID_VERSION: &str = - include_str!(concat!(env!("OUT_DIR"), "/android-product-version.txt")); +const ANDROID_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/android-version-name.txt")); fn main() { let command = env::args().nth(1); diff --git a/prepare-release.sh b/prepare-release.sh index 7e6b44356946..4e29abc6c17d 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -73,9 +73,10 @@ if [[ "$DESKTOP" == "true" ]]; then fi if [[ "$ANDROID" == "true" ]]; then - echo "$PRODUCT_VERSION" > dist-assets/android-product-version.txt + echo "$PRODUCT_VERSION" > dist-assets/android-version-name.txt + 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-product-version.txt + dist-assets/android-version-name.txt fi NEW_TAGS=""