Skip to content

Instantly share code, notes, and snippets.

@nisrulz
Last active February 2, 2022 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nisrulz/be60ce6133956fd456340a6e68edf197 to your computer and use it in GitHub Desktop.
Save nisrulz/be60ce6133956fd456340a6e68edf197 to your computer and use it in GitHub Desktop.
Android: Setup system env based signing config

Signing in Android

  • Using ENV vars

Inside your ~/.zshrc or ~/.bashrc file

Note: For CI, declare key-value pair under secrets section

export KEYSTORE_FILE_PATH = "/Users/your_user/App_Directory/keystore_file.keystore"
export KEYSTORE_PASSWORD = "********"
export KEY_ALIAS = "key_alias"
export KEY_PASSWORD = "************"

Inside build.gradle file

signingConfigs {
    release {
        storeFile file(String.valueOf(System.getenv("KEYSTORE_FILE_PATH")))
        storePassword System.getenv("KEYSTORE_PASSWORD")
        keyAlias System.getenv("KEY_ALIAS")
        keyPassword System.getenv("KEY_PASSWORD")
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment