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.
This commit is contained in:
Vishesh Handa
2019-05-17 17:17:33 +02:00
parent a11254eab4
commit 77d295077f
2 changed files with 26 additions and 0 deletions

View File

@ -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

23
scripts/install_ndk_libs.sh Executable file
View File

@ -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