From 77d295077fdba3e35a7ccd6148cd97141d5dc9c4 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 17 May 2019 17:17:33 +0200 Subject: [PATCH] CI: Download the NDK libs Now I can finally push all these changes, as the CI should also run and we're ready to try out the new version of the app which uses libgit2 instead of jgit. Hopefully no user will notice anything different. --- .circleci/config.yml | 3 +++ scripts/install_ndk_libs.sh | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 scripts/install_ndk_libs.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index cb01cb90..a446a44f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,9 @@ jobs: - image: vhanda/flutter-android:latest steps: - checkout + - run: + name: Get NDK Libraries + command: ./scripts/install_ndk_libs.sh - run: name: Test command: flutter test diff --git a/scripts/install_ndk_libs.sh b/scripts/install_ndk_libs.sh new file mode 100755 index 00000000..9f9806da --- /dev/null +++ b/scripts/install_ndk_libs.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -eux + +cd "$(dirname "$0")"/../android/app + +BUILD_NUM=$(curl -s 'https://circleci.com/api/v1.1/project/github/GitJournal/ndk-libraries?limit=1&offset=0&filter=succeeded' | jq .[0] | jq -r .build_num) +echo "CircleCI Buld Number: $BUILD_NUM" + +URL=$(curl -s https://circleci.com/api/v1.1/project/github/GitJournal/ndk-libraries/$BUILD_NUM/artifacts | grep -o 'https://[^"]*libs.tar') + +echo "Downloading $URL" + +curl "$URL" -o "libs.tar" +rm -rf libs +tar xf libs.tar +mv libs ci_libs +mkdir libs +cp -r ci_libs/openssl-lib/* libs/ +cp -r ci_libs/libssh2/* libs/ +cp -r ci_libs/libgit2/* libs/ +rm -rf ci_libs +rm libs.tar