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 28bb602 commit ff64e77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ jobs:
NDK: "/opt/termux/android-ndk"
strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]
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 ./scripts
./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 @@ -27,17 +27,14 @@ fi

more $NDK/source.properties
rm -rf $NDK
ANDROID_NDK_ZIP=`pwd`/scripts/$ANDROID_NDK_FILE
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
echo "${ANDROID_NDK_SHA256} ${ANDROID_NDK_ZIP}" | sha256sum -c -
unzip -q $ANDROID_NDK_ZIP
mv android-ndk-r$TERMUX_NDK_VERSION $(basename $NDK)
rm ndk.zip
rm $ANDROID_NDK_ZIP
more $NDK/source.properties
fi

0 comments on commit ff64e77

Please sign in to comment.