Use example on Gitlab's blog
This commit is contained in:
parent
d775272c09
commit
63c55f906e
|
@ -1,11 +1,32 @@
|
|||
image: ubuntu:jammy
|
||||
|
||||
# https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
|
||||
variables:
|
||||
ANDROID_COMPILE_SDK: "28"
|
||||
ANDROID_BUILD_TOOLS: "28.0.2"
|
||||
ANDROID_SDK_TOOLS: "4333796"
|
||||
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get install -y wget tar unzip lib32stdc++6 lib32z1
|
||||
- wget --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}"
|
||||
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools"
|
||||
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
|
||||
- export ANDROID_HOME=$PWD/android-sdk-linux
|
||||
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
|
||||
# temporarily disable checking for EPIPE error and use yes to accept all licenses
|
||||
- set +o pipefail
|
||||
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
|
||||
- set -o pipefail
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
assembleDebug:
|
||||
stage: build
|
||||
script: |
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y openjdk-11-jre
|
||||
./gradlew assembleDebug
|
||||
script: ./gradlew assembleDebug
|
||||
artifacts:
|
||||
paths:
|
||||
- app/build/outputs/apk/debug/*.apk
|
||||
|
|
Loading…
Reference in New Issue