From d1c2247e82a9c3239875279abbc147797bc30cb2 Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Sun, 23 Aug 2026 20:25:12 +0200 Subject: [PATCH] CI: auf einem Release-Tag ohne Signing-Key abbrechen Ein Release darf keinen APK ausliefern, den niemand installieren kann. Fehlt auf einem v*-Tag ANDROID_KEYSTORE_B64, ist an den geschuetzten Variablen etwas kaputt - dann soll der Job scheitern statt still eine unsignierte Datei zu bauen. --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20269d4..c441925 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -232,6 +232,12 @@ build:apk: --out "$CI_PROJECT_DIR/openGym-$VER.apk" aligned.apk rm -f "$CI_PROJECT_DIR/.ks.jks" "$BT/apksigner" verify --print-certs "$CI_PROJECT_DIR/openGym-$VER.apk" + elif [ -n "${CI_COMMIT_TAG:-}" ]; then + # A release must never quietly ship an APK nobody can install. If the key is missing + # on a tag, something is wrong with the protected variables — say so and stop. + echo "FATAL: $CI_COMMIT_TAG is a release tag but ANDROID_KEYSTORE_B64 is not set." >&2 + echo "Set it (protected, file type) under Settings -> CI/CD -> Variables." >&2 + exit 1 else echo "No signing key on this ref — producing an UNSIGNED apk (cannot be installed)." "$BT/zipalign" -f -p 4 "$UNSIGNED" "$CI_PROJECT_DIR/openGym-$VER-unsigned.apk"