Android keystore decode disappeared from before_script.sh

Error description

ANDROID_KEYSTORE_BASE64 decode block disappeared from before_script.sh

Build cannot find valid keystore.keystore file and fastlane upload process to google store fails due to mismatch of fallback Unity's default keystore, used to sign bundle, and valid key from $ANDROID_KEYSTORE_BASE64

Documentation secton: https://game.ci/docs/gitlab/deployment/android/

Error log

----- buld step for android AAB bundle -----
:: keystore.keystore not found, skipping setup, using Unity's default keystore

----- deploy to google store step ---------
Google Api Error: Invalid request - The Android App Bundle was signed with the wrong key. Found: SHA1: **MASKED**,  expected: SHA1:
**MASKED**

Technical details

  1. Which CI service are you using? Gitlab selfhosted
  2. Is this failing with shared runners or are you using your own runners? Own runner
  3. What is you CI configuration (is it different from example project)? Same, deploy-android block uncommented
  4. Did you try with the Example project before trying with your own? No
  5. Did you try running the build locally from command line? No
  1. Did it work previously with a different version? Yes. This commit broke everything: 09c4ac3d
  2. Are you using Assets/Scripts/Editor/BuildCommand.cs exactly as is from the repo? Yes

Spoiler :-D Solution: return this block to /ci/before_script.sh:

android_keystore_destination=keystore.keystore

if [ "$upper_case_build_target" = "ANDROID" ]
then
    if [ -n $ANDROID_KEYSTORE_BASE64 ]
    then
        echo "'\$ANDROID_KEYSTORE_BASE64' found, decoding content into ${android_keystore_destination}"
        echo $ANDROID_KEYSTORE_BASE64 | base64 --decode > ${android_keystore_destination}
    else
        echo '$ANDROID_KEYSTORE_BASE64'" env var not found, building with Unity's default debug keystore"
    fi
fi
Edited by DobriyDed