mirror of
https://github.com/cirruslabs/macos-image-templates.git
synced 2026-09-30 03:42:04 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19a8271935 | ||
|
|
ba158f524c | ||
|
|
a34d6d3e51 | ||
|
|
59624221fe | ||
|
|
ac0d6efcf5 | ||
|
|
4e75d95247 | ||
|
|
7fcf10afd6 | ||
|
|
0f7f741d45 | ||
|
|
f0e06a7c5e | ||
|
|
21e5a3eb86 | ||
|
|
a2d379b619 | ||
|
|
5d00757016 | ||
|
|
04eaf0415f | ||
|
|
fc12391db4 | ||
|
|
62bb71fc2c | ||
|
|
4625de36fc | ||
|
|
7221de2158 | ||
|
|
3ac3ec803c | ||
|
|
620771594e | ||
|
|
a7907e34db |
+19
-12
@@ -1,5 +1,5 @@
|
|||||||
task:
|
task:
|
||||||
name: "Update Base Image"
|
name: "Update Images"
|
||||||
only_if: $CIRRUS_CRON != ""
|
only_if: $CIRRUS_CRON != ""
|
||||||
persistent_worker:
|
persistent_worker:
|
||||||
labels:
|
labels:
|
||||||
@@ -11,14 +11,22 @@ task:
|
|||||||
info_script:
|
info_script:
|
||||||
- tart --version
|
- tart --version
|
||||||
- packer --version
|
- packer --version
|
||||||
build_script:
|
env_script:
|
||||||
|
- echo "XCODE_VERSION=$(cat variables.pkrvars.hcl | grep xcode_version | awk '{print $(NF)}' | tr -d '\"')" >> $CIRRUS_ENV
|
||||||
|
build_base_script:
|
||||||
- packer init templates/base.pkr.hcl
|
- packer init templates/base.pkr.hcl
|
||||||
- packer build -var-file="variables.pkrvars.hcl" templates/base.pkr.hcl
|
- packer build -var-file="variables.pkrvars.hcl" templates/base.pkr.hcl
|
||||||
push_script:
|
build_xcode_script:
|
||||||
- tart push ventura-base ghcr.io/cirruslabs/macos-ventura-base:latest
|
- packer init templates/xcode.pkr.hcl
|
||||||
|
- packer build -var-file="variables.pkrvars.hcl" templates/xcode.pkr.hcl
|
||||||
|
push_base_script:
|
||||||
|
- tart push sonoma-base ghcr.io/cirruslabs/macos-sonoma-base:latest
|
||||||
|
push_xcode_script:
|
||||||
|
- tart push sonoma-xcode:$XCODE_VERSION ghcr.io/cirruslabs/macos-sonoma-xcode:$XCODE_VERSION ghcr.io/cirruslabs/macos-sonoma-xcode:latest
|
||||||
always:
|
always:
|
||||||
cleanup_script:
|
cleanup_script:
|
||||||
- tart delete ventura-base
|
- tart delete sonoma-base || true
|
||||||
|
- tart delete sonoma-xcode:$XCODE_VERSION || true
|
||||||
|
|
||||||
task:
|
task:
|
||||||
name: "Release Xcode $CIRRUS_TAG"
|
name: "Release Xcode $CIRRUS_TAG"
|
||||||
@@ -34,20 +42,19 @@ task:
|
|||||||
- tart --version
|
- tart --version
|
||||||
- packer --version
|
- packer --version
|
||||||
pull_base_script:
|
pull_base_script:
|
||||||
- tart pull ghcr.io/cirruslabs/macos-ventura-base:latest
|
- tart pull ghcr.io/cirruslabs/macos-sonoma-base:latest
|
||||||
- tart clone ghcr.io/cirruslabs/macos-ventura-base:latest ventura-base
|
- tart clone ghcr.io/cirruslabs/macos-sonoma-base:latest sonoma-base
|
||||||
build_script:
|
build_script:
|
||||||
- packer init templates/xcode.pkr.hcl
|
- packer init templates/xcode.pkr.hcl
|
||||||
- packer build -var-file="variables.pkrvars.hcl" -var xcode_version="$CIRRUS_TAG" templates/xcode.pkr.hcl
|
- packer build -var-file="variables.pkrvars.hcl" -var xcode_version="$CIRRUS_TAG" templates/xcode.pkr.hcl
|
||||||
push_script: |
|
push_script: |
|
||||||
if [[ $CIRRUS_TAG == *"beta"* ]]
|
if [[ $CIRRUS_TAG == *"beta"* ]]
|
||||||
then
|
then
|
||||||
tart push ventura-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-ventura-xcode:$CIRRUS_TAG
|
tart push sonoma-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-sonoma-xcode:$CIRRUS_TAG
|
||||||
else
|
else
|
||||||
tart push ventura-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-ventura-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
tart push sonoma-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-sonoma-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-sonoma-xcode:latest
|
||||||
fi
|
fi
|
||||||
-
|
|
||||||
always:
|
always:
|
||||||
cleanup_script:
|
cleanup_script:
|
||||||
- tart delete ventura-base || true
|
- tart delete sonoma-base || true
|
||||||
- tart delete ventura-xcode:$CIRRUS_TAG || true
|
- tart delete sonoma-xcode:$CIRRUS_TAG || true
|
||||||
|
|||||||
@@ -2,34 +2,24 @@
|
|||||||
|
|
||||||
Repository with Packer templates to build [Tart VMs](https://github.com/cirruslabs/tart) to use with [Cirrus CI](https://cirrus-ci.org/guide/macOS/).
|
Repository with Packer templates to build [Tart VMs](https://github.com/cirruslabs/tart) to use with [Cirrus CI](https://cirrus-ci.org/guide/macOS/).
|
||||||
|
|
||||||
* `macos-{monterey,ventura}-vanilla` image has nothing pre-installed
|
* `macos-{monterey,ventura,sonoma}-vanilla` image has nothing pre-installed
|
||||||
* `macos-{monterey,ventura}-base` image has only `brew` pre-installed
|
* `macos-{monterey,ventura,sonoma}-base` image has only `brew` pre-installed
|
||||||
* `macos-{monterey,ventura}-xcode:N` image is based on `macos-{monterey,ventura}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
|
* `macos-{monterey,ventura,sonoma}-xcode:N` image is based on `macos-{monterey,ventura}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
|
||||||
|
|
||||||
See a full list of VMs available on Cirrus CI [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
|
See a full list of VMs available on Cirrus CI [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
|
||||||
|
|
||||||
## Building Vanilla Image
|
## Building Vanilla Image
|
||||||
|
|
||||||
To build `macos-monterey-vanilla`:
|
To build `macos-sonoma-vanilla`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
packer build templates/vanilla-monterey.pkr.hcl
|
packer build templates/vanilla-sonoma.pkr.hcl
|
||||||
```
|
|
||||||
|
|
||||||
To build `macos-ventura-vanilla`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
packer build templates/vanilla-ventura.pkr.hcl
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Optionally, SIP can be disabled for each image by running the following commands:
|
Optionally, SIP can be disabled for each image by running the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
packer build -var vm_name=monterey-vanilla templates/disable-sip.pkr.hcl
|
packer build -var vm_name=sonoma-vanilla templates/disable-sip.pkr.hcl
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
packer build -var vm_name=ventura-vanilla templates/disable-sip.pkr.hcl
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building Base Image
|
## Building Base Image
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ variable "gha_version" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source "tart-cli" "tart" {
|
source "tart-cli" "tart" {
|
||||||
vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-vanilla:13.4"
|
vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-vanilla:latest"
|
||||||
vm_name = "${var.macos_version}-base"
|
vm_name = "${var.macos_version}-base"
|
||||||
cpu_count = 4
|
cpu_count = 4
|
||||||
memory_gb = 8
|
memory_gb = 8
|
||||||
@@ -45,13 +45,6 @@ build {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# setup DNS
|
|
||||||
provisioner "shell" {
|
|
||||||
inline = [
|
|
||||||
"networksetup -setdnsservers Ethernet 8.8.8.8 8.8.4.4 1.1.1.1",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create a symlink for bash compatibility
|
# Create a symlink for bash compatibility
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
@@ -112,6 +105,7 @@ build {
|
|||||||
}
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
|
"source ~/.zprofile",
|
||||||
"brew install awscli"
|
"brew install awscli"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ build {
|
|||||||
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
||||||
// Disable screensaver at login screen
|
// Disable screensaver at login screen
|
||||||
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
||||||
|
// Disable screensaver for admin user
|
||||||
|
"defaults -currentHost write com.apple.screensaver idleTime 0",
|
||||||
// Prevent the VM from sleeping
|
// Prevent the VM from sleeping
|
||||||
"sudo systemsetup -setdisplaysleep Off",
|
"sudo systemsetup -setdisplaysleep Off",
|
||||||
"sudo systemsetup -setsleep Off",
|
"sudo systemsetup -setsleep Off",
|
||||||
|
|||||||
@@ -8,12 +8,7 @@ packer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source "tart-cli" "tart" {
|
source "tart-cli" "tart" {
|
||||||
# Currently macOS 14 (Sonoma) can only be obtained via the following links:
|
from_ipsw = "https://updates.cdn-apple.com/2023FallFCS/fullrestores/002-81996/596571C1-9856-4BB3-B5BF-B5A48F4B406E/UniversalMac_14.0_23A339_Restore.ipsw"
|
||||||
# unauthenticated[1] and authenticated[2].
|
|
||||||
#
|
|
||||||
# [1]: https://updates.cdn-apple.com/2023SummerSeed/fullrestores/032-94355/CBE8CBE1-750D-487E-A393-B90FEF60CEBA/UniversalMac_14.0_23A5257q_Restore.ipsw
|
|
||||||
# [2]: https://download.developer.apple.com/WWDC_2023/macOS_14_Beta_Restore_Images/UniversalMac_14.0_23A5257q_Restore.ipsw
|
|
||||||
from_ipsw = "https://updates.cdn-apple.com/2023SummerSeed/fullrestores/032-94355/CBE8CBE1-750D-487E-A393-B90FEF60CEBA/UniversalMac_14.0_23A5257q_Restore.ipsw"
|
|
||||||
vm_name = "sonoma-vanilla"
|
vm_name = "sonoma-vanilla"
|
||||||
cpu_count = 4
|
cpu_count = 4
|
||||||
memory_gb = 8
|
memory_gb = 8
|
||||||
@@ -99,6 +94,8 @@ build {
|
|||||||
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
||||||
// Disable screensaver at login screen
|
// Disable screensaver at login screen
|
||||||
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
||||||
|
// Disable screensaver for admin user
|
||||||
|
"defaults -currentHost write com.apple.screensaver idleTime 0",
|
||||||
// Prevent the VM from sleeping
|
// Prevent the VM from sleeping
|
||||||
"sudo systemsetup -setdisplaysleep Off",
|
"sudo systemsetup -setdisplaysleep Off",
|
||||||
"sudo systemsetup -setsleep Off",
|
"sudo systemsetup -setsleep Off",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ packer {
|
|||||||
source "tart-cli" "tart" {
|
source "tart-cli" "tart" {
|
||||||
# You can find macOS IPSW URLs on various websites like https://ipsw.me/
|
# You can find macOS IPSW URLs on various websites like https://ipsw.me/
|
||||||
# and https://www.theiphonewiki.com/wiki/Beta_Firmware/Mac/13.x
|
# and https://www.theiphonewiki.com/wiki/Beta_Firmware/Mac/13.x
|
||||||
from_ipsw = "https://updates.cdn-apple.com/2023SpringFCS/fullrestores/032-84884/F97A22EE-9B5E-4FD5-94C1-B39DCEE8D80F/UniversalMac_13.4_22F66_Restore.ipsw"
|
from_ipsw = "https://updates.cdn-apple.com/2023SummerFCS/fullrestores/042-25658/2D6BE8DB-5549-4F85-8C54-39FC23BABC68/UniversalMac_13.5.1_22G90_Restore.ipsw"
|
||||||
vm_name = "ventura-vanilla"
|
vm_name = "ventura-vanilla"
|
||||||
cpu_count = 4
|
cpu_count = 4
|
||||||
memory_gb = 8
|
memory_gb = 8
|
||||||
@@ -96,6 +96,8 @@ build {
|
|||||||
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
|
||||||
// Disable screensaver at login screen
|
// Disable screensaver at login screen
|
||||||
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
|
||||||
|
// Disable screensaver for admin user
|
||||||
|
"defaults -currentHost write com.apple.screensaver idleTime 0",
|
||||||
// Prevent the VM from sleeping
|
// Prevent the VM from sleeping
|
||||||
"sudo systemsetup -setdisplaysleep Off",
|
"sudo systemsetup -setdisplaysleep Off",
|
||||||
"sudo systemsetup -setsleep Off",
|
"sudo systemsetup -setsleep Off",
|
||||||
@@ -113,6 +115,7 @@ build {
|
|||||||
// Note that this only works if the user is logged-in,
|
// Note that this only works if the user is logged-in,
|
||||||
// i.e. not on login screen.
|
// i.e. not on login screen.
|
||||||
"sysadminctl -screenLock off -password admin",
|
"sysadminctl -screenLock off -password admin",
|
||||||
|
"defaults -currentHost write com.apple.screensaver idleTime 0"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-8
@@ -8,19 +8,19 @@ packer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "macos_version" {
|
variable "macos_version" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "xcode_version" {
|
variable "xcode_version" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "gha_version" {
|
variable "gha_version" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "android_sdk_tools_version" {
|
variable "android_sdk_tools_version" {
|
||||||
type = string
|
type = string
|
||||||
default = "9477386" # https://developer.android.com/studio/#command-tools
|
default = "9477386" # https://developer.android.com/studio/#command-tools
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ build {
|
|||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
"source ~/.zprofile",
|
"source ~/.zprofile",
|
||||||
"brew install homebrew/cask-versions/temurin11",
|
"brew install homebrew/cask-versions/temurin17",
|
||||||
"echo 'export ANDROID_HOME=$HOME/android-sdk' >> ~/.zprofile",
|
"echo 'export ANDROID_HOME=$HOME/android-sdk' >> ~/.zprofile",
|
||||||
"echo 'export ANDROID_SDK_ROOT=$ANDROID_HOME' >> ~/.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",
|
"echo 'export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator' >> ~/.zprofile",
|
||||||
@@ -76,7 +76,7 @@ build {
|
|||||||
"rm android-sdk-tools.zip",
|
"rm android-sdk-tools.zip",
|
||||||
"mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest",
|
"mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest",
|
||||||
"yes | sdkmanager --licenses",
|
"yes | sdkmanager --licenses",
|
||||||
"yes | sdkmanager 'platform-tools' 'platforms;android-33' 'build-tools;33.0.1' 'ndk;25.1.8937393'"
|
"yes | sdkmanager 'platform-tools' 'platforms;android-33' 'build-tools;34.0.0' 'ndk;25.2.9519653'"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
@@ -138,13 +138,15 @@ build {
|
|||||||
"sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain",
|
"sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain",
|
||||||
"curl -o add-certificate.swift https://raw.githubusercontent.com/actions/runner-images/fb3b6fd69957772c1596848e2daaec69eabca1bb/images/macos/provision/configuration/add-certificate.swift",
|
"curl -o add-certificate.swift https://raw.githubusercontent.com/actions/runner-images/fb3b6fd69957772c1596848e2daaec69eabca1bb/images/macos/provision/configuration/add-certificate.swift",
|
||||||
"swiftc add-certificate.swift",
|
"swiftc add-certificate.swift",
|
||||||
|
"sudo mv ./add-certificate /usr/local/bin/add-certificate",
|
||||||
"curl -o AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer",
|
"curl -o AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer",
|
||||||
"curl -o DeveloperIDG2CA.cer https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer",
|
"curl -o DeveloperIDG2CA.cer https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer",
|
||||||
"sudo ./add-certificate AppleWWDRCAG3.cer",
|
"sudo add-certificate AppleWWDRCAG3.cer",
|
||||||
"sudo ./add-certificate DeveloperIDG2CA.cer",
|
"sudo add-certificate DeveloperIDG2CA.cer",
|
||||||
"rm add-certificate* *.cer"
|
"rm add-certificate* *.cer"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
"source ~/.zprofile",
|
"source ~/.zprofile",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
macos_version = "ventura"
|
macos_version = "sonoma"
|
||||||
gha_version = "2.303.0"
|
gha_version = "2.309.0"
|
||||||
xcode_version = "14.3"
|
xcode_version = "15"
|
||||||
|
|||||||
Reference in New Issue
Block a user