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