Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase matrix of supported Android CLT and Java versions #74

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
docker_builder:
name: Build
only_if: $CIRRUS_BRANCH != $CIRRUS_DEFAULT_BRANCH
env:
# Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800
matrix:
- ANDROID_CLT_VERSION: 9123335 # v8, latest compatible with JDK 8+
JDK_VERSION: 8
- ANDROID_CLT_VERSION: 9862592 # v10, latest compatible with JDK 11+
JDK_VERSION: 11
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_VERSION: 17
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_VERSION: 21
export_env_vars_script:
- echo "ANDROID_CLT_VERSION=$ANDROID_CLT_VERSION" >> $CIRRUS_ENV
- echo "JDK_VERSION=$JDK_VERSION" >> $CIRRUS_ENV
info_script:
- docker --version
- echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_VERSION"
version_script: docker --version
setup_script:
- docker buildx create --name multibuilder
- docker buildx use multibuilder
- docker buildx inspect --bootstrap
build_tools_script: |
docker buildx build --platform linux/amd64,linux/arm64 \
--tag ghcr.io/cirruslabs/android-sdk:tools \
--build-arg android_clt_version=$ANDROID_CLT_VERSION \
--build-arg jdk_version=$JDK_VERSION \
--tag ghcr.io/cirruslabs/android-sdk:tools-jdk${JDK_VERSION} \
sdk/tools
build_sdk_script: |
docker buildx build --platform linux/amd64,linux/arm64 \
Expand All @@ -23,8 +42,23 @@ docker_builder:
name: Push
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH
env:
# Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800
matrix:
- ANDROID_CLT_VERSION: 9123335 # v8, latest compatible with JDK 8+
JDK_VERSION: 8
- ANDROID_CLT_VERSION: 9862592 # v10, latest compatible with JDK 11+
JDK_VERSION: 11
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_VERSION: 17
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_VERSION: 21
GITHUB_TOKEN: ENCRYPTED[!82ed873afdf627284305afef4958c85a8f73127b09978a9786ac521559630ea6c9a5ab6e7f8315abf9ead09b6eff6eae!]
version_script: docker --version
export_env_vars_script:
- echo "ANDROID_CLT_VERSION=$ANDROID_CLT_VERSION" >> $CIRRUS_ENV
- echo "JDK_VERSION=$JDK_VERSION" >> $CIRRUS_ENV
info_script:
- docker --version
- echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_VERSION"
login_script:
- echo $GITHUB_TOKEN | docker login ghcr.io -u fkorotkov --password-stdin
setup_script:
Expand All @@ -33,7 +67,9 @@ docker_builder:
- docker buildx inspect --bootstrap
build_tools_script: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
--tag ghcr.io/cirruslabs/android-sdk:tools \
--build-arg android_clt_version=$ANDROID_CLT_VERSION \
--build-arg jdk_version=$JDK_VERSION \
--tag ghcr.io/cirruslabs/android-sdk:tools-jdk${JDK_VERSION} \
sdk/tools
build_sdk_script: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
Expand All @@ -53,6 +89,8 @@ task:
kvm: "true"
env:
EMULATOR_IMAGE: system-images;android-34;aosp_atd;x86_64
ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_VERSION: 17
setup_script: |
sdkmanager --install "platforms;android-34"
sdkmanager --install "build-tools;34.0.0"
Expand Down
1 change: 1 addition & 0 deletions sdk/34-ndk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ FROM ghcr.io/cirruslabs/android-sdk:34
ENV ANDROID_NDK_VERSION 26.2.11394342

RUN yes | sdkmanager "ndk;$ANDROID_NDK_VERSION"

9 changes: 7 additions & 2 deletions sdk/tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ ENV ANDROID_SDK_ROOT=$ANDROID_HOME \
PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator

# comes from https://developer.android.com/studio/#command-tools
ENV ANDROID_SDK_TOOLS_VERSION 10406996
# see also https://stackoverflow.com/a/78890086/7009800
ARG android_clt_version=11479570
ARG jdk_version=17

ENV ANDROID_SDK_TOOLS_VERSION=${android_clt_version}
ENV JDK_PACKAGE="openjdk-${jdk_version}-jdk"

RUN set -o xtrace \
&& cd /opt \
&& apt-get update \
&& apt-get install -y jq \
&& apt-get install -y openjdk-17-jdk \
&& apt-get install -y ${JDK_PACKAGE} \
&& apt-get install -y sudo wget zip unzip git openssh-client curl bc software-properties-common build-essential ruby-full ruby-bundler libstdc++6 libpulse0 libglu1-mesa locales lcov libsqlite3-dev --no-install-recommends \
# for x86 emulators
&& apt-get install -y libxtst6 libnss3-dev libnspr4 libxss1 libasound2t64 libatk-bridge2.0-0 libgtk-3-0 libgdk-pixbuf2.0-0 \
Expand Down