gitlab-ci: fetch current versionCode for ./create_ota.sh test
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3c3034d..e86b8ac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -75,7 +75,11 @@
           exit 1;
       }
     - echo "use versionCode that is known to exist on f-droid.org for test:"
-    - sed -i 's,versionCode="[^"]*",versionCode="2070",' app/src/main/AndroidManifest.xml
+    - apt-get -qy install --no-install-recommends jq
+    - wget --quiet --tries=0 https://f-droid.org/repo/index-v1.jar
+    - versionCode=`unzip -qqc index-v1.jar index-v1.json
+        | jq '.packages."org.fdroid.fdroid.privileged"[0].versionCode'`
+    - sed -i 's,versionCode="[^"]*",versionCode="'$versionCode'",' app/src/main/AndroidManifest.xml
     - ./create_ota.sh release binaries
   artifacts:
     name: "${CI_PROJECT_PATH}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}_${CI_JOB_NAME}"