gitlab-ci: ensure correct compile platform version is installed

This might not always be in sync with fdroidclient or ci-images/client.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bcf7a83..2e1445a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,12 @@
     - .gradle/wrapper
     - .gradle/caches
 
+before_script:
+  - export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
+  - echo y | android --silent update sdk --no-ui --filter android-${ANDROID_COMPILE_SDK}
+  - export ANDROID_BUILD_TOOLS=`sed -n "s,.*buildToolsVersion\s*'\([0-9][0-9.]*\)'.*,\1,p" app/build.gradle`
+  - echo y | android --silent update sdk --no-ui --all --filter android-${ANDROID_BUILD_TOOLS}
+
 test:
   script:
     - export GRADLE_USER_HOME=$PWD/.gradle