Use example on Gitlab's blog

This commit is contained in:
blank X 2022-07-11 11:16:50 +07:00
parent d775272c09
commit 63c55f906e
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 25 additions and 4 deletions

View File

@ -1,11 +1,32 @@
image: ubuntu:jammy 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: assembleDebug:
stage: build stage: build
script: | script: ./gradlew assembleDebug
apt update
DEBIAN_FRONTEND=noninteractive apt install -y openjdk-11-jre
./gradlew assembleDebug
artifacts: artifacts:
paths: paths:
- app/build/outputs/apk/debug/*.apk - app/build/outputs/apk/debug/*.apk