From 86c6dc133ac68f3451a09e19d58bd3ba3e5e3452 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Thu, 19 Mar 2026 09:45:11 +0100 Subject: [PATCH] Extend "Build and Publish Python Package" workflow to build Linux aarch64 wheels Build Linux aarch64 wheels by extending the build_wheels job in the workflow to also run on an `ubuntu-22.04-arm` runner. In order for this to work, the commit also extends the `install-go.sh` helper architecture aware. --- .github/workflows/install-go.sh | 23 +++++++++++++++++++---- .github/workflows/publish-python.yml | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-go.sh b/.github/workflows/install-go.sh index 58589913..501c9ac7 100755 --- a/.github/workflows/install-go.sh +++ b/.github/workflows/install-go.sh @@ -6,19 +6,34 @@ set -euo pipefail +ARCH=$(uname -m) +case "${ARCH}" in + aarch64) + ARCH="arm64" + GO_DIST_SHA256='38ac33b4cfa41e8a32132de7a87c6db49277ab5c0de1412512484db1ed77637e' + ;; + x86_64) + ARCH="amd64" + GO_DIST_SHA256='6842c516ca66c89d648a7f1dbe28e28c47b61b59f8f06633eb2ceb1188e9251d' + ;; + *) + >&2 echo "Architecture ${ARCH} not supported by this script" + exit 1 + ;; +esac + TDIR="$(mktemp -d)" >&2 echo "Working dir: ${TDIR}" trap "rm -rf ${TDIR}" EXIT >&2 echo "Downloading Go 1.24.8 distribution file." -curl -fL -o "${TDIR}/go1.24.8.linux-amd64.tar.gz" 'https://go.dev/dl/go1.24.8.linux-amd64.tar.gz' +curl -fL -o "${TDIR}/go1.24.8.linux-${ARCH}.tar.gz" "https://go.dev/dl/go1.24.8.linux-${ARCH}.tar.gz" >&2 echo "Checking distribution file integrity" -GO_DIST_SHA256='6842c516ca66c89d648a7f1dbe28e28c47b61b59f8f06633eb2ceb1188e9251d' -printf '%s %s/go1.24.8.linux-amd64.tar.gz\n' "${GO_DIST_SHA256}" "${TDIR}" | sha256sum -c +printf '%s %s/go1.24.8.linux-%s.tar.gz\n' "${GO_DIST_SHA256}" "${TDIR}" "${ARCH}" | sha256sum -c >&2 echo "Unpacking to /usr/local/go" -rm -rf /usr/local/go && tar -C /usr/local -xzf "${TDIR}/go1.24.8.linux-amd64.tar.gz" +rm -rf /usr/local/go && tar -C /usr/local -xzf "${TDIR}/go1.24.8.linux-${ARCH}.tar.gz" >&2 echo "Installed Go version:" /usr/local/go/bin/go version diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 89b5fb3d..0297a729 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-14, macos-latest] + os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14, macos-latest] # Windows Wheel build doesn't work yet. # os: [windows-2022]