Update template

This commit is contained in:
blank X 2022-07-11 11:42:58 +07:00
parent 53d3f0c474
commit 4ca61846e4
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 15 additions and 14 deletions

View File

@ -1,25 +1,26 @@
image: ubuntu:jammy
# https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
# https://gitlab.com/gitlab-org/gitlab-foss/-/blob/9d5d5a163f7634ffd555bffa545008ae3991c298/lib/gitlab/ci/templates/Android.latest.gitlab-ci.yml
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
ANDROID_SDK_TOOLS: "7583922"
before_script:
- apt-get update -y --quiet
- DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet wget tar unzip lib32stdc++6 lib32z1 openjdk-8-jre
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip -q -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
- 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
- DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet wget tar unzip lib32stdc++6 lib32z1 openjdk-11-jre
- export ANDROID_HOME=$PWD/android-home
- mkdir -p "$ANDROID_HOME"
- cd "$ANDROID_HOME"
- wget --quiet --output-document=cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
- unzip -q -d cmdline-tools cmdline-tools.zip
- mv cmdline-tools/{cmdline-,}tools || true
- cd ..
- export PATH=$PATH:$ANDROID_HOME/cmdline-tools/tools/bin/
- yes | sdkmanager --licenses > /dev/null || true
- echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
- echo y | sdkmanager "platform-tools" > /dev/null
- echo y | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
stages:
- build