Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions .github/workflows/check-sdk-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ jobs:
# are listed too), which then break the unattended Docker build when
# sdkmanager demands the separate Android SDK Preview license. The manifest
# carries reliable preview markers, so we parse it with a real XML parser
# and skip any package that is obsolete, carries a <codename> element, or
# uses the android-sdk-preview-license.
# and skip any package that is obsolete, carries a non-empty <codename>, or
# uses the android-sdk-preview-license. Stable platforms since android-37.0
# carry an EMPTY <codename></codename>, so only a non-empty one marks a preview.
if ! wget -q "https://dl.google.com/android/repository/repository2-3.xml" -O /tmp/android-repo.xml; then
echo "Failed to download SDK repository manifest"
echo "updated=false" >> $GITHUB_OUTPUT
Expand All @@ -126,7 +127,7 @@ jobs:
if pkg.get('obsolete') == 'true':
return True
for e in pkg.iter():
if local(e.tag) == 'codename':
if local(e.tag) == 'codename' and (e.text or '').strip():
return True
if local(e.tag) == 'uses-license' and e.get('ref') == 'android-sdk-preview-license':
return True
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ jobs:
RUNNER_TAG=$(grep -m1 '^ARG VERSION=' Dockerfile | cut -d= -f2)
RUNNER_VERSION=$(echo "$RUNNER_TAG" | cut -d- -f1)
COMPILE_SDK=$(grep -m1 '^ARG COMPILE_SDK=' Dockerfile | cut -d= -f2)
BUILD_TOOLS=$(grep -m1 '^ARG BUILD_TOOLS=' Dockerfile | cut -d= -f2)
NDK_VERSION=$(grep -m1 '^ARG NDK_VERSION=' Dockerfile | cut -d= -f2)

if [ -z "$RUNNER_TAG" ] || [ -z "$RUNNER_VERSION" ] || [ -z "$COMPILE_SDK" ]; then
if [ -z "$RUNNER_TAG" ] || [ -z "$RUNNER_VERSION" ] || [ -z "$COMPILE_SDK" ] || [ -z "$BUILD_TOOLS" ] || [ -z "$NDK_VERSION" ]; then
echo "::error::Failed to extract versions from Dockerfile"
exit 1
fi

echo "runner_tag=${RUNNER_TAG}" >> $GITHUB_OUTPUT
echo "runner_version=${RUNNER_VERSION}" >> $GITHUB_OUTPUT
echo "compile_sdk=${COMPILE_SDK}" >> $GITHUB_OUTPUT
echo "build_tools=${BUILD_TOOLS}" >> $GITHUB_OUTPUT
echo "ndk_version=${NDK_VERSION}" >> $GITHUB_OUTPUT

- name: Login to GitHub Container Registry
uses: docker/login-action@v4
Expand Down Expand Up @@ -136,14 +140,18 @@ jobs:
RUNNER_TAG=$(grep -m1 '^ARG VERSION=' Dockerfile | cut -d= -f2)
RUNNER_VERSION=$(echo "$RUNNER_TAG" | cut -d- -f1)
COMPILE_SDK=$(grep -m1 '^ARG COMPILE_SDK=' Dockerfile | cut -d= -f2)
BUILD_TOOLS=$(grep -m1 '^ARG BUILD_TOOLS=' Dockerfile | cut -d= -f2)
NDK_VERSION=$(grep -m1 '^ARG NDK_VERSION=' Dockerfile | cut -d= -f2)

if [ -z "$RUNNER_TAG" ] || [ -z "$RUNNER_VERSION" ] || [ -z "$COMPILE_SDK" ]; then
if [ -z "$RUNNER_TAG" ] || [ -z "$RUNNER_VERSION" ] || [ -z "$COMPILE_SDK" ] || [ -z "$BUILD_TOOLS" ] || [ -z "$NDK_VERSION" ]; then
echo "::error::Failed to extract versions from Dockerfile"
exit 1
fi

echo "runner_version=${RUNNER_VERSION}" >> $GITHUB_OUTPUT
echo "compile_sdk=${COMPILE_SDK}" >> $GITHUB_OUTPUT
echo "build_tools=${BUILD_TOOLS}" >> $GITHUB_OUTPUT
echo "ndk_version=${NDK_VERSION}" >> $GITHUB_OUTPUT

- name: Download digests
uses: actions/download-artifact@v8
Expand Down Expand Up @@ -172,6 +180,13 @@ jobs:
type=raw,value=node${{ matrix.node_version }},enable=${{ matrix.is_default_jdk }}
type=raw,value=jdk${{ matrix.java_version }}-node${{ matrix.node_version }}
type=raw,value=${{ steps.versions.outputs.runner_version }}-jdk${{ matrix.java_version }}-sdk${{ steps.versions.outputs.compile_sdk }}-node${{ matrix.node_version }}
# Same image, with the NDK it ships in the tag: consumers that pin an NDK (Android
# Gradle ndkVersion) can let Renovate derive it from this tag so image and NDK move together.
type=raw,value=${{ steps.versions.outputs.runner_version }}-jdk${{ matrix.java_version }}-sdk${{ steps.versions.outputs.compile_sdk }}-ndk${{ steps.versions.outputs.ndk_version }}-node${{ matrix.node_version }}
# Same image, with every Gradle-pinnable SDK component in the tag (compileSdk, build-tools,
# NDK), so consumers can let Renovate derive all three from one tag. The -sdk-ndk tag above
# stays for consumers already parsing it.
type=raw,value=${{ steps.versions.outputs.runner_version }}-jdk${{ matrix.java_version }}-sdk${{ steps.versions.outputs.compile_sdk }}-bt${{ steps.versions.outputs.build_tools }}-ndk${{ steps.versions.outputs.ndk_version }}-node${{ matrix.node_version }}
type=raw,value=latest,enable=${{ matrix.is_default_jdk && matrix.is_default_node }}

- name: Create manifest list and push
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG VERSION=2.338.0-ubuntu-noble
ARG JAVA_VERSION=21
ARG NODE_VERSION=24
ARG COMPILE_SDK=36.1
ARG COMPILE_SDK=37.2
ARG BUILD_TOOLS=37.0.0
ARG NDK_VERSION=30.0.16248370
ARG SDK_TOOLS=8512546_latest
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ Images are published to `ghcr.io/dodi-smart/github-runner`.
| `jdk21` | JDK major |
| `node22` | Node major |
| `jdk21-node22` | JDK and Node majors |
| `2.338.0-jdk21-sdk36-node24` | Everything: runner, JDK, SDK and Node. Never overwritten |
| `2.338.0-jdk21-sdk37.2-node24` | Everything: runner, JDK, SDK and Node. Never overwritten |
| `2.338.0-jdk21-sdk37.2-ndk30.0.16248370-node24` | Same image, NDK spelled out |
| `2.338.0-jdk21-sdk37.2-bt37.0.0-ndk30.0.16248370-node24` | Same image, build-tools and NDK spelled out |

The longer tags let a consumer have Renovate derive its Gradle `compileSdk`,
`buildToolsVersion` and `ndkVersion` from the image pin, so AGP doesn't download
SDK components on every job.

[`matrix.json`](matrix.json) lists the available JDK and Node versions and the
defaults. Each image sets `RUNNER_IMAGE_TAG` and `RUNNER_IMAGE_REVISION`, so a
Expand Down
Loading