From cdb5e389f0732f668d8ccf94b7b240e01c66b8d8 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Wed, 10 Jun 2026 11:08:07 +0200 Subject: [PATCH] Update Android build-and-submit.sh --- apps/mobile-app/android/build-and-submit.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/mobile-app/android/build-and-submit.sh b/apps/mobile-app/android/build-and-submit.sh index b5ec8959f..11274149c 100755 --- a/apps/mobile-app/android/build-and-submit.sh +++ b/apps/mobile-app/android/build-and-submit.sh @@ -173,6 +173,23 @@ if [[ ! $REPLY =~ ^([Yy]([Ee][Ss])?|[Yy])$ ]]; then exit 1 fi +# ------------------------------------------ +# Prepare changelogs (strip trailing newlines) +# ------------------------------------------ +# +# The changelog files end with a trailing newline on purpose (for clean git diffs). +# But Play Console renders that trailing newline as blank space under the release notes. +# Upload from a temp copy of the metadata tree whose changelog files have their trailing whitespace stripped. + +TMP_METADATA_ROOT=$(mktemp -d) +trap 'rm -rf "$TMP_METADATA_ROOT"' EXIT +SUPPLY_METADATA_PATH="$TMP_METADATA_ROOT/android" +cp -R "$METADATA_PATH" "$SUPPLY_METADATA_PATH" + +while IFS= read -r changelog; do + perl -i -0777 -pe 's/\s+\z//' "$changelog" +done < <(find "$SUPPLY_METADATA_PATH" -path '*/changelogs/*.txt') + # ------------------------------------------ # Upload via fastlane supply # ------------------------------------------ @@ -185,7 +202,7 @@ fastlane supply \ --package_name "$PACKAGE_NAME" \ --aab "$AAB_RENAMED" \ --track "$TRACK" \ - --metadata_path "$METADATA_PATH" \ + --metadata_path "$SUPPLY_METADATA_PATH" \ --json_key "$JSON_KEY_PATH" \ --skip_upload_apk true \ --skip_upload_metadata true \