From 95294c82addae853fe038997f32b7b7e953e2a82 Mon Sep 17 00:00:00 2001 From: Ziv Yaniv Date: Tue, 23 Jun 2026 16:16:34 -0400 Subject: [PATCH] Attempt to add macos arm build to the CI workflow. Adding macos arm to the set of GitHub runners and supported binary distributions. This currently fails on GitHub due to limited runner resources that result in "Cancelled after 360m". It is not an issue with macos-arm64 per-se, as the tests for this configuration on pass on the CircleCI runner. Keeping the code that renames the arm64 artifacts differently from the x86_64 artifacts for later use (expect this issue to be resolved with SimpleITK 3.0.0). --- .circleci/config.yml | 5 ++++- .github/workflows/main.yml | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e5cd8d..abfb41e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,10 @@ jobs: R_VERSION="<< parameters.r-version >>" # Install rig, R Installation Manager (https://github.com/r-lib/rig) to control installed R version if [ "$RUNNER_OS" == "macos" ]; then - brew install --cask r-lib/rig/rig + # Install specific version of rig (0.8.0) directly from GitHub releases + curl -L -o /tmp/rig.pkg https://github.com/r-lib/rig/releases/download/v0.8.0/rig-0.8.0-macOS-arm64.pkg + ls -lh /tmp/rig.pkg # Verify file exists and has reasonable size + sudo installer -pkg /tmp/rig.pkg -target / rig add $R_VERSION # on macOS the R package is installed into a MAJOR.MINOR directory # the PATCH is ignored (only one patch version supported) the diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index baf9e00..6a3cd35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,7 +96,13 @@ jobs: PKG_VERSION=$(Rscript -e "cat(read.dcf('DESCRIPTION', 'Version')[1])") if [[ "$RUNNER_OS" == "macOS" ]]; then - PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz" + # Detect architecture: arm64 or x86_64 + ARCH=$(uname -m) + if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then + PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-arm64.tgz" + else + PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz" + fi elif [[ "$RUNNER_OS" == "Linux" ]]; then PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_linux-x86_64.tar.gz" elif [[ "$RUNNER_OS" == "Windows" ]]; then