Skip to content

Commit 28cc1bb

Browse files
authored
Merge pull request #102 from zivy/addMacosArm
Add macos arm build to the CI workflow.
2 parents 983ab86 + 95294c8 commit 28cc1bb

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ jobs:
4141
R_VERSION="<< parameters.r-version >>"
4242
# Install rig, R Installation Manager (https://github.com/r-lib/rig) to control installed R version
4343
if [ "$RUNNER_OS" == "macos" ]; then
44-
brew install --cask r-lib/rig/rig
44+
# Install specific version of rig (0.8.0) directly from GitHub releases
45+
curl -L -o /tmp/rig.pkg https://github.com/r-lib/rig/releases/download/v0.8.0/rig-0.8.0-macOS-arm64.pkg
46+
ls -lh /tmp/rig.pkg # Verify file exists and has reasonable size
47+
sudo installer -pkg /tmp/rig.pkg -target /
4548
rig add $R_VERSION
4649
# on macOS the R package is installed into a MAJOR.MINOR directory
4750
# the PATCH is ignored (only one patch version supported) the

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ jobs:
9696
PKG_VERSION=$(Rscript -e "cat(read.dcf('DESCRIPTION', 'Version')[1])")
9797
9898
if [[ "$RUNNER_OS" == "macOS" ]]; then
99-
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz"
99+
# Detect architecture: arm64 or x86_64
100+
ARCH=$(uname -m)
101+
if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
102+
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-arm64.tgz"
103+
else
104+
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz"
105+
fi
100106
elif [[ "$RUNNER_OS" == "Linux" ]]; then
101107
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_linux-x86_64.tar.gz"
102108
elif [[ "$RUNNER_OS" == "Windows" ]]; then

0 commit comments

Comments
 (0)