Use another docker image (#1103)

Try to fix our issues with gitlab ci.

# DISCLAIMER
I don't really know if this will work. I pulled the image locally and ran it, `apksigner` is available, `./gradlew assembleFreeRelease` runs without issues, but I don't know if this will behave differently on gitlab. However, this took a long time to run because it is installing an emulator and sdk tools, don't know why.

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1103
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
qwerty287 2022-04-04 18:47:40 +02:00 committed by M M Arif
parent 5c0950d287
commit 42f6611585
2 changed files with 3 additions and 7 deletions

View File

@ -18,7 +18,7 @@ on_setup:
- ./scripts/add-commit-status.sh
build:
image: nextcloudci/android8:android-61
image: alvrme/alpine-android:android-31-jdk11
stage: build
only:
- main
@ -31,7 +31,7 @@ build:
expire_in: 15 minutes
sign:
image: nextcloudci/android8:android-61
image: alvrme/alpine-android:android-31-jdk11
stage: sign
only:
- main

View File

@ -9,11 +9,7 @@
[ -z "${KS_FILE}" ] && { echo "Filename of keystore is missing (KS_FILE)"; exit 1; }
[ -z "${OUTPUT}" ] && { echo "Missing filename of signed output (OUTPUT)"; exit 1; }
# Update the docker container. curl is an outdated version which has to be updated.
apt update
apt upgrade curl -y
KEYFILE=$(mktemp)
curl -X GET "${INSTANCE}/api/v1/repos/${KS_REPO}/contents/${KS_FILE}?token=${BOT_TOKEN}" -H "accept: application/json" | sed 's|"content":"|#|g' | cut -d '#' -f 2 | cut -d '"' -f 1 | base64 -d > ${KEYFILE}
/opt/android-sdk-linux/build-tools/*/apksigner sign -v --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias GitNexBot --ks ${KEYFILE} --out signed.apk $(find . -name "*release*.apk")
apksigner sign -v --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias GitNexBot --ks ${KEYFILE} --out signed.apk $(find . -name "*release*.apk")