Skip to content

Maeda-Naoki/AndroidCI

Repository files navigation

AndroidCI

GitLab CI MIT License

Overview

This project is intended to be the base of the Android project.

Development Environment

Build Variants

The following four Build Types are set.
We assume that you can switch between them depending on the optimization level, signature, and server settings.

Debug Build

This Build Type is primarily intended for use during development.

  • Minify : Disable
  • Signature : Debug Key

Local Build

This is basically the same as Debug Build, but it is a Build Type that assumes a connection to a local server.
It is mainly intended for use in Unit Test.

  • Minify : Disable
  • Signature : Debug Key

Staging Build

This build type is basically the same as the Release build, but is intended for testing in the Staging environment.

  • Minify : Enable
  • Signature : Release Key

Release Build

This build type is primarily intended to create a release version APK.

  • Minify : Enable
  • Signature : Release Key

Repository Setting

Auto-cancel redundant pipelines

Static Badge GitLab
This GitLab CI uses interruptible flag to enable auto-cancel pipelines.
Therefore, please enable GitLab's auto-cancel redundant pipelines.

Environment Variables

Release Build variables

You must set the below environment variables to do a Release build .

KEYSTORE_FILE_BASE64

Static Badge GitHub GitLab
This is KeyStore.jks encoded in Base64.
Please encode keystore.jks in Base64 by referring to the following command.
You should create KeyStore.jks from Android Studio or similar.

$ openssl base64 -A -in KeyStore.jks > KeyStore.jks.txt

KEYSTORE_PASSWORD

Static Badge GitHub GitLab
Set the Key Store Password that you entered when creating the KeyStore.
Never commit this value.

KEY_ALIAS

Static Badge GitHub GitLab
Set the Key Alias that you entered when creating the KeyStore.

KEY_PASSWORD

Static Badge GitHub GitLab
Set the Key Password that you entered when creating the KeyStore.
Never commit this value.

Renovate

RENOVATE_TOKEN

Static Badge GitHub GitLab
API token for Renovate.
The token is required for automatic Updates of Dependencies by Renovate.
Please refer to the following site for the settings required to create the token.

Build variables

The following values are set to default values, but you can override them from the repository settings.

ANDROID_COMPILE_SDK

Static Badge GitHub GitLab
This is the compile target SDK version.
Please refer to SDK Platforms in SDK manager to set this value.
Ref : API Level

ANDROID_BUILD_TOOLS

Static Badge GitHub GitLab
This is the version of the Android SDK Build-tools.
Please refer to Android SDK Build-tools in SDK manager to set this value.
Ref : SDK Build Tools

ANDROID_SDK_TOOLS

Static Badge GitHub GitLab
This is the version of the Android command-line tools.
Please refer to the ★ portion of the following values for version values.
commandlinetools-linux-{★}_latest.zip
Ref : Command-line tools

Merge Request variables

You must set the below environment variables to do a Merge Request .

REVIEWDOG_GITLAB_API_TOKEN

Static Badge GitLab
An access token for the account which will post MR comments.
Please create an account to post MR comments in advance.
Get the token with api scope from https://gitlab.com/-/user_settings/personal_access_tokens.