Self-hosted Apple Silicon CI
Hosting
CI is hosted on Scaleway (https://console.scaleway.com/). CI instance is at:
Compute > Apple Silicon => apple-silicon-build-1
You can then login using VNC or SSH
Documentation
- Agent is installed to
/Users/m1/vsts-agent-osx-x64-2.206.1directory - Docs on how to install AND USE azure pipelines agent https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-osx?view=azure-devops
- Our custom "MacOS (Scaleway)" agent pool https://dev.azure.com/circular-wave/_settings/agentpools?poolId=10&view=agents
- https://dev.azure.com/circular-wave
Tips:
- If the build is randomly failing, try deleting the contents of the
/Users/m1/vsts-agent-osx-x64-2.206.1/pipeline-agent-workdir-1/1/sdirectory. The build does not setup a completely clean
Changelog
9th August 2022 (Intial Machine Setup)
System Updates:
- Applied system updates (macOS 12.5 + xcode cli tools)
Graphical tools:
- Install iterm2 (from website)
- Install Sublime Text (from website)
- Install Sublime Merge (from website)
CLI tools:
- Install homebrew (using bash | sh from website) (prefix: /opt/homebrew)
- Added homebrew to path via .zprofile file
- Install zsh, git, micro, fastlane, htop, curl, cocoapods via homebrew
ASDF and Node.js:
- Install asdf via homebrew
- Add asdf to path via .zshrc file
- Add node plugin (
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git) echo “legacy_version_file = yes” > ~/.asdfrc- Run
asdf install nodejs 16.13.2 - Run
asdf global nodejs 16.13.2 - Install yarn, appcenter-cli, react-native-cli and detox-cli via
npm install -g - Add the same to
~/.default-npm-packagesfile so they're automatically installed when new node versions are installed
zsh:
- Install zsh via homebrew
- Add /opt/homebrew/bin/zsh to /etc/shells file
- Set default shell to /opt/homebrew/bin/zsh (
chsh -s /opt/homebrew/bin/zsh)
Xcode:
- Install Xcodes.app via brew cask
- Signed in Xcodes.app with my Apple ID via preferences
- Download Xcode 13.4.1 via Xcodes.app
- Set Xcode 13.4.1 as active via Xcodes.app
- Gave full disk access to Xcode, iTerm2, and /usr/bin/codesign in Preferences -> Security & Privacy -> Privacy -> Full Disk Access (https://github.com/CocoaPods/CocoaPods/issues/10298)
Azure Pipelines Agent:
- Followed instructions at https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-osx?view=azure-devops to create new agent pool and install agent
- User for agent is devops@circularwave.co.uk
- Extracted
vsts-agent-osx-x64-2.206.1.tarto/Users/m1 - Ran
./config.shand followed instructions to setup agent - Ran
./svc.sh installto create a launchd service for the agent - Add the following to and to
runsvc.shto setup PATH for the agent when running as service:export LC_ALL=en_US.UTF-8(required by fastlane)export LANG=en_US.UTF-8(required by fastlane). /opt/homebrew/opt/asdf/libexec/asdf.sh(ASDF PATH)eval "$(/opt/homebrew/bin/brew shellenv)"(brew PATH)
- Ran
./svc.sh startto start the agent service