mirror of
https://github.com/cirruslabs/macos-image-templates.git
synced 2026-09-30 03:42:04 +02:00
Compare commits
18
Commits
symlink-homes
...
16-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07be5a66be | ||
|
|
61f4dee507 | ||
|
|
fbcbf4cbfe | ||
|
|
c90679131d | ||
|
|
c9a92d7a31 | ||
|
|
2793f40e9a | ||
|
|
7a7778be0f | ||
|
|
6f7ef84825 | ||
|
|
d594e1add0 | ||
|
|
d50adeeaa2 | ||
|
|
5d1abcb935 | ||
|
|
8151177d8f | ||
|
|
2cd59ec2b4 | ||
|
|
2dcf12940d | ||
|
|
acd0ec5913 | ||
|
|
f2d703668c | ||
|
|
54a41a1e0a | ||
|
|
57a0eb2d30 |
+5
-5
@@ -62,12 +62,12 @@ task:
|
||||
env:
|
||||
matrix:
|
||||
- MACOS_VERSION: sonoma
|
||||
XCODE_VERSION: 15.3
|
||||
XCODE_VERSION: 15.4
|
||||
LATEST: true
|
||||
- MACOS_VERSION: sonoma
|
||||
XCODE_VERSION: 15.2
|
||||
XCODE_VERSION: 15.3
|
||||
- MACOS_VERSION: sonoma
|
||||
XCODE_VERSION: 15.1
|
||||
XCODE_VERSION: 15.2
|
||||
- MACOS_VERSION: ventura
|
||||
XCODE_VERSION: 14.3.1
|
||||
LATEST: true
|
||||
@@ -95,14 +95,14 @@ task:
|
||||
env:
|
||||
matrix:
|
||||
- MACOS_VERSION: sonoma
|
||||
XCODE_VERSIONS: 15.1,15.2,15.3
|
||||
XCODE_VERSIONS: 15.2,15.3,15.4
|
||||
only_if: $CIRRUS_TAG != "" || $CIRRUS_CRON == "weekly" # Every Sunday at 14 UTC
|
||||
<<: *defaults
|
||||
pull_base_script:
|
||||
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
|
||||
build_xcode_script:
|
||||
- packer init templates/xcode.pkr.hcl
|
||||
- packer build -var tag=runner -var disk_size=130 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl
|
||||
- packer build -var tag=runner -var disk_size=250 -var disk_free_mb=100000 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl
|
||||
push_script: |
|
||||
tart push "$MACOS_VERSION-xcode:runner" ghcr.io/cirruslabs/macos-runner:$MACOS_VERSION
|
||||
always:
|
||||
|
||||
+1
-1
@@ -21,5 +21,5 @@ packer build -var macos_version=sonoma templates/base.pkr.hcl
|
||||
## Building Xcode Image
|
||||
|
||||
```bash
|
||||
packer build -var macos_version=sonoma -var xcode_version=15.3 templates/xcode.pkr.hcl
|
||||
packer build -var macos_version=sonoma -var xcode_version="[15.4]" templates/xcode.pkr.hcl
|
||||
```
|
||||
@@ -24,7 +24,7 @@ monthly on the first Saturday of the month:
|
||||
|
||||
* `ghcr.io/cirruslabs/macos-{ventura,sonoma}-base`
|
||||
* `ghcr.io/cirruslabs/macos-ventura-xcode:{latest,14.3.1,14.2}`
|
||||
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{latest,15.3,15.2,15.1}`
|
||||
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{latest,15.4,15.3,15.2}`
|
||||
|
||||
Note that `ghcr.io/cirruslabs/macos-runner:sonoma` is updated every Sunday and this image is [optimised for startup](https://cirrus-runners.app/blog/2024/04/11/optimizing-startup-time-of-cirrus-runners/)
|
||||
on Cirrus Runners and Cirrus CI services.
|
||||
+24
-2
@@ -1,7 +1,7 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
tart = {
|
||||
version = ">= 1.2.0"
|
||||
version = ">= 1.12.0"
|
||||
source = "github.com/cirruslabs/tart"
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,10 @@ build {
|
||||
"source ~/.zprofile",
|
||||
"brew --version",
|
||||
"brew update",
|
||||
"brew install wget cmake gcc git-lfs jq gh gitlab-runner",
|
||||
"brew install curl wget unzip zip ca-certificates cmake gcc git-lfs jq yq gh gitlab-runner",
|
||||
"brew install --cask git-credential-manager",
|
||||
"git lfs install",
|
||||
"sudo softwareupdate --install-rosetta --agree-to-license"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -69,6 +71,16 @@ build {
|
||||
script = "scripts/install-actions-runner.sh"
|
||||
}
|
||||
|
||||
// Create a /Users/runner → /Users/admin symlink to support certain GitHub Actions
|
||||
// like ruby/setup-ruby that hard-code the "/Users/runner/hostedtoolcache" path[1]
|
||||
//
|
||||
// [1]: https://github.com/ruby/setup-ruby/blob/6bd3d993c602f6b675728ebaecb2b569ff86e99b/common.js#L268
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"sudo ln -s /Users/admin /Users/runner"
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
@@ -86,6 +98,8 @@ build {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"brew install node@20",
|
||||
"echo 'export PATH=\"/opt/homebrew/opt/node@20/bin:$PATH\"' >> ~/.zprofile",
|
||||
"source ~/.zprofile",
|
||||
"node --version",
|
||||
"npm install --global yarn",
|
||||
"yarn --version",
|
||||
@@ -107,4 +121,12 @@ build {
|
||||
provisioner "shell" {
|
||||
script = "scripts/automationmodetool.expect"
|
||||
}
|
||||
|
||||
// some other health checks
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"test -d /Users/runner"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
tart = {
|
||||
version = ">= 1.2.0"
|
||||
version = ">= 1.12.0"
|
||||
source = "github.com/cirruslabs/tart"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
tart = {
|
||||
version = ">= 1.2.0"
|
||||
version = ">= 1.12.0"
|
||||
source = "github.com/cirruslabs/tart"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
source "tart-cli" "tart" {
|
||||
from_ipsw = "https://updates.cdn-apple.com/2024WinterFCS/fullrestores/052-77579/4569734E-120C-4F31-AD08-FC1FF825D059/UniversalMac_14.4.1_23E224_Restore.ipsw"
|
||||
from_ipsw = "https://updates.cdn-apple.com/2024SpringFCS/fullrestores/062-01897/C874907B-9F82-4109-87EB-6B3C9BF1507D/UniversalMac_14.5_23F79_Restore.ipsw"
|
||||
vm_name = "sonoma-vanilla"
|
||||
cpu_count = 4
|
||||
memory_gb = 8
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
tart = {
|
||||
version = ">= 1.2.0"
|
||||
version = ">= 1.12.0"
|
||||
source = "github.com/cirruslabs/tart"
|
||||
}
|
||||
}
|
||||
|
||||
+54
-13
@@ -1,7 +1,7 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
tart = {
|
||||
version = ">= 1.2.0"
|
||||
version = ">= 1.12.0"
|
||||
source = "github.com/cirruslabs/tart"
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,12 @@ variable "tag" {
|
||||
|
||||
variable "disk_size" {
|
||||
type = number
|
||||
default = 90
|
||||
default = 100
|
||||
}
|
||||
|
||||
variable "disk_free_mb" {
|
||||
type = number
|
||||
default = 15000
|
||||
}
|
||||
|
||||
variable "android_sdk_tools_version" {
|
||||
@@ -43,6 +48,26 @@ source "tart-cli" "tart" {
|
||||
ssh_timeout = "120s"
|
||||
}
|
||||
|
||||
locals {
|
||||
xcode_install_provisioners = [
|
||||
for version in var.xcode_version : {
|
||||
type = "shell"
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"sudo xcodes install ${version} --experimental-unxip --path /Users/admin/Downloads/Xcode_${version}.xip --select --empty-trash",
|
||||
// get selected xcode path, strip /Contents/Developer and move to GitHub compatible locations
|
||||
"INSTALLED_PATH=$(xcodes select -p)",
|
||||
"CONTENTS_DIR=$(dirname $INSTALLED_PATH)",
|
||||
"APP_DIR=$(dirname $CONTENTS_DIR)",
|
||||
"sudo mv $APP_DIR /Applications/Xcode_${version}.app",
|
||||
"sudo xcode-select -s /Applications/Xcode_${version}.app",
|
||||
"xcodebuild -downloadAllPlatforms",
|
||||
"xcodebuild -runFirstLaunch",
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
build {
|
||||
sources = ["source.tart-cli.tart"]
|
||||
|
||||
@@ -52,8 +77,6 @@ build {
|
||||
"brew --version",
|
||||
"brew update",
|
||||
"brew upgrade",
|
||||
"brew install curl wget unzip zip ca-certificates",
|
||||
"sudo softwareupdate --install-rosetta --agree-to-license"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -62,10 +85,18 @@ build {
|
||||
script = "scripts/install-actions-runner.sh"
|
||||
}
|
||||
|
||||
// make sure our workaround from base is still valid
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"sudo ln -s /Users/admin /Users/runner || true"
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"brew install homebrew/cask-versions/temurin17",
|
||||
"brew install openjdk@17",
|
||||
"echo 'export PATH=\"/opt/homebrew/opt/openjdk@17/bin:$PATH\"' >> ~/.zprofile",
|
||||
"echo 'export ANDROID_HOME=$HOME/android-sdk' >> ~/.zprofile",
|
||||
"echo 'export ANDROID_SDK_ROOT=$ANDROID_HOME' >> ~/.zprofile",
|
||||
"echo 'export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator' >> ~/.zprofile",
|
||||
@@ -95,11 +126,12 @@ build {
|
||||
|
||||
// iterate over all Xcode versions and install them
|
||||
// select the latest one as the default
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
for version in var.xcode_version :
|
||||
"source ~/.zprofile && xcodes install ${version} --experimental-unxip --path /Users/admin/Downloads/Xcode_${version}.xip --select --empty-trash && xcodebuild -downloadAllPlatforms && xcodebuild -runFirstLaunch"
|
||||
]
|
||||
dynamic "provisioner" {
|
||||
for_each = local.xcode_install_provisioners
|
||||
labels = ["shell"]
|
||||
content {
|
||||
inline = provisioner.value.inline
|
||||
}
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
@@ -120,8 +152,10 @@ build {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"brew install libimobiledevice ideviceinstaller ios-deploy fastlane carthage",
|
||||
"brew install xcbeautify",
|
||||
"gem update",
|
||||
"gem install cocoapods",
|
||||
"gem install xcpretty",
|
||||
"gem uninstall --ignore-dependencies ffi && gem install ffi -- --enable-libffi-alloc"
|
||||
]
|
||||
}
|
||||
@@ -139,7 +173,6 @@ build {
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain",
|
||||
"curl -o AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer",
|
||||
"curl -o DeveloperIDG2CA.cer https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer",
|
||||
"curl -o add-certificate.swift https://raw.githubusercontent.com/actions/runner-images/fb3b6fd69957772c1596848e2daaec69eabca1bb/images/macos/provision/configuration/add-certificate.swift",
|
||||
@@ -157,13 +190,21 @@ build {
|
||||
]
|
||||
}
|
||||
|
||||
// check there is at least 20GB of free space and fail if not
|
||||
// check there is at least 15GB of free space and fail if not
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"df -h",
|
||||
"export FREE_MB=$(df -m | awk '{print $4}' | head -n 2 | tail -n 1)",
|
||||
"[[ $FREE_MB -gt 20000 ]] && echo OK || exit 1"
|
||||
"[[ $FREE_MB -gt ${var.disk_free_mb} ]] && echo OK || exit 1"
|
||||
]
|
||||
}
|
||||
|
||||
// some other health checks
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"source ~/.zprofile",
|
||||
"test -d /Users/runner"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user