-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): upgrade action android to reuse existing sdk
- Loading branch information
Showing
2 changed files
with
4 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ MAINTAINER Anton Malinskiy "[email protected]" | |
USER root | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends git curl build-essential jq unzip rename openjdk-17-jdk \ | ||
&& apt-get install -y --no-install-recommends git curl build-essential jq unzip zip rename openjdk-17-jdk \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG android_home=/opt/android-sdk | ||
|
@@ -34,21 +34,16 @@ RUN sdkmanager \ | |
|
||
ARG api | ||
ARG abi=x86_64 | ||
RUN sdkmanager "system-images;android-${api};google_apis;${abi}" && \ | ||
RUN sdkmanager "system-images;android-${api};google_apis;${abi}" "platforms;android-${api}" && \ | ||
# Convert large partitions to qcow2 to save space | ||
qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.qcow2 && \ | ||
mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/system.img && \ | ||
qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.qcow2 && \ | ||
mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/userdata.img && \ | ||
if test -f $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img; then (qemu-img convert -O qcow2 -c $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.qcow2 && mv $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.qcow2 $ANDROID_HOME/system-images/android-${api}/google_apis/${abi}/vendor.img); fi | ||
|
||
RUN sdkmanager "platforms;android-${api}" | ||
|
||
ADD --chown=1001:1001 init.gradle.kts /home/runner/.gradle/ | ||
|
||
RUN chown -R 1001:1001 $ANDROID_HOME | ||
RUN apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends zip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters