From e624d7c21972deacd862eaa41795fd3ef0068bb6 Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 5 Jun 2026 17:01:24 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20arch-specific=20runner=20labe?= =?UTF-8?q?ls=20for=20native=20amd64/arm64=20matrix=20builds=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detect the host architecture at container startup and prepend arch-specific labels to RUNNER_LABELS so matrix workflows can target native runners by architecture: runs-on: amd64 → dispatched to x86_64 runners runs-on: arm64 → dispatched to aarch64 runners runs-on: linux/amd64 / runs-on: linux/arm64 (OCI-style) On x86_64: adds amd64:host and linux/amd64:host On aarch64: adds arm64:host and linux/arm64:host This enables a dedicated ARM64 server running the same image to register native arm64 runners against the same Gitea instance, allowing full multi-arch matrix CI without emulation. - rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: detect arch, prepend arch labels to RUNNER_LABELS rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh --- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index c008181..76229ff 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -262,7 +262,17 @@ GITEA_USER="${GITEA_USER:-$SERVICE_USER}" INSTANCE_HOSTNAME="${GITEA_HOSTNAME:-$HOSTNAME}" RUNNERS_START="${RUNNERS_START:-5}" RUNNER_CACHE_PORT="${RUNNER_CACHE_PORT:-$SERVICE_PORT}" -RUNNER_LABELS="linux:host," +# Detect host architecture and set arch-specific labels so matrix jobs +# can target native runners: runs-on: amd64 / runs-on: arm64 +_HOST_ARCH="$(uname -m)" +case "$_HOST_ARCH" in + x86_64) _ARCH_LABEL="amd64" ;; + aarch64) _ARCH_LABEL="arm64" ;; + *) _ARCH_LABEL="$_HOST_ARCH" ;; +esac +RUNNER_LABELS="${_ARCH_LABEL}:host," +RUNNER_LABELS+="linux:host," +RUNNER_LABELS+="linux/${_ARCH_LABEL}:host," RUNNER_LABELS+="node14:docker://node:14," RUNNER_LABELS+="node16:docker://node:16," RUNNER_LABELS+="node18:docker://node:18," @@ -284,6 +294,7 @@ RUNNER_LABELS+="redhat:docker://casjaysdev/almalinux:latest," RUNNER_LABELS+="almalinux:docker://casjaysdev/almalinux:latest," RUNNER_LABELS+="act_runner:docker://catthehacker/ubuntu:full-latest," RUNNER_LABELS+="ubuntu-latest:docker://catthehacker/ubuntu:full-latest" +unset _HOST_ARCH _ARCH_LABEL # - - - - - - - - - - - - - - - - - - - - - - - - - RUNNER_IP_ADDRESS="${RUNNER_IP_ADDRESS:-$IP4_ADDRESS}" RUNNER_CONFIG_DEFAULT="${RUNNER_CONFIG_DEFAULT:-$ETC_DIR/default_config.yaml}"