ci: sanitize branch name when naming test APK in reusable-build

The 'Rename apk file'/'Find APK file' steps used the raw ${BRANCH_NAME}
as an APK filename, so any branch containing a '/' (e.g. claude/*) made
cp target a non-existent test-apk/<prefix>/ subdirectory and failed the
build. Derive the sanitized branch name from android/app.properties, the
same approach already used in automated_integration_test.yml.
This commit is contained in:
sethforprivacy
2026-07-24 23:35:59 +02:00
committed by cyan
parent 33f5df5ad3
commit c50d0fc6dd
+5 -3
View File
@@ -176,16 +176,18 @@ jobs:
- name: Rename apk file
run: |
sanitized_branch_name=$(grep '^id=' android/app.properties | cut -d'=' -f2 | sed 's/com\.cakewallet\.test_//')
cd build/app/outputs/flutter-apk
mkdir test-apk
cp app-arm64-v8a-release.apk test-apk/${BRANCH_NAME}.apk
cp app-x86_64-release.apk test-apk/${BRANCH_NAME}_x86.apk
cp app-arm64-v8a-release.apk test-apk/${sanitized_branch_name}.apk
cp app-x86_64-release.apk test-apk/${sanitized_branch_name}_x86.apk
- name: Find APK file
id: find_apk
run: |
set -x
apk_file=$(ls build/app/outputs/flutter-apk/test-apk/${BRANCH_NAME}.apk || exit 1)
sanitized_branch_name=$(grep '^id=' android/app.properties | cut -d'=' -f2 | sed 's/com\.cakewallet\.test_//')
apk_file=$(ls build/app/outputs/flutter-apk/test-apk/${sanitized_branch_name}.apk || exit 1)
echo "APK_FILE=$apk_file" >> $GITHUB_ENV
- name: Write BRANCH_NAME to env
run: echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV