fix ci cache to speed up building

This commit is contained in:
n3t1zen
2026-05-05 18:50:22 +08:00
parent 2454afbd4d
commit 65e1c77ec9
2 changed files with 14 additions and 7 deletions
+13 -6
View File
@@ -6,10 +6,12 @@ build-android:
mkdir -p ~/.ssh && ssh-keyscan -p 22 -t rsa,ed25519 git.inker.bot >> ~/.ssh/known_hosts
cache:
- paths:
- $HOME/.gradle
- $HOME/go
- .go/pkg/mod
- .cache/go-build
- works/core/clients/android/app/build
- $HOME/Android
- Android/
- .gradle/caches
- .gradle/wrapper
script: |
export version="$(git describe --tags)-$CI_COMMIT_SHORT_SHA" && echo "building version $version"
bash ./setup-ndk.sh
@@ -26,16 +28,21 @@ build-android:
cp *.aar clients/android/app/libs
cd clients/android
echo "Gonna build with ANDROID_HOME=$ANDROID_HOME"
ANDROID_HOME="$HOME/Android/Sdk" ./gradlew --no-daemon :app:assembleOtherRelease :app:assembleOtherLegacyRelease
ANDROID_HOME="$PWD/Android/Sdk" ./gradlew --no-daemon :app:assembleOtherRelease :app:assembleOtherLegacyRelease
cd ../..
mkdir -p dist # prepare upload
cp clients/android/app/build/outputs/apk/other/release/*.apk dist
cp clients/android/app/build/outputs/apk/otherLegacy/release/*.apk dist
cp clients/android/app/build/outputs/apk/other/release/*arm64-v8a.apk dist
cp clients/android/app/build/outputs/apk/otherLegacy/release/*arm64-v8a.apk dist
VERSION_CODE=$(grep VERSION_CODE clients/android/version.properties | cut -d= -f2)
VERSION_NAME=$(grep VERSION_NAME clients/android/version.properties | cut -d= -f2)
variables:
ANDROID_NDK_VERSION: r28
LOCAL_PROPERTIES: "S0VZU1RPUkVfUEFTUz0xMTQ1MTQKQUxJQVNfTkFNRT1hbGlhcwpBTElBU19QQVNTPTExNDUxNAo="
GOPATH: "$CI_PROJECT_DIR/.go"
GOMODCACHE: "$CI_PROJECT_DIR/.go/pkg/mod"
GOCACHE: "$CI_PROJECT_DIR/.cache/go-build"
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
artifacts:
paths:
- "./works/core/dist"
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_HOME="$PWD/Android/Sdk"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
if [ -d "$ANDROID_HOME" ]; then