Skip to content

Commit

Permalink
Cache NDK 23
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Aug 21, 2021
1 parent 644a351 commit 3722c0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ jobs:
target_arch: [aarch64, arm, i686, x86_64]
fail-fast: false
steps:
- name: Get cached NDK 23
id: cache-ndk
uses: actions/cache@v2
with:
path: ~/android-ndk-r23-linux.zip
key: android-ndk-r23
- name: Get latest NDK if not cached
if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }}
run: |
wget -q -O ~/android-ndk-r23-linux.zip https://dl.google.com/android/repository/android-ndk-r23-linux.zip
- name: Clone repository
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -117,6 +127,7 @@ jobs:
fi
if [ -f ./built_packages.txt ]; then
cp ~/android-ndk-r23-linux.zip /home/builder
./scripts/run-docker.sh ./scripts/setup-android-sdk.sh
./scripts/lint-packages.sh $(cat ./built_packages.txt | awk '{print "packages/"$1"/build.sh"}')
Expand Down
11 changes: 4 additions & 7 deletions scripts/setup-android-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ if [ ! -d $NDK ]; then
mkdir -p $NDK
cd $NDK/..
rm -Rf $(basename $NDK)
echo "Downloading android ndk..."
curl --fail --retry 3 -o ndk.zip \
https://dl.google.com/android/repository/${ANDROID_NDK_FILE}
echo "${ANDROID_NDK_SHA256} ndk.zip" | sha256sum -c -
rm -Rf android-ndk-r$TERMUX_NDK_VERSION
unzip -q ndk.zip
ls -l /
echo "${ANDROID_NDK_SHA256} /${ANDROID_NDK_FILE}" | sha256sum -c -
unzip -q /$ANDROID_NDK_FILE
mv android-ndk-r$TERMUX_NDK_VERSION $(basename $NDK)
rm ndk.zip
rm /$ANDROID_NDK_FILE
more $NDK/source.properties
fi

0 comments on commit 3722c0c

Please sign in to comment.