forked from NeoApplications/Neo-Launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
58 lines (52 loc) · 1.93 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
stages:
- build
- deploy
variables:
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
CHAT_ID: "omega"
KEYSTORE_FILE: "debug.keystore"
KEYSTORE_PASSWORD: "android"
KEY_ALIAS: "androiddebugkey"
KEY_PASSWORD: "android"
before_script:
- export GRADLE_OPTS="-Dorg.gradle.daemon=false"
- apt-get update -qy
- apt-get install -y openjdk-17-jdk
- export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
- chmod +x gradlew
build:
stage: build
interruptible: true
script:
- ./gradlew assembleAospOmega
cache:
paths:
- .gradle/caches
- .gradle/wrapper
artifacts:
name: "NeoLauncher.apk"
paths:
- build/outputs/apk/aospOmega/debug/
expire_in:
1 week
before_script:
- echo $KEYSTORE_FILE | base64 -d > keystore.jks
- echo -e "storePassword=$KEYSTORE_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=$KEY_ALIAS\nstoreFile=keystore.jks" > keystore.properties
- chmod +x gradlew
- ./gradlew signingConfig
after_script:
- ARTIFACT_PATHNAME_APK=$(ls build/outputs/apk/aospOmega/debug/*.apk | head -n 1)
- ARTIFACT_NAME_APK=$(basename ARTIFACT_PATHNAME_APK)
- echo "ARTIFACT_NAME_APK is ${ARTIFACT_NAME_APK}"
- echo "ARTIFACT_PATHNAME_APK=${ARTIFACT_PATHNAME_APK}" >> $CI_JOB_ENV
- echo "ARTIFACT_NAME_APK=${ARTIFACT_NAME_APK}" >> $CI_JOB_ENV
deploy:
stage: deploy
needs:
[ build ]
interruptible: true
script:
- curl -s -X POST https://api.telegram.org/SECRET_BOT_TOKEN/sendMessage -d chat_id=$CHAT_ID -d text="Build finished"
- apt-get install curl
- curl -F document=@"outputs/NeoLauncher-Signed.apk" "https://api.telegram.org/bot${SECRET_BOT_TOKEN}/sendDocument?chat_id=@${CHAT_ID}"
- curl -s -X POST https://api.telegram.org/SECRET_BOT_TOKEN/sendMessage -d chat_id=$CHAT_ID -d text="Build finished"