How to manage signing keystore in Gitlab CI for android

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to manage signing keystore in Gitlab CI for android



Dear stackoverflow community, once more I turn to you :)



I've recently come across the wonder of Gitlab and their very nice bundled CI/CD solution. It works gallantly however, we all need to sign our binaries don't we and I've found no way to upload a key as I would to a Jenkins server for doing this.



So, how can I, without checking in my keys and secrets sign my android (actually flutter) application when building a release?



From what I see, most people define the build job with signing settings referring to a non-committed key.properties file specifying a local keystore.jks. This works fine when building APKs locally but if I would like to build and archive them as a part of the CI/CD job, how do I?



For secret keys, for example the passwords to the keystore itself, I've found that I can simply store them as protected variables but the actual keystore file itself. What can I do about that?



Any ideas, suggestions are dearly welcome.
Cheers





You should look into App Signing inside the google play console.
– Oliver
Aug 7 at 11:16





I've seen that one but I didn't catch you can build without key. I expected you'll need an upload key or so anyway. I'll reread it and see if I can get it. Thanks!
– Almund
Aug 7 at 12:00





Yes, you will still need a Keystore. But you can invalidate this keystore in the play console, if it gets leaked, because this one isn't your "real" keystore.
– Oliver
Aug 7 at 12:15




1 Answer
1



I've used git-secret in the past to check-in password protected secret files. Then pass the password via a secret/protected environmental variable (as you already know) and modify the .gitlab-ci.yml to use the password to open the files and use them.





Sounds reasonable, I've read in other places about using different repos and such to store the secret files. I'll give it a try and come back once it's done. Thank you!
– Almund
Aug 8 at 13:47





Sure.. there is also a fastlane plugin that encrypts keystores github.com/hjanuschka/fastlane-plugin-cryptex (haven't tried). Plus here is a (dated) article about how NOT to manage certificates in Google Play Store researchcenter.paloaltonetworks.com/2014/08/…
– mmccabe
Aug 8 at 14:45






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard