Last active
May 20, 2020 10:08
-
-
Save rutvikbhatt9/35b104ba3a4ebef2f2ee0025c89f0f35 to your computer and use it in GitHub Desktop.
Full file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: openjdk:8-jdk #Defining the Docker Image | |
variables: | |
ANDROID_COMPILE_SDK: "28" #set compile SDK version | |
ANDROID_BUILD_TOOLS: "28.0.2" #set build tool version | |
ANDROID_SDK_TOOLS: "4333796" #set SDK tool build number you can find yous here https://developer.android.com/studio/releases/sdk-tools | |
before_script: | |
#Installing Packages | |
- apt-get --quiet update --yes | |
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 | |
#Installing the Android SDK | |
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip | |
- unzip -d android-sdk-linux android-sdk.zip | |
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null | |
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null | |
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null | |
#Setting up the environment variable | |
- export ANDROID_HOME=$PWD/android-sdk-linux | |
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ | |
- chmod +x ./gradlew #set executable permission | |
# temporarily disable checking for EPIPE error and use yes to accept all licenses | |
- set +o pipefail | |
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses # accept SDK licences | |
- set -o pipefail | |
# - build_release_android | |
stages: | |
- build_release_android | |
build_release_android: | |
stage: build_release_android | |
script: | |
- mkdir /PlayJson #make temp directory named PlayJson in root of project | |
- "echo $PLAY_STORE_JSON > /PlayJson/play-store-key.json" # copy git variable value to play-store-key.json file | |
- ./gradlew publishApkRelease # command to publish app on play store | |
only: | |
- master #set trigger for CICD if push or merge in master branch | |
artifacts: | |
paths: | |
- ./app/build/outputs/ # set artifact path which store your APK file | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment