From 42f6611585d4e8a59851e7f894c384eef6b58a0f Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Mon, 4 Apr 2022 18:47:40 +0200 Subject: [PATCH] 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 Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1103 Reviewed-by: M M Arif Co-authored-by: qwerty287 Co-committed-by: qwerty287 --- .gitlab-ci.yml | 4 ++-- scripts/sign-build.sh | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7c734af..4f0e6737 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/scripts/sign-build.sh b/scripts/sign-build.sh index 259da908..8d94ae9e 100755 --- a/scripts/sign-build.sh +++ b/scripts/sign-build.sh @@ -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")