...
Android requires that all release APKs be digitally signed with a certificate before they are installed on a device or updated. This requires that you generated a Keystore. To do this on Android Studio, you can follow the instructions here.
Alternatively if you have the
keytool
utility on your workstation you can generate one using the command`keytool -genkey -v -keystore my_keystore.jks -alias <my_alias_name> -keyalg RSA -keysize 4096 -validity 1000`
When generating the Keystore above you will be prompted to enter the
KEYSTORE_ALIAS, KEYSTORE_PASSWORD, KEY_PASSWORD
. Please note, if your platform doesn't prompt you for a second password when generating the Keystore (e.g. of type PKCS12) then the KEYSTORE_PASSWORD and KEY_PASSWORD values will be the same.You need to then store the above credentials in your repository of choice. The values need to correspond to the exact naming on your Github actions workflow config file. For more on setting up repository secrets see this link.
You need to store the base64 encoded versions of the content of these files:
my_keystore.jks
keystore filelocal.properties
file. (If relevant to your project)keystore.properties
file. (If using Example 2 approach above under Gradle Configuration)google-services.json
file.
The above base64 content needs to be stored on Github under the corresponding variable names. This name should correspond to what is on the Github Actions workflow config file e.g.
my_keystore.jks
- KEYSTORE_FILElocal.properties
- LOCAL_PROPERTIESkeystore.properties
- KEYSTORE_PROPERTIES (required if using Example 2 approach)google-services.json
- FIREBASE_CONFIG (Do not encode these into Base64)
You can convert to Base64 using the following command that uses the openssl utility
openssl base64 < my_keystore.jks | tr -d '\n' | tee my_keystore_base64_encoded.txt
NB: You need admin rights on the repo to access Settings menu
...