forked from NeoApplications/Neo-Launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
62 lines (56 loc) · 2.33 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "30"
ANDROID_BUILD_TOOLS: "30.0.2"
ANDROID_SDK_TOOLS: "4333796"
VARIANT: "aospWithQuickstepOmega"
FLAVOUR: "debug"
CHAT_ID: "omega"
APK_NAME: "Omega-Nightly"
before_script:
- git submodule update --recursive --init
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 screenfetch curl
- screenfetch
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- echo "sdk.dir=$ANDROID_HOME" > local.properties
- echo "sdk-location=$ANDROID_HOME" >> local.properties
- chmod +x ./gradlew
stages:
- build
- sign
- deploy
assemble:
stage: build
script:
- curl -F text="$(git log --oneline | head -n 5)" "https://api.telegram.org/bot${SECRET_BOT_TOKEN}/sendMessage?chat_id=@${CHAT_ID}"
- 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
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
- ./gradlew assembleAospWithQuickstepOmegaDebug
signRelease:
stage: sign
dependencies:
- assemble
script:
- mkdir outputs
- echo "${KEYSTORE}" | base64 -di > $(pwd)/omega.jks
- jarsigner -keystore $(pwd)/omega.jks build/outputs/apk/${VARIANT}/${FLAVOUR}/${APK_NAME}.apk -storepass "${KEYSTORE_PASSWORD}" -keypass "${KEY_PASSWORD}" "${KEYSTORE_ALIAS}" --signedjar omega-ci-signed.apk
- ${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}/zipalign -v 4 omega-ci-signed.apk outputs/omega-ci-signed-aligned.apk
artifacts:
paths:
- outputs/omega-ci-signed-aligned.apk
expire_in: 1 week
sendReleaseTelegram:
stage: deploy
script:
- apt-get install curl
- curl -F document=@"outputs/omega-ci-signed-aligne.apk" "https://api.telegram.org/bot${SECRET_BOT_TOKEN}/sendDocument?chat_id=@${CHAT_ID}"
dependencies:
- signRelease