Compare commits

...
164 Commits
Author SHA1 Message Date
Fedor KorotkovandChristoph Aldrian d7752dd971 Xcode 26.1 Release and 26.2 Beta (#298)
* Xcode 26.1 Release and 26.2 Beta

Plus installed tvOS 17.5 on Sequoia runner

* Update .ci/cirrus.runner.yml

Co-authored-by: Christoph Aldrian <caldrian@users.noreply.github.com>

* Updated expected runtimes

* Bump disk for Tahoe

* install `otel-cli`

---------

Co-authored-by: Christoph Aldrian <caldrian@users.noreply.github.com>
2025-11-08 09:26:25 -05:00
Fedor Korotkov 64b8b7407b macOS Tahoe 26.1 2025-11-04 08:44:11 -05:00
Fedor Korotkov 91c8fbf624 Do not auto-update Ventura 2025-11-01 12:01:55 -04:00
Fedor Korotkov aec76f172d Ruby 3.3.10 2025-11-01 12:00:49 -04:00
Fedor Korotkov a2b4e1ebfe Xcode 26.1-rc (#297)
* Xcode 26.1-rc

* Updated simulators
2025-11-01 10:41:03 -04:00
Fedor Korotkov 1f481f72c7 Xcode 26 Beta 3 (#296)
* Xcode 26 Beta 3

* Updated expected runtimes

* Removed iOS 26 due to

> iOS 26 is not available for download.

Seems only 26.0.1 is available.
2025-10-25 10:57:45 -04:00
Fedor Korotkov 463004bc84 Xcode 26 Beta 2 (#291)
* Xcode 26 Beta 2

* Updated expected runtimes

* new line
2025-10-10 12:27:20 -04:00
Fedor Korotkov 6755f3d245 Removed update (#293) 2025-10-10 20:25:46 +04:00
Nikolay Edigaryev aa8af495d1 README.md: update image descriptions (#289)
* README.md: update image descriptions

* Proper Xcode spelling
2025-09-29 15:57:11 +04:00
Fedor Korotkov 4232c64336 Remove asdf installation from base image (#290) 2025-09-29 07:44:04 -04:00
Fedor Korotkov f4565a71c7 Xcode 26.1 Beta (#286)
* Xcode 26.1 Beta

* Updated runtimes

* Bump disk
2025-09-26 10:33:06 -04:00
Fedor Korotkov 971a78c341 Xcode 16 on Sonoma (#287)
* Xcode 16 on Sonoma

* Updated runtimes

* Bump disk
2025-09-26 08:00:13 -04:00
Jakub Olejník 4f13a88f28 Use Terminal to open System settings on Tahoe (#283) 2025-09-25 21:04:19 +04:00
Fedor KorotkovandNikolay Edigaryev ba783a5bc7 Xcode 26.0.1 (#285)
* Xcode 26.0.1

* Update .ci/cirrus.runner.yml

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* Fixed build

---------

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
2025-09-25 09:10:25 -04:00
Fedor Korotkov db71c44bc1 Fixed syntax 2025-09-20 09:45:23 +02:00
Fedor Korotkov 5ed6926ec7 Fixed syntax 2025-09-20 09:40:41 +02:00
Fedor Korotkov 95ee5a5656 Pre-install asdf and mise (#284)
* Pre-install asdf

* Install mise
2025-09-19 06:30:06 -04:00
ea02816fa7 Xcode 26 Release (#281)
* Xcode 26 Release

Make it default for Sequoia runner.

* Update .ci/cirrus.runner.yml

Co-authored-by: Matouš Skála <skala.matous@gmail.com>

* Updated 23R353

* Update .ci/cirrus.runner.yml

Co-authored-by: Aleš Hanžlík <hanzlikale@gmail.com>

---------

Co-authored-by: Matouš Skála <skala.matous@gmail.com>
Co-authored-by: Aleš Hanžlík <hanzlikale@gmail.com>
2025-09-16 15:21:27 -04:00
Tony Arnold e6a57fc713 iOS Simulator Runtime 23A343 (#280) 2025-09-16 08:00:35 -04:00
Fedor Korotkov 17dc1dab05 Bumped all vanillas (#279) 2025-09-16 07:26:04 -04:00
Fedor Korotkov b86acf6821 No need to update Tahoe 2025-09-12 16:56:43 -04:00
Fedor Korotkov 537b590859 Tahoe runner (#278) 2025-09-11 22:10:21 -04:00
Fedor Korotkov 45c214692c Xcode 26 RC (#276)
* Xcode 26 RC

* Updated expected list
2025-09-09 17:33:00 -04:00
Fedor Korotkov b94738812f Fixed components 2025-09-07 14:32:40 -04:00
Fedor Korotkov 2d4e5b9968 macOS 26.0 beta 9 2025-09-02 15:07:24 -04:00
Fedor Korotkov 24607711dc Include XCODE_COMPONENTS on release cuts (#272)
* Include XCODE_COMPONENTS on release cuts

Fixes https://github.com/cirruslabs/macos-image-templates/issues/264#issuecomment-3242673167

* -var xcode_components
2025-09-01 12:01:22 -04:00
Nikolay Edigaryev 081c8ac4e3 vanilla-tahoe.pkr.hcl: adapt "boot_command" to recent installer changes (#271) 2025-08-29 11:15:40 -04:00
Fedor Korotkov d0f94cc4c8 Xcode 26 Beta 7 and macOS 26.0 beta 8 (#270)
* Xcode 26 Beta 7 and macOS 26.0 beta 8

* fixed syntax
2025-08-29 10:47:35 -04:00
fe19dc9f17 Install Metal toolchain for Xcode 26 and newer (#268)
* Install Metal toolchain when Xcode version is 26 or newer

* Define a variable rather than using a regex

* Provide the Xcode components as a list

* Use “shell” rather than “provisioner”

* Update .ci/cirrus.xcode.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-26 08:05:50 -04:00
Nikolay Edigaryev 6f8ae07451 Disable SIP on "-base" and "-xcode" images only (#269)
* Disable SIP on "-base" and "-xcode" images only

* Ventura needs DISABLE_SIP_TEMPLATE too
2025-08-26 00:17:00 +04:00
Fedor Korotkov 16a5100187 macOS Sequoia 15.6.1 (#267) 2025-08-20 15:45:07 -04:00
Fedor Korotkov 7058092d82 Xcode 26 Beta 6 and other updates (#266)
Related to #265
2025-08-20 14:08:27 -04:00
Fedor Korotkov 0d3b4f4efd Update latest betas (#259)
* Latest betas

* Ruby 3.3.9

* Updated simulators

* New line
2025-08-09 07:17:50 -04:00
Nikolay Edigaryev aad3ba254d vanilla-sequoia.pkr.hcl: upgrade IPSW from 15.5 to 15.6 (#261) 2025-08-07 06:32:08 -04:00
Nikolay Edigaryev 0c0a90071d vanilla-sonoma.pkr.hcl: use macOS Sonoma IPSW instead of Sequoia IPSW (#260) 2025-08-07 05:38:29 -04:00
Fedor Korotkov 276b6dde65 Include SwiftLint version in .setup_info (#258) 2025-08-04 12:27:24 -04:00
Fedor Korotkov 5e8c823ef0 Install all iOS packages after Xcode installation 2025-08-02 05:05:49 -04:00
Fedor Korotkov b6445b9d3a Xcode 26 Beta 4 (#256)
* Xcode 26 Beta 4

* Updated simulators

* Updated simulators

* Fixes after CI

* New line

* bring back 18.5

* bump disk
2025-08-02 04:48:25 -04:00
Fedor Korotkov ad9ce34d12 Install additional common packages (#257) 2025-08-01 15:14:46 -04:00
Fedor Korotkov 9746337eeb Sonoma 15.6 2025-07-29 17:08:48 -04:00
Fedor Korotkov f7880705ec All simulators for the last 3 versions of Xcode (#254) 2025-07-23 16:44:14 -04:00
Fedor Korotkov bc67673068 Update cirrus.runner.yml 2025-07-14 16:17:41 -04:00
Fedor Korotkov 393d7c615b Sonoma Xcode 15.4 (#253)
* Sonoma Xcode 15.4

* More disk

* watchOS 10.5 on sonoma

* Removed watchOS
2025-07-14 15:38:02 -04:00
Fedor Korotkov f292033e59 Fixed index out of bound 2025-07-14 14:43:21 -04:00
Fedor Korotkov e3cf995511 Xcode 26 Beta 3 (#251)
* Xcode 26 Beta 3

* Print disk sizes between Xcodes

* Tweak sizes

* Strip some simulators

* 17.5 for sonoma

* fixed expected runtimes

* Tweaked disk sizes
2025-07-11 15:01:42 -04:00
James Smith 3c3581a46f Update image to macOS 26 beta 3 (#250) 2025-07-08 00:45:56 -04:00
Fedor Korotkov 2fbdfd6186 Beta 1 runtimes 2025-07-07 08:14:11 +04:00
Fedor Korotkov a806b2d4ef Reverted to 26-beta 2025-07-07 08:09:46 +04:00
Fedor Korotkov c48cab887b Reverted to 26-beta-1 2025-07-07 08:06:34 +04:00
Fedor Korotkov d5d126deaa Revert "Updated runtimes"
This reverts commit ac6cbef9a6.
2025-07-07 08:06:28 +04:00
fedor ac6cbef9a6 Updated runtimes 2025-06-29 06:54:08 -07:00
Fedor Korotkov 9736671744 Xcode 26 Beta 2 (#249)
* Xcode 26 Beta 2

* Updated runtimes
2025-06-28 16:25:56 -07:00
Fedor Korotkov 2ec40d16cb macOS Tahoe Beta 2 (#248) 2025-06-24 10:39:45 -04:00
Nikolay Edigaryev ce496aa3ad Increase timeouts before "Select Your Country or Region" (#247)
...and "Welcome to Mac" screens.
2025-06-16 09:34:15 -04:00
fedor 660eac6ae0 Removed brew doctor
Because of Tahoe
2025-06-12 21:45:23 -07:00
fedor 530036c1bc Trigger vanilla 2025-06-12 18:05:15 -07:00
Fedor Korotkov 69ca3f729a Build base/xcode/runner variants for Tahoe (#245) 2025-06-12 16:23:41 -07:00
Nikolay Edigaryev e70eea50c4 Automated macOS 26 (Tahoe) installation (#244)
* Automated macOS 26 (Tahoe) installation

* Support "Command Line Tools beta  for Xcode-26.0" label

* account for "beta"
* preserve multiple spaces

* .ci/cirrus.vanilla.yml: add "MACOS_VERSION: tahoe"

* Disable SIP for Tahoe
2025-06-12 10:16:46 -07:00
Nikolay Edigaryev 3ac0f46b3e tart-guest-agent: specify TERM and set working directory to HOME (#243) 2025-06-12 00:08:06 +04:00
Fedor Korotkov 63e44895a7 New line 2025-06-09 16:27:39 -07:00
Fedor Korotkov c1d543be58 Xcode 26 beta (#241)
* Xcode 26 beta

* Updated Runtimes
2025-06-09 14:52:00 -07:00
fedor ca553f0b1d Fixed syntax 2025-05-31 10:50:39 -04:00
fedor b9ffc31440 Build runners on release 2025-05-31 10:48:36 -04:00
Fedor Korotkov 0b4954f232 Pre install swiftformat (#239) 2025-05-30 17:47:05 -04:00
Fedor Korotkov f2d0330eec Xcode 16.4 (#238) 2025-05-29 09:01:24 -04:00
Nikolay Edigaryev 6ae3ffd75f Tart Guest Agent: use component groups (#237) 2025-05-19 14:26:23 -04:00
fedor 64f4871059 400GB for runners 2025-05-18 09:56:13 -04:00
fedor 5f35113643 new line 2025-05-18 08:27:39 -04:00
fedor 9ec94173b3 Updated expected runtimes 2025-05-17 17:38:59 -04:00
fedor 0eafad7bcf Xcode 16.4-rc 2025-05-15 17:38:28 -04:00
Nikolay Edigaryev 1fd4c5e3ae xcode.pkr.hcl: increase default disk size from 100 to 120 GB (#235) 2025-05-13 15:23:45 +04:00
Fedor Korotkov cfed2eac90 macOS Sequoia 15.5 2025-05-12 15:49:46 -04:00
Nikolay Edigaryev 7be8facd36 Use separate log file for tart-guest-daemon (#234)
* Use separate log file for tart-guest-daemon

* Add /usr/sbin to PATH
2025-05-12 16:41:35 +04:00
fedor 6f66644628 Bring back iOS 17.5 2025-05-05 06:23:49 -04:00
fedor 2401e19f34 Updated runners push logic 2025-05-04 09:03:34 -04:00
Fedor Korotkov 1a09db706a Xcode 16.4-beta (#233) 2025-05-04 08:21:46 -04:00
Nikolay Edigaryev 99ef3f49c7 Split Tart Guest Agent invocations into daemon and agent variants (#232)
* Split Tart Guest Agent invocations into daemon and agent variants

* Write logs to /tmp, otherwise there are permission issues

* Correct use of ProgramArguments
2025-04-29 21:34:41 +04:00
Fedor Korotkov 7d267ec27b macOS 15.4.1 2025-04-23 18:02:50 -04:00
Fedor Korotkov 7dc9dd706d Add Xcode versions to .setup_info (#231) 2025-04-14 10:29:44 -04:00
Fedor Korotkov 6a21d56c86 Install fastlane via bundler (#228)
As recommended by docs and since we have newer Ruby version from rbenv
2025-04-08 11:09:50 -04:00
fedor f64d712020 Include Bundler Version 2025-04-07 17:50:58 -04:00
Nikolay Edigaryev 7b41df79bd base.pkr.hcl: install guest agent for Tart VMs (#227)
* base.pkr.hcl: install guest agent for Tart VMs

* Don't forget to "source ~/.zprofile" to have "brew" available
2025-04-08 00:03:09 +04:00
fedor bf4ddcee86 Update only Xcode 16+ 2025-04-06 19:55:53 -04:00
fedor 56a1ec662e Updated runtimes 2025-04-04 20:07:12 -04:00
fedor 1b15ebd8b2 Fixed format 2025-04-04 16:30:35 -04:00
fedor 1271f59338 Check runtimes 2025-04-04 15:31:46 -04:00
Stefan Mitterrutzner 3c4bbd340d swich to Xcode 16.3 release (#225) 2025-04-04 15:19:25 -04:00
Nikolay Edigaryev 92a5e245cc Adapt disable-sip.pkr.hcl for new "csrutil" version in macOS Sequoia (#226) 2025-04-02 00:25:01 +02:00
ec6a446fc1 Support macOS Sequoia 15.4 (#224)
* Support macOS Sequoia 15.4

* Navigate to "Sharing" and "Privacy & Security" through menu bar

System Settings's search box does not always work as intended.

* Choose "Only Download Automatically"

* Use "Managed via Tart" full user name

Co-authored-by: Fedor Korotkov <fedor@cirruslabs.org>

* Use "Managed via Tart" user full name

Co-authored-by: Fedor Korotkov <fedor@cirruslabs.org>

* macOS 15.4 RC 2

Co-authored-by: Brett Best <6104381+Brett-Best@users.noreply.github.com>

* Use macOS 15.4 release IPSW

Co-authored-by: Brett Best <6104381+Brett-Best@users.noreply.github.com>

---------

Co-authored-by: Fedor Korotkov <fedor@cirruslabs.org>
Co-authored-by: Brett Best <6104381+Brett-Best@users.noreply.github.com>
2025-03-31 22:34:07 +04:00
Nikolay Edigaryev 4206908127 vanilla-sequoia.pkr.hcl: disable Gatekeeper (#220)
* vanilla-sequoia.pkr.hcl: disable Gatekeeper

* Don't forget to enter sudo password

Since passwordless sudo is not yet enabled at this point.
2025-03-21 22:54:15 +04:00
fedor d42ba4a1e1 Additional iOS builds 2025-03-11 03:01:50 +04:00
fedor 005b272792 Additional iOS 18.2 runtime
Related https://github.com/cirruslabs/macos-image-templates/issues/219#issuecomment-2709774915
2025-03-10 19:51:22 +04:00
fedor ec0c478a02 Escape runtime 2025-03-10 14:07:10 +04:00
Fedor Korotkov ad419122b2 Bump disk size 2025-03-09 12:35:45 +04:00
fedor 2335029721 Xcode 16.3-beta-2 2025-03-08 14:41:16 +04:00
Sergio Pinheiro c3819d6d35 Fix syntax issue (#218) 2025-03-03 22:16:25 +04:00
Fedor Korotkov 1f9fdd5630 Xcode 16.3-beta-1 2025-02-21 15:15:56 -08:00
Fedor Korotkov 447a46c522 Integrate .setup_info tool (#216)
I generate the tool from the specs a few weeks ago using AI. This PR also is generated fully using AI.
2025-02-17 08:42:28 -08:00
Nikolay Edigaryev 345b223e76 Resolve the version of the VM image just built, not the one in the OCI (#217) 2025-02-16 20:28:00 +04:00
Nikolay Edigaryev 5f66cb1ca2 Use "-productVersion" instead of "--productVersion" to support Monterey (#215)
* Use "-productVersion" instead of "--productVersion" to support Monterey

* No need to relocate anything as we're starting from scratch (IPSW)
2025-02-16 01:03:05 +04:00
Nikolay Edigaryev 0542253d49 Ignore errors for "install available update" Ansible task (#213)
* Ignore errors for "install available update" Ansible task

* Do not fail when update_result is not defined
2025-02-13 17:07:58 -05:00
Nikolay Edigaryev cdc53f0a12 vanilla-monterey.pkr.hcl: remove duplicate extra_arguments (#212) 2025-02-12 18:39:37 +04:00
Nikolay Edigaryev 99e619e634 Increase vanilla VM images disk size from 40 to 50 GB and use "relocate" (#211) 2025-02-12 18:09:39 +04:00
Nikolay Edigaryev 946adbfc95 Use single instead of double quotes to avoid YAML syntax error (#210) 2025-02-12 03:39:32 +04:00
Nikolay Edigaryev e134909aa8 Provide a default when stdinpass variable is not set (#209) 2025-02-12 02:12:06 +04:00
Nikolay Edigaryev 998bbf8ca8 Parse available updates to avoid upgrading to the next macOS version (#208)
* Parse available updates to avoid upgrading to the next macOS version

* Do not override ANSIBLE_CONFIG with our ansible.cfg

Otherwise Packer + Ansible integration goes haywire.

Instead, only modify the required variables through ansible_env_vars.

* Support Monterey
2025-02-12 01:45:40 +04:00
Nikolay Edigaryev 5a55351c81 Use xargs fix for all vanilla images, not just Sequoia (#207) 2025-02-06 18:55:36 +04:00
Nikolay Edigaryev 64b1190f65 Only pass a single item to "softwareupdate --install" each time (#206) 2025-02-06 17:39:40 +04:00
Nikolay Edigaryev 4df29efc66 Run "softwareupdate" on vanilla images (#204)
* Run "softwareupdate" on vanilla images

* Install Command Line Tools for Xcode

* Run Ansible after password-less sudo is configured

* Don't use SFTP

* Fix Ansible playbook path

* No updates are available → No new software available

* stderr_lines → stderr

* Dynamically resolve MACOS_NUMBER
2025-02-01 01:23:11 +04:00
Fedor Korotkov b205e70322 macOS Sequoia 15.3 (#205) 2025-01-27 14:38:08 -05:00
Nikolay Edigaryev c18ef9c553 Use Slack workflows (#201)
* Use Slack workflows

* Use SLACK_WEBHOOK_URL
2025-01-14 23:47:30 +04:00
fedor cec270adb3 No software updates 2025-01-06 17:54:53 -05:00
fedor 6d14eaee8c Install recommended updates 2025-01-06 17:36:50 -05:00
Fedor Korotkov f1a9e22ed2 Fixed known host creation (#202)
`~/.ssh` should exist for `file` provisioner.
2025-01-06 14:35:10 -05:00
Fedor Korotkov 2545826772 Add github.com keys to ~/.ssh/known_hosts (#200)
* Add github.com keys to `~/.ssh/known_hosts`

* Static known hosts

* Fixed path
2025-01-06 09:54:14 -05:00
fedor 0b49ba6651 Xcode 16.2 2024-12-30 09:29:55 -05:00
jxlwqq e5474440fc Sequoia 15.2 (#199) 2024-12-28 05:31:37 -05:00
Nikolay Edigaryev 0c165a93d2 Compatibility with GitHub Actions Runner Images for /usr/local/bin (#198) 2024-12-11 19:56:48 +04:00
fedor d3ad77c873 Xcode 16.2 RC 2024-12-05 16:06:21 -05:00
Kevin M. Cox 40128d40e2 Update vanilla-sequoia.pkr.hcl (#196)
It looks like the tab sequence for the Time Zone screen changed in one of the releases after 15.0.

I've testing this key sequence manually and via a packer build and it works with macOS 15.1.1.
2024-12-05 01:27:54 +04:00
Fedor Korotkov 7920f0cda2 Include Xcode 15.1 in Somoma runner (#197)
We unintentionally pushed Xcode 16.1 variant for `sonoma-xcode` image. We plan to only include new versions of Xcode with Sequoia images.

Instead for removing the 16.1 artifact. Let's include it in the runner image for consistency.
2024-12-04 16:08:58 -05:00
Fedor Korotkov b3b4dafc83 Update cirrus.release.yml 2024-12-04 11:36:28 -05:00
fedor ae70c6052d Ignore curl failure 2024-11-26 10:18:40 -05:00
fedor 1ea5f77e35 Build Monterey 2024-11-26 09:02:31 -05:00
fedor 8392fd1b30 Xcode 16.2 Beta 3 2024-11-20 16:04:50 -05:00
Fedor Korotkov fdff7d8daf Sequoia 15.1.1 2024-11-19 22:15:26 -05:00
Michal Moczulski 6a01707630 Update Android dependencies (#195)
* Use latest stable versions of Android dependencies

* Fix link to Android command line tools
2024-11-13 09:05:09 -05:00
fedor 49718082b2 Updated disk sizes 2024-11-13 07:09:41 -05:00
Nikolay Edigaryev 5b17f4e264 Wait 30 minutes instead of 15 (#194)
Just to be sure.
2024-11-12 21:29:32 +04:00
Nikolay Edigaryev 14fb85f5b3 Disable apsd daemon and wait before shutting down (#193) 2024-11-12 21:26:35 +04:00
fedor c8a1e808b6 Xcode 16.2 Beta 2 2024-11-06 10:50:07 -05:00
Fedor Korotkov 8c1f0c213f Release Sequoia IPSW
Fixes #192
2024-11-04 13:43:48 -05:00
Fedor Korotkov 9875d24c4b Added 15.1 and 15.0.1 2024-11-03 22:37:22 -05:00
fedor 8425f62a71 Update one runner image at a time
So while the second one is building runners can download the first one.
2024-11-02 09:49:05 -04:00
fedor 7ebaf88c48 Include {15.1,15.0.1} into runner 2024-11-01 11:51:50 -04:00
fedor 639b46cb2f Update sonoma-xcode:{15.1,15.0.1} 2024-11-01 11:26:11 -04:00
fedor 77cc104d6d Updated release cadence to highlight supported Xcode version. 2024-10-31 15:55:48 -04:00
fedor 159d4c1c36 Xcode 16.1 2024-10-30 10:19:34 -07:00
fedor 2a0a476e3b Sequoia 15.1 2024-10-28 09:19:43 -07:00
fedor 74040f6870 Sort Xcodes to always install the freshest first
Seems it's leading to things like:

> Unable to connect to simulator.
2024-10-27 08:42:58 -07:00
fedor 9f061dacb4 Sort Xcodes to always install the freshest first
Seems it's leading to things like:

> Unable to connect to simulator.
2024-10-27 08:38:03 -07:00
Fedor Korotkov f8fd129df6 Xcode 16.2 Beta 1 2024-10-24 09:14:43 -07:00
fedor 80bedb81db Xcode 16.1 RC 2024-10-21 17:14:35 -04:00
fedor 7692f27396 Sequoia 15.1 RC 2024-10-21 17:10:02 -04:00
fedor 2bd3a78831 Quotes 2024-10-21 09:59:00 -04:00
fedor 39e0ccf2e4 Fixed command 2024-10-21 08:55:41 -04:00
fedor e3cad7e8c2 Reverse Xcode installation order 2024-10-21 07:21:43 -04:00
fedor 47f36a33f8 Retry downloads 2024-10-20 16:19:19 -04:00
fedor c198ef9957 Removed ADDITIONAL_RUNTIMES 2024-10-20 16:16:20 -04:00
fedor d038ed85d2 no only_if 2024-10-20 13:05:03 -04:00
fedor da102cc5e6 Additional runtimes 2024-10-20 12:36:59 -04:00
fedor b0520dfd1d Fixed empty runtimes 2024-10-20 11:27:03 -04:00
fedor 37c77845c8 Refactored release scripts 2024-10-19 11:14:07 -04:00
fedor 9a16028831 No additional_runtimes 2024-10-15 14:42:06 -04:00
fedor cd817762c5 Xcode 16.1 Beta 3 2024-10-15 14:40:31 -04:00
fedor 32c59db145 No additional runtimes 2024-10-06 20:44:48 -04:00
fedor 8dcd824d76 Default for additional_runtimes 2024-10-05 20:27:36 -04:00
Fedor Korotkov 200bc65efb Update vanilla-sequoia.pkr.hcl 2024-10-05 20:26:00 -04:00
Nikolay Edigaryev 74aca70ef6 Send Slack alerts on build failures (#189)
* Send Slack alerts on build failures

* Only send Slack notifications for failed cron builds
2024-10-01 14:54:02 -04:00
Fedor Korotkov 1e710b24b9 Pre-install gnupg (#188)
Useful for doing manual encription/decryption
2024-10-01 10:42:25 -04:00
Fedor Korotkov 26c6575d1c Add additional runtimes (#186) 2024-09-26 06:21:40 -04:00
Fedor Korotkov 63e491fbf8 Fixed version 2024-09-24 10:39:24 -04:00
Fedor Korotkov 600cb89e35 Start building Sequoia images (#184)
Only base the runner images. We are not planning to build per Xcode images to reduce amount of variants to support.

Related to #183
2024-09-19 10:45:24 -04:00
fedor dbde34c6a8 Reapply "Sonoma 14.6.1 (#170)" (#179)
This reverts commit 760e04e340.
2024-09-18 17:55:42 -07:00
27 changed files with 1124 additions and 219 deletions
+26
View File
@@ -0,0 +1,26 @@
task:
name: "Update Base Images ($MACOS_VERSION)"
alias: update-base
matrix:
- env:
MACOS_VERSION: sonoma
DISABLE_SIP_TEMPLATE: disable-sip.pkr.hcl
- env:
MACOS_VERSION: sequoia
DISABLE_SIP_TEMPLATE: disable-sip-with-username.pkr.hcl
- env:
MACOS_VERSION: tahoe
DISABLE_SIP_TEMPLATE: disable-sip-with-username.pkr.hcl
<<: *defaults
pull_vanilla_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-vanilla:latest
build_base_script:
- packer init templates/base.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" templates/base.pkr.hcl
disable_sip_script:
- packer build -var vm_name=$MACOS_VERSION-base "templates/${DISABLE_SIP_TEMPLATE}"
push_base_script:
- tart push $MACOS_VERSION-base ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
always:
cleanup_script:
- tart delete $MACOS_VERSION-base
+23
View File
@@ -0,0 +1,23 @@
task:
name: "Release Xcode $CIRRUS_TAG ($MACOS_VERSION)"
env:
XCODE_COMPONENTS: "MetalToolchain"
matrix:
- MACOS_VERSION: tahoe
- MACOS_VERSION: sequoia
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
build_script:
- packer init templates/xcode.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" -var xcode_version="[\"$CIRRUS_TAG\"]" -var xcode_components="[\"$XCODE_COMPONENTS\"]" templates/xcode.pkr.hcl
push_script: |
if [[ $CIRRUS_TAG == *"beta"* ]]
then
tart push $MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$CIRRUS_TAG
else
tart push $MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:latest
fi
always:
cleanup_script:
- tart delete $MACOS_VERSION-xcode:$CIRRUS_TAG || true
+41
View File
@@ -0,0 +1,41 @@
task:
name: "Update Runner Image ($MACOS_VERSION)"
execution_lock: runner-image-update
env:
matrix:
- MACOS_VERSION: sonoma
XCODE_VERSIONS: "16.1,16"
DISK_SIZE: 230
- MACOS_VERSION: sequoia
XCODE_VERSIONS: "\"26.0.1\",16.4,16.3,16.2,16.1,16"
ADDITIONAL_IOS_BUILDS: "18.5,18.4,18.2,17.5"
ADDITIONAL_TVOS_BUILDS: "17.5"
XCODE_COMPONENTS: "\"MetalToolchain\""
DISK_SIZE: 400
- MACOS_VERSION: tahoe
XCODE_VERSIONS: "26.1,\"26.0.1\",\"26.2-beta\""
XCODE_COMPONENTS: "\"MetalToolchain\""
DISK_SIZE: 280
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
init_xcode_script: packer init templates/xcode.pkr.hcl
build_xcode_script: |
packer build -var tag=runner -var disk_size=$DISK_SIZE \
-var disk_free_mb=100000 \
-var macos_version="$MACOS_VERSION" \
-var xcode_version="[$XCODE_VERSIONS]" \
-var additional_ios_builds="[$ADDITIONAL_IOS_BUILDS]" \
-var additional_tvos_builds="[$ADDITIONAL_TVOS_BUILDS]" \
-var xcode_components="[$XCODE_COMPONENTS]" \
-var expected_runtimes_file="data/expected.$MACOS_VERSION.runtimes.txt" \
templates/xcode.pkr.hcl
push_script: |
if [[ -z "$CIRRUS_PR" ]]; then
tart push "$MACOS_VERSION-xcode:runner" ghcr.io/cirruslabs/macos-runner:$MACOS_VERSION
else
echo "Skipping pushing for PR..."
fi
always:
cleanup_script:
- tart delete "$MACOS_VERSION-xcode:runner"
+27
View File
@@ -0,0 +1,27 @@
env:
RESOLVE_VM_NAME: "resolve-macos-number-task-id-${CIRRUS_TASK_ID}"
RESOLVE_FILE: "${RESOLVE_VM_NAME}.txt"
task:
name: "Update Vanilla Image ($MACOS_VERSION)"
env:
matrix:
- MACOS_VERSION: tahoe
- MACOS_VERSION: sequoia
- MACOS_VERSION: sonoma
- MACOS_VERSION: monterey
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-$MACOS_VERSION.pkr.hcl")
<<: *defaults
build_script:
- packer init templates/vanilla-$MACOS_VERSION.pkr.hcl
- packer build templates/vanilla-$MACOS_VERSION.pkr.hcl
resolve_macos_number_script:
- packer build -var vm_base_name=$MACOS_VERSION-vanilla -var vm_name=$RESOLVE_VM_NAME -var resolve_file=$RESOLVE_FILE templates/resolve-macos-number.pkr.hcl
- echo "MACOS_NUMBER=$(cat $RESOLVE_FILE)" >> $CIRRUS_ENV
- rm $RESOLVE_FILE
- tart delete $RESOLVE_VM_NAME
push_script:
- tart push $MACOS_VERSION-vanilla ghcr.io/cirruslabs/macos-$MACOS_VERSION-vanilla:latest ghcr.io/cirruslabs/macos-$MACOS_VERSION-vanilla:$MACOS_NUMBER
always:
cleanup_script:
- tart delete $MACOS_VERSION-vanilla
+43
View File
@@ -0,0 +1,43 @@
task:
name: "Update Xcode Images ($MACOS_VERSION $XCODE_VERSION)"
depends_on: update-base
env:
matrix:
- MACOS_VERSION: tahoe
XCODE_VERSION: "26.0.1"
XCODE_COMPONENTS: "MetalToolchain"
LATEST: true
- MACOS_VERSION: sequoia
XCODE_VERSION: 16.4
LATEST: true
- MACOS_VERSION: sequoia
XCODE_VERSION: 16.3
- MACOS_VERSION: sequoia
XCODE_VERSION: 16.2
- MACOS_VERSION: sequoia
XCODE_VERSION: 16.1
- MACOS_VERSION: sequoia
XCODE_VERSION: 16
- MACOS_VERSION: sonoma
XCODE_VERSION: 16.1
LATEST: true
- MACOS_VERSION: sonoma
XCODE_VERSION: 16
- MACOS_VERSION: sonoma
XCODE_VERSION: 15.4
<<: *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 macos_version="$MACOS_VERSION" -var xcode_version="[\"$XCODE_VERSION\"]" -var xcode_components="[$XCODE_COMPONENTS]" templates/xcode.pkr.hcl
push_script: |
if [[ -z "$LATEST" ]]
then
tart push "$MACOS_VERSION-xcode:$XCODE_VERSION" ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$XCODE_VERSION
else
tart push "$MACOS_VERSION-xcode:$XCODE_VERSION" ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$XCODE_VERSION ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:latest
fi
always:
cleanup_script:
- tart delete "$MACOS_VERSION-xcode:$XCODE_VERSION"
+49 -4
View File
@@ -1,7 +1,52 @@
load("cirrus", "env", "http", "fs", "changes_include")
load("github.com/cirrus-modules/graphql", "rerun_task_if_issue_in_logs")
def on_task_failed(ctx):
if ctx.payload.data.task.automaticReRun:
print("Task is already an automatic re-run! Won't even try to re-run it...")
return
rerun_task_if_issue_in_logs(ctx.payload.data.task.id, "The network connection was lost")
if ctx.payload.data.task.automaticReRun:
print("Task is already an automatic re-run! Won't even try to re-run it...")
return
rerun_task_if_issue_in_logs(ctx.payload.data.task.id, "The network connection was lost")
def on_build_failed(ctx):
# Only send Slack notifications for failed cron builds[1]
#
# [1]: https://cirrus-ci.org/guide/writing-tasks/#cron-builds
if "Cron" not in ctx.payload.data.build.changeMessageTitle:
return
resp = http.post(env.get("SLACK_WEBHOOK_URL"), headers={
"Content-Type": "application/json",
}, json_body={
"text": "Build {build_id} (\"{change_message_title}\") failed on branch \"{branch_name}\" in repository \"{repository_name}\".".format(
build_id=ctx.payload.data.build.id,
change_message_title=ctx.payload.data.build.changeMessageTitle,
branch_name=ctx.payload.data.build.branch,
repository_name=ctx.payload.data.repository.name,
),
"url": "https://cirrus-ci.com/build/{build_id}".format(
build_id=ctx.payload.data.build.id,
),
})
if resp.status_code != 200:
fail("failed to post message to Slack: got unexpected HTTP {}".format(resp.status_code))
resp_json = resp.json()
if resp_json["ok"] != True:
fail("got error when posting message to Slack: {}".format(resp_json["error"]))
def main(ctx):
result = fs.read(".ci/cirrus.vanilla.yml")
if env.get("CIRRUS_TAG") != None:
result += fs.read(".ci/cirrus.release.yml")
if env.get("CIRRUS_CRON") == "monthly":
result += fs.read(".ci/cirrus.base.yml")
result += fs.read(".ci/cirrus.xcode.yml")
prForRunners = env.get("CIRRUS_PR") and changes_include(".ci/cirrus.runner.yml")
if prForRunners or env.get("CIRRUS_TAG") != None:
result += fs.read(".ci/cirrus.runner.yml")
return result
-141
View File
@@ -13,147 +13,6 @@ env:
defaults: &defaults
timeout_in: 3h
update_script:
- brew update || true
- brew upgrade || true
info_script:
- tart --version
- packer --version
task:
name: "Update Vanilla Sonoma Image"
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sonoma.pkr.hcl")
<<: *defaults
build_script:
- packer init templates/vanilla-sonoma.pkr.hcl
- packer build templates/vanilla-sonoma.pkr.hcl
disable_sip_script:
- packer build -var vm_name=sonoma-vanilla templates/disable-sip.pkr.hcl
push_script:
- tart push sonoma-vanilla ghcr.io/cirruslabs/macos-sonoma-vanilla:latest ghcr.io/cirruslabs/macos-sonoma-vanilla:14.6.1
always:
cleanup_script:
- tart delete sonoma-vanilla
task:
name: "Update Vanilla Sequoia Image"
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sequoia.pkr.hcl")
<<: *defaults
build_script:
- packer init templates/vanilla-sequoia.pkr.hcl
- packer build templates/vanilla-sequoia.pkr.hcl
disable_sip_script:
- packer build -var vm_name=sequoia-vanilla templates/disable-sip.pkr.hcl
push_script:
- tart push sequoia-vanilla ghcr.io/cirruslabs/macos-sequoia-vanilla:latest ghcr.io/cirruslabs/macos-sequoia-vanilla:15.0-rc
always:
cleanup_script:
- tart delete sequoia-vanilla
task:
name: "Update Vanilla Sequoia Beta Image"
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sequoia-beta.pkr.hcl")
<<: *defaults
build_script:
- packer init templates/vanilla-sequoia-beta.pkr.hcl
- packer build templates/vanilla-sequoia-beta.pkr.hcl
disable_sip_script:
- packer build -var vm_name=sequoia-vanilla templates/disable-sip.pkr.hcl
push_script:
- tart push sequoia-vanilla ghcr.io/cirruslabs/macos-sequoia-vanilla:15.1-beta-3
always:
cleanup_script:
- tart delete sequoia-vanilla
task:
name: "Update Base Images ($MACOS_VERSION)"
alias: update-base
matrix:
- env:
MACOS_VERSION: sonoma
only_if: $CIRRUS_CRON == "monthly"
<<: *defaults
pull_vanilla_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-vanilla:latest
build_base_script:
- packer init templates/base.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" templates/base.pkr.hcl
push_base_script:
- tart push $MACOS_VERSION-base ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
always:
cleanup_script:
- tart delete $MACOS_VERSION-base
task:
name: "Update Xcode Images ($MACOS_VERSION $XCODE_VERSION)"
depends_on: update-base
only_if: $CIRRUS_CRON == "monthly" # Every first Saturday of a month at 14 UTC
env:
matrix:
- MACOS_VERSION: sonoma
XCODE_VERSION: 15.4
LATEST: true
- MACOS_VERSION: sonoma
XCODE_VERSION: 15.3
- MACOS_VERSION: sonoma
XCODE_VERSION: 15.2
- MACOS_VERSION: sonoma
XCODE_VERSION: 16
<<: *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 macos_version="$MACOS_VERSION" -var xcode_version="[\"$XCODE_VERSION\"]" templates/xcode.pkr.hcl
push_script: |
if [[ -z "$LATEST" ]]
then
tart push "$MACOS_VERSION-xcode:$XCODE_VERSION" ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$XCODE_VERSION
else
tart push "$MACOS_VERSION-xcode:$XCODE_VERSION" ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$XCODE_VERSION ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:latest
fi
always:
cleanup_script:
- tart delete "$MACOS_VERSION-xcode:$XCODE_VERSION"
task:
name: "Update Runner Image ($MACOS_VERSION)"
env:
matrix:
- MACOS_VERSION: sonoma
XCODE_VERSIONS: 16,15.2,15.3,15.4
only_if: $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=300 -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:
cleanup_script:
- tart delete "$MACOS_VERSION-xcode:runner"
task:
name: "Release Xcode $CIRRUS_TAG ($MACOS_VERSION)"
only_if: $CIRRUS_TAG != ""
matrix:
- env:
MACOS_VERSION: sonoma
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
build_script:
- packer init templates/xcode.pkr.hcl
- packer build -var macos_version="$MACOS_VERSION" -var xcode_version="[\"$CIRRUS_TAG\"]" templates/xcode.pkr.hcl
push_script: |
if [[ $CIRRUS_TAG == *"beta"* ]]
then
tart push $MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$CIRRUS_TAG
else
tart push $MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:$CIRRUS_TAG ghcr.io/cirruslabs/macos-$MACOS_VERSION-xcode:latest
fi
always:
cleanup_script:
- tart delete $MACOS_VERSION-xcode:$CIRRUS_TAG || true
+8 -13
View File
@@ -5,26 +5,21 @@ Repository with Packer templates to build macOS [Tart](https://tart.run/) virtua
The following image variants are currently available:
* `macos-{sequoia,sonoma}-base` image has only `brew` pre-installed and the latest version of `macOS` available
* `macos-{sequoia,sonoma}-xcode:N` image is based on `macos-{sequoia,sonoma}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
* `macos-runner:sonoma` image is a variant of `xcode:N` with 3 latest versions of `Xcode` pre-installed and [`xcodes` tool](https://github.com/XcodesOrg/xcodes) to switch between them.
* `macos-{tahoe,sequoia,sonoma}-vanilla` — a vanilla macOS installation with helpful tweaks such as auto-login, but no additional software preinstalled
* `macos-{tahoe,sequoia,sonoma}-base` — based on `macos-{tahoe,sequoia,sonoma}-vanilla` image, it comes with `brew` and [other useful software](https://github.com/cirruslabs/macos-image-templates/blob/main/templates/base.pkr.hcl) pre-installed, but without Xcode
* `macos-{tahoe,sequoia,sonoma}-xcode:N` — based on `macos-{tahoe,sequoia,sonoma}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
* `macos-runner:{tahoe,sequoia,sonoma}` — a variant of `xcode:N` with several versions of `Xcode` pre-installed and [`xcodes` tool](https://github.com/XcodesOrg/xcodes) to switch between them.
See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
## Release Cadence
Once a new version of Xcode is released, we will initiate a GitHub release which will automatically build and push
a new version of the `macos-{sequoia,sonoma}-xcode:N` image as well as `macos-runner:sonoma`. This generally happens within 24 hours
of a release. Please watch this repository releases to get notified about new images.
a new version of the `macos-{tahoe,sequoia}-xcode:N`. This generally happens the next weekend after a release.
Please watch this repository releases to get notified about new images.
## Update Cadence
Some of the images are regularly getting rebuild in order to update the pre-installed packages. The following images are updated
monthly on the first Saturday of the month:
Some of the images are regularly getting rebuild in order to update the pre-installed packages.
* `ghcr.io/cirruslabs/macos-{sequoia,sonoma}-base`
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{16-beta,latest,15.4,15.3,15.2}`
* `ghcr.io/cirruslabs/macos-sequoia-xcode:{16-beta}`
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.
[This configuration file](.ci/cirrus.release.yml) defines images that are getting rebuilt monthly on the first Saturday of the month.
+5
View File
@@ -0,0 +1,5 @@
- hosts: default
roles:
- system-updater
vars:
ansible_password: admin
@@ -0,0 +1,37 @@
- name: Perform first "softwareupdate" invocation
include_tasks: softwareupdate.yml
# Needed after a major macOS update, otherwise things like
# Command Line Tools won't be updated
- name: Perform second "softwareupdate" invocation
include_tasks: softwareupdate.yml
# This one looks weird, but unfortunately there's no other way around, because Homebrew
# is not designed to run as root (see https://gist.github.com/irazasyed/7732946
# for more details).
- name: fix up /usr/local permissions for Homebrew
file:
path: /usr/local/share/man
state: directory
owner: "{{ ansible_user_id }}"
recurse: yes
become: yes
- name: "ensure that there are no more software updates available: check for available updates"
command:
cmd: "softwareupdate --all --list"
register: software_updates_result
- name: "ensure that there are no more software updates available: parse available updates"
set_fact:
software_updates: "{{ software_updates_result.stdout | regex_findall('\\* Label: (.*)\\n\\tTitle: (.*), Version: (.*), Size: (.*), Recommended: (.*), Action: (.*), .*') | map('zip', ['label', 'title', 'version', 'size', 'recommended', 'action']) | map('map', 'reverse') | map('community.general.dict') }}"
- name: "ensure that there are no more software updates available: print available updates"
debug:
var: software_updates
- name: "ensure that there are no more software updates available: fail if some updates were not installed"
fail:
msg: "Found unapplied update: {{ item.label }}"
loop: "{{ software_updates }}"
when: "not item.label.startswith('macOS') or item.version.split('.')[0] == ansible_facts['distribution_version'].split('.')[0]"
@@ -0,0 +1,43 @@
- name: check for available updates
command:
cmd: "softwareupdate --all --list"
register: software_updates_result
- name: parse available updates
set_fact:
software_updates: "{{ software_updates_result.stdout | regex_findall('\\* Label: (.*)\\n\\tTitle: (.*), Version: (.*), Size: (.*), Recommended: (.*), Action: (.*), .*') | map('zip', ['label', 'title', 'version', 'size', 'recommended', 'action']) | map('map', 'reverse') | map('community.general.dict') }}"
- name: print available updates
debug:
var: software_updates
# It seems that we must always pass "--restart" command-line argument to "softwareupdate",
# otherwise on the OS update the "softwareupdate" will be stuck at "Downloaded: macOS [...]"
- name: install available update
command:
cmd: "softwareupdate --install --agree-to-license --force --restart --user admin --stdinpass {{ stdinpass | default('') }} '{{ item.label }}'"
stdin: "{{ ansible_password }}"
register: update_result
# Work around the following:
# > Data could not be sent to remote host [...].
# > Make sure this host can be reached over ssh:
# > ssh: connect to host [...] port 22: Connection refused.
ignore_unreachable: yes
# Ignore SIGTERM/SIGKILL sent "softwareupdate" process
# when the system reboots due to --restart and any other errors,
# since we'll check whether the update was installed in main.yml
# anyway.
ignore_errors: yes
become: yes
loop: "{{ software_updates }}"
when: "not item.label.startswith('macOS') or item.version.split('.')[0] == ansible_facts['distribution_version'].split('.')[0]"
# Wait for the connection since the previous command could restart the host
- name: wait for connection
wait_for_connection:
# We need to wait long enough for the "softwareupdate" to initiate the reboot,
# otherwise it's possible that we'll interrupt the process by running
# the commands below on a non-restarted system.
delay: 60
timeout: 1800
when: update_result is defined and not update_result.skipped | default(false)
+20
View File
@@ -0,0 +1,20 @@
== Runtimes ==
iOS 17.5 (17.5 - 21F79) - com.apple.CoreSimulator.SimRuntime.iOS-17-5
iOS 18.0 (18.0 - 22A3351) - com.apple.CoreSimulator.SimRuntime.iOS-18-0
iOS 18.1 (18.1 - 22B81) - com.apple.CoreSimulator.SimRuntime.iOS-18-1
iOS 18.2 (18.2 - 22C150) - com.apple.CoreSimulator.SimRuntime.iOS-18-2
iOS 18.3 (18.3.1 - 22D8075) - com.apple.CoreSimulator.SimRuntime.iOS-18-3
iOS 18.4 (18.4 - 22E238) - com.apple.CoreSimulator.SimRuntime.iOS-18-4
iOS 18.5 (18.5 - 22F77) - com.apple.CoreSimulator.SimRuntime.iOS-18-5
iOS 18.6 (18.6 - 22G86) - com.apple.CoreSimulator.SimRuntime.iOS-18-6
iOS 26.0 (26.0.1 - 23A8464) - com.apple.CoreSimulator.SimRuntime.iOS-26-0
tvOS 17.5 (17.5 - 21L569) - com.apple.CoreSimulator.SimRuntime.tvOS-17-5
tvOS 18.4 (18.4 - 22L254) - com.apple.CoreSimulator.SimRuntime.tvOS-18-4
tvOS 18.5 (18.5 - 22L572) - com.apple.CoreSimulator.SimRuntime.tvOS-18-5
tvOS 26.0 (26.0 - 23J352) - com.apple.CoreSimulator.SimRuntime.tvOS-26-0
watchOS 11.4 (11.4 - 22T250) - com.apple.CoreSimulator.SimRuntime.watchOS-11-4
watchOS 11.5 (11.5 - 22T572) - com.apple.CoreSimulator.SimRuntime.watchOS-11-5
watchOS 26.0 (26.0 - 23R353) - com.apple.CoreSimulator.SimRuntime.watchOS-26-0
visionOS 2.4 (2.4 - 22O237) - com.apple.CoreSimulator.SimRuntime.xrOS-2-4
visionOS 2.5 (2.5 - 22O473) - com.apple.CoreSimulator.SimRuntime.xrOS-2-5
visionOS 26.0 (26.0 - 23M336) - com.apple.CoreSimulator.SimRuntime.xrOS-26-0
+9
View File
@@ -0,0 +1,9 @@
== Runtimes ==
iOS 18.0 (18.0 - 22A3351) - com.apple.CoreSimulator.SimRuntime.iOS-18-0
iOS 18.1 (18.1 - 22B81) - com.apple.CoreSimulator.SimRuntime.iOS-18-1
tvOS 18.0 (18.0 - 22J356) - com.apple.CoreSimulator.SimRuntime.tvOS-18-0
tvOS 18.1 (18.1 - 22J578) - com.apple.CoreSimulator.SimRuntime.tvOS-18-1
watchOS 11.0 (11.0 - 22R349) - com.apple.CoreSimulator.SimRuntime.watchOS-11-0
watchOS 11.1 (11.1 - 22R581) - com.apple.CoreSimulator.SimRuntime.watchOS-11-1
visionOS 2.0 (2.0 - 22N318) - com.apple.CoreSimulator.SimRuntime.xrOS-2-0
visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1
+13
View File
@@ -0,0 +1,13 @@
== Runtimes ==
iOS 26.0 (26.0.1 - 23A8464) - com.apple.CoreSimulator.SimRuntime.iOS-26-0
iOS 26.1 (26.1 - 23B80) - com.apple.CoreSimulator.SimRuntime.iOS-26-1
iOS 26.2 (26.2 - 23C5027f) - com.apple.CoreSimulator.SimRuntime.iOS-26-2
tvOS 26.0 (26.0 - 23J352) - com.apple.CoreSimulator.SimRuntime.tvOS-26-0
tvOS 26.1 (26.1 - 23J579) - com.apple.CoreSimulator.SimRuntime.tvOS-26-1
tvOS 26.2 (26.2 - 23K5029e) - com.apple.CoreSimulator.SimRuntime.tvOS-26-2
watchOS 26.0 (26.0 - 23R353) - com.apple.CoreSimulator.SimRuntime.watchOS-26-0
watchOS 26.1 (26.1 - 23S36) - com.apple.CoreSimulator.SimRuntime.watchOS-26-1
watchOS 26.2 (26.2 - 23S5280e) - com.apple.CoreSimulator.SimRuntime.watchOS-26-2
visionOS 26.0 (26.0 - 23M336) - com.apple.CoreSimulator.SimRuntime.xrOS-26-0
visionOS 26.1 (26.1 - 23N47) - com.apple.CoreSimulator.SimRuntime.xrOS-26-1
visionOS 26.2 (26.2 - 23N5279e) - com.apple.CoreSimulator.SimRuntime.xrOS-26-2
+3
View File
@@ -0,0 +1,3 @@
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
+52
View File
@@ -0,0 +1,52 @@
[
{
"group": "Runner Detail",
"detail": [
{
"name": "OS Information",
"script": "echo \"macOS $(sw_vers -productVersion) ($(sw_vers -buildVersion))\""
},
{
"name": "Build Date",
"script": "date +\"%Y-%m-%d\""
}
]
},
{
"group": "Software Detail",
"detail": [
{
"name": "Xcode Versions",
"script": "xcodes installed --no-color || echo \"Xcode not installed\""
},
{
"name": "Python Version",
"script": "python3 --version"
},
{
"name": "Node Version",
"script": "node --version"
},
{
"name": "Ruby Version",
"script": "ruby --version"
},
{
"name": "Bundler Version",
"script": "bundler --version"
},
{
"name": "CocoaPods Version",
"script": "pod --version"
},
{
"name": "Fastlane Version",
"script": "fastlane --version"
},
{
"name": "SwiftLint Version",
"script": "swiftlint --version"
}
]
}
]
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.cirruslabs.tart-guest-agent</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/tart-guest-agent</string>
<string>--run-agent</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/bin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/homebrew/bin</string>
<key>TERM</key>
<string>xterm-256color</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/admin</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/tart-guest-agent.log</string>
<key>StandardErrorPath</key>
<string>/tmp/tart-guest-agent.log</string>
</dict>
</plist>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.cirruslabs.tart-guest-daemon</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/tart-guest-agent</string>
<string>--run-daemon</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/bin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/homebrew/bin</string>
</dict>
<key>WorkingDirectory</key>
<string>/var/empty</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/tart-guest-daemon.log</string>
<key>StandardErrorPath</key>
<string>/tmp/tart-guest-daemon.log</string>
</dict>
</plist>
+50 -2
View File
@@ -56,16 +56,35 @@ build {
"echo 'eval \"$(/opt/homebrew/bin/brew shellenv)\"' >> ~/.zprofile",
"echo \"export HOMEBREW_NO_AUTO_UPDATE=1\" >> ~/.zprofile",
"echo \"export HOMEBREW_NO_INSTALL_CLEANUP=1\" >> ~/.zprofile",
]
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
"brew --version",
"brew update",
"brew install curl wget unzip zip ca-certificates cmake gcc git-lfs jq yq gh gitlab-runner",
"brew install wget unzip zip ca-certificates cmake gcc git-lfs jq yq gh gitlab-runner",
"brew install equinix-labs/otel-cli/otel-cli",
"brew install curl || true", // doesn't work on Monterey
"brew install --cask git-credential-manager",
"git lfs install",
"sudo softwareupdate --install-rosetta --agree-to-license"
]
}
// Add GitHub to known hosts
// Similar to https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/configure-ssh.sh
provisioner "shell" {
inline = [
"mkdir -p ~/.ssh"
]
}
provisioner "file" {
source = "data/github_known_hosts"
destination = "~/.ssh/known_hosts"
}
// Install the GitHub Actions runner
provisioner "shell" {
script = "scripts/install-actions-runner.sh"
@@ -87,6 +106,7 @@ build {
"brew install libyaml", # https://github.com/rbenv/ruby-build/discussions/2118
"brew install rbenv",
"echo 'if which rbenv > /dev/null; then eval \"$(rbenv init -)\"; fi' >> ~/.zprofile",
"brew install mise",
"source ~/.zprofile",
"rbenv install 2.7.8", // latest 2.x.x before EOL
"rbenv install -l | grep -v - | tail -2 | xargs -L1 rbenv install",
@@ -126,7 +146,35 @@ build {
provisioner "shell" {
inline = [
"source ~/.zprofile",
"test -d /Users/runner"
"test -d /Users/runner",
"test -f ~/.ssh/known_hosts"
]
}
// Guest agent for Tart VMs
provisioner "file" {
source = "data/tart-guest-daemon.plist"
destination = "~/tart-guest-daemon.plist"
}
provisioner "file" {
source = "data/tart-guest-agent.plist"
destination = "~/tart-guest-agent.plist"
}
provisioner "shell" {
inline = [
# Install Tart Guest Agent
"source ~/.zprofile",
"brew install cirruslabs/cli/tart-guest-agent",
# Install daemon variant of the Tart Guest Agent
"sudo mv ~/tart-guest-daemon.plist /Library/LaunchDaemons/org.cirruslabs.tart-guest-daemon.plist",
"sudo chown root:wheel /Library/LaunchDaemons/org.cirruslabs.tart-guest-daemon.plist",
"sudo chmod 0644 /Library/LaunchDaemons/org.cirruslabs.tart-guest-daemon.plist",
# Install agent variant of the Tart Guest Agent
"sudo mv ~/tart-guest-agent.plist /Library/LaunchAgents/org.cirruslabs.tart-guest-agent.plist",
"sudo chown root:wheel /Library/LaunchAgents/org.cirruslabs.tart-guest-agent.plist",
"sudo chmod 0644 /Library/LaunchAgents/org.cirruslabs.tart-guest-agent.plist",
]
}
}
@@ -0,0 +1,39 @@
packer {
required_plugins {
tart = {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
}
}
variable "vm_name" {
type = string
}
source "tart-cli" "tart" {
vm_name = "${var.vm_name}"
recovery = true
cpu_count = 4
memory_gb = 8
disk_size_gb = 50
communicator = "none"
boot_command = [
# Skip over "Macintosh" and select "Options"
# to boot into macOS Recovery
"<wait60s><right><right><enter>",
# Open Terminal
"<wait10s><leftAltOn>T<leftAltOff>",
# Disable SIP
"<wait10s>csrutil disable<enter>",
"<wait10s>y<enter>",
"<wait10s>admin<enter>",
"<wait10s>admin<enter>",
# Shutdown
"<wait10s>halt<enter>"
]
}
build {
sources = ["source.tart-cli.tart"]
}
+48
View File
@@ -0,0 +1,48 @@
packer {
required_plugins {
tart = {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
}
}
variable "vm_base_name" {
type = string
}
variable "vm_name" {
type = string
}
variable "resolve_file" {
type = string
}
source "tart-cli" "tart" {
vm_base_name = "${var.vm_base_name}"
vm_name = "${var.vm_name}"
cpu_count = 4
memory_gb = 8
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "120s"
}
build {
sources = ["source.tart-cli.tart"]
provisioner "shell" {
inline = [
# Use "-productVersion" instead of "--productVersion"
# to support old-style syntax used on macOS Monterey
"sw_vers -productVersion > /tmp/sw-vers-product-version.txt",
]
}
provisioner "file" {
source = "/tmp/sw-vers-product-version.txt"
destination = "${var.resolve_file}"
direction = "download"
}
}
@@ -1,21 +1,26 @@
packer {
required_plugins {
tart = {
version = ">= 1.12.0"
version = ">= 1.2.0"
source = "github.com/cirruslabs/tart"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
}
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2024SummerSeed/fullrestores/062-74506/D50AC8F9-4795-4711-9C1A-907B6EB829A2/UniversalMac_15.1_24B5035e_Restore.ipsw"
vm_name = "sequoia-vanilla"
# You can find macOS IPSW URLs on various websites like https://ipsw.me/
from_ipsw = "https://updates.cdn-apple.com/2022FallFCS/fullrestores/012-66032/8D8D90C6-A876-4FFF-BBF4-D158939B3841/UniversalMac_12.6.1_21G217_Restore.ipsw"
vm_name = "monterey-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 40
disk_size_gb = 50
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "300s"
ssh_timeout = "120s"
boot_command = [
# hello, hola, bonjour, etc.
"<wait60s><spacebar>",
@@ -48,41 +53,39 @@ source "tart-cli" "tart" {
# Create a Computer Account
"<wait10s>admin<tab><tab>admin<tab>admin<tab><tab><tab><spacebar>",
# Enable Location Services
"<wait120s><leftShiftOn><tab><leftShiftOff><spacebar>",
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you don't want to use Location Services?
"<wait10s><tab><spacebar>",
# Select Your Time Zone
"<wait10s><tab>UTC<enter><leftShiftOn><tab><leftShiftOff><spacebar>",
# Analytics
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
"<wait10s><tab><spacebar><leftShiftOn><tab><leftShiftOff><spacebar>",
# Screen Time
"<wait10s><tab><spacebar>",
# Siri
"<wait10s><tab><spacebar><leftShiftOn><tab><leftShiftOff><spacebar>",
# Choose Your Look
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Welcome to Mac
"<wait10s><spacebar>",
# Enable Keyboard navigation
# This is so that we can navigate the System Settings app using the keyboard
"<wait10s><leftAltOn><spacebar><leftAltOff>Terminal<enter>",
"<wait10s>defaults write NSGlobalDomain AppleKeyboardUIMode -int 3<enter>",
"<wait10s><leftAltOn>q<leftAltOff>",
# Now that the installation is done, open "System Settings"
"<wait10s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Enable Voice Over
"<wait10s><leftAltOn><f5><leftAltOff><wait5s>v",
# Now that the installation is done, open "System Preferences"
"<wait10s><leftAltOn><spacebar><leftAltOff>System Preferences<enter>",
# Navigate to "Sharing"
"<wait10s><leftAltOn>f<leftAltOff>sharing<enter>",
# Navigate to "Screen Sharing" and enable it
"<wait10s><tab><tab><tab><tab><tab><spacebar>",
# Navigate to "Remote Login" and enable it
"<wait10s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Quit System Settings
"<wait10s><leftAltOn>q<leftAltOff>",
"<wait10s>sharing<enter>",
# Enable Screen Sharing
"<wait10s><tab><tab><tab><tab><spacebar>",
# Enable Remote Login
"<wait10s><down><down><down><down><spacebar><tab><tab><spacebar>",
# Disable Voice Over
"<leftAltOn><f5><leftAltOff>",
]
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
// Keep the recovery partition, otherwise it's not possible to "softwareupdate"
recovery_partition = "keep"
}
build {
@@ -91,7 +94,7 @@ build {
provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"mkdir -p /etc/sudoers.d/; echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
"echo admin | sudo -S sh -c \"echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
// Enable auto-login
//
// See https://github.com/xfreebird/kcpassword for details.
@@ -102,7 +105,9 @@ build {
// Disable screensaver for admin user
"defaults -currentHost write com.apple.screensaver idleTime 0",
// Prevent the VM from sleeping
"sudo systemsetup -setdisplaysleep Off 2>/dev/null",
"sudo systemsetup -setsleep Off 2>/dev/null",
"sudo systemsetup -setcomputersleep Off 2>/dev/null",
// Launch Safari to populate the defaults
"/Applications/Safari.app/Contents/MacOS/Safari &",
"SAFARI_PID=$!",
@@ -118,4 +123,26 @@ build {
"sysadminctl -screenLock off -password admin",
]
}
provisioner "shell" {
inline = [
# Install command-line tools
"touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
"softwareupdate --list | sed -n 's/.*Label: \\(Command Line Tools for Xcode-.*\\)/\\1/p' | xargs -I {} softwareupdate --install '{}'",
"rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
]
}
provisioner "ansible" {
playbook_file = "ansible/playbook-system-updater.yml"
extra_arguments = [
"-vvv",
"--extra-vars", "stdinpass=admin",
]
ansible_env_vars = [
"ANSIBLE_TRANSPORT=paramiko",
"ANSIBLE_HOST_KEY_CHECKING=False",
]
use_proxy = false
}
}
+69 -13
View File
@@ -4,18 +4,23 @@ packer {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
}
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2024FallFCS/fullrestores/062-78489/BDA44327-C79E-4608-A7E0-455A7E91911F/UniversalMac_15.0_24A335_Restore.ipsw"
// will be update to 15.7
from_ipsw = "https://updates.cdn-apple.com/2025SummerFCS/fullrestores/093-10809/CFD6DD38-DAF0-40DA-854F-31AAD1294C6F/UniversalMac_15.6.1_24G90_Restore.ipsw"
vm_name = "sequoia-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 40
disk_size_gb = 50
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "300s"
ssh_timeout = "180s"
boot_command = [
# hello, hola, bonjour, etc.
"<wait60s><spacebar>",
@@ -27,32 +32,34 @@ source "tart-cli" "tart" {
#
# [1]: should be named "English (US)", but oh well 🤷
"<wait30s>italiano<esc>english<enter>",
# Select Your Country and Region
# Select Your Country or Region
"<wait30s>united states<leftShiftOn><tab><leftShiftOff><spacebar>",
# Transfer Your Data to This Mac
"<wait10s><tab><tab><tab><spacebar><tab><tab><spacebar>",
# Written and Spoken Languages
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Accessibility
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Data & Privacy
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Migration Assistant
"<wait10s><tab><tab><tab><spacebar>",
# Create a Mac Account
"<wait10s>Managed via Tart<tab>admin<tab>admin<tab>admin<tab><tab><spacebar><tab><tab><spacebar>",
# Enable Voice Over
"<wait120s><leftAltOn><f5><leftAltOff>",
# Sign In with Your Apple ID
"<wait10s><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><spacebar>",
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you want to skip signing in with an Apple ID?
"<wait10s><tab><spacebar>",
# Terms and Conditions
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# I have read and agree to the macOS Software License Agreement
"<wait10s><tab><spacebar>",
# Create a Computer Account
"<wait10s>admin<tab><tab>admin<tab>admin<tab><tab><tab><spacebar>",
# Enable Location Services
"<wait120s><leftShiftOn><tab><leftShiftOff><spacebar>",
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you don't want to use Location Services?
"<wait10s><tab><spacebar>",
# Select Your Time Zone
"<wait10s><tab>UTC<enter><leftShiftOn><tab><leftShiftOff><spacebar>",
"<wait10s><tab><tab>UTC<enter><leftShiftOn><tab><tab><leftShiftOff><spacebar>",
# Analytics
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Screen Time
@@ -61,8 +68,12 @@ source "tart-cli" "tart" {
"<wait10s><tab><spacebar><leftShiftOn><tab><leftShiftOff><spacebar>",
# Choose Your Look
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Update Mac Automatically
"<wait10s><tab><spacebar>",
# Welcome to Mac
"<wait10s><spacebar>",
# Disable Voice Over
"<leftAltOn><f5><leftAltOff>",
# Enable Keyboard navigation
# This is so that we can navigate the System Settings app using the keyboard
"<wait10s><leftAltOn><spacebar><leftAltOff>Terminal<enter>",
@@ -71,18 +82,35 @@ source "tart-cli" "tart" {
# Now that the installation is done, open "System Settings"
"<wait10s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Navigate to "Sharing"
"<wait10s><leftAltOn>f<leftAltOff>sharing<enter>",
"<wait10s><leftCtrlOn><f2><leftCtrlOff><right><right><right><down>Sharing<enter>",
# Navigate to "Screen Sharing" and enable it
"<wait10s><tab><tab><tab><tab><tab><spacebar>",
"<wait10s><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Navigate to "Remote Login" and enable it
"<wait10s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Quit System Settings
"<wait10s><leftAltOn>q<leftAltOff>",
# Disable Gatekeeper (1/2)
"<wait10s><leftAltOn><spacebar><leftAltOff>Terminal<enter>",
"<wait10s>sudo spctl --global-disable<enter>",
"<wait10s>admin<enter>",
"<wait10s><leftAltOn>q<leftAltOff>",
# Disable Gatekeeper (2/2)
"<wait10s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
"<wait10s><leftCtrlOn><f2><leftCtrlOff><right><right><right><down>Privacy & Security<enter>",
"<wait10s><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff>",
"<wait10s><down><wait1s><down><wait1s><enter>",
"<wait10s>admin<enter>",
"<wait10s><leftShiftOn><tab><leftShiftOff><wait1s><spacebar>",
# Quit System Settings
"<wait10s><leftAltOn>q<leftAltOff>",
]
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
// Keep the recovery partition, otherwise it's not possible to "softwareupdate"
recovery_partition = "keep"
}
build {
@@ -118,4 +146,32 @@ build {
"sysadminctl -screenLock off -password admin",
]
}
provisioner "shell" {
inline = [
# Ensure that Gatekeeper is disabled
"spctl --status | grep -q 'assessments disabled'"
]
}
provisioner "shell" {
inline = [
# Install command-line tools
"touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
"softwareupdate --list | sed -n 's/.*Label: \\(Command Line Tools for Xcode-.*\\)/\\1/p' | xargs -I {} softwareupdate --install '{}'",
"rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
]
}
provisioner "ansible" {
playbook_file = "ansible/playbook-system-updater.yml"
extra_arguments = [
"-vvv",
]
ansible_env_vars = [
"ANSIBLE_TRANSPORT=paramiko",
"ANSIBLE_HOST_KEY_CHECKING=False",
]
use_proxy = false
}
}
+32 -3
View File
@@ -4,18 +4,23 @@ packer {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
}
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2024SummerFCS/fullrestores/052-69922/F5DA2B64-25EB-4370-9E89-FA5689859796/UniversalMac_14.6_23G80_Restore.ipsw"
// will be update to 14.8
from_ipsw = "https://updates.cdn-apple.com/2024SummerFCS/fullrestores/062-52859/932E0A8F-6644-4759-82DA-F8FA8DEA806A/UniversalMac_14.6.1_23G93_Restore.ipsw"
vm_name = "sonoma-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 40
disk_size_gb = 50
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "120s"
ssh_timeout = "180s"
boot_command = [
# hello, hola, bonjour, etc.
"<wait60s><spacebar>",
@@ -78,6 +83,9 @@ source "tart-cli" "tart" {
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
// Keep the recovery partition, otherwise it's not possible to "softwareupdate"
recovery_partition = "keep"
}
build {
@@ -115,4 +123,25 @@ build {
"sysadminctl -screenLock off -password admin",
]
}
provisioner "shell" {
inline = [
# Install command-line tools
"touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
"softwareupdate --list | sed -n 's/.*Label: \\(Command Line Tools for Xcode-.*\\)/\\1/p' | xargs -I {} softwareupdate --install '{}'",
"rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
]
}
provisioner "ansible" {
playbook_file = "ansible/playbook-system-updater.yml"
extra_arguments = [
"-vvv",
]
ansible_env_vars = [
"ANSIBLE_TRANSPORT=paramiko",
"ANSIBLE_HOST_KEY_CHECKING=False",
]
use_proxy = false
}
}
+158
View File
@@ -0,0 +1,158 @@
packer {
required_plugins {
tart = {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
}
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2025FallFCS/fullrestores/089-04148/791B6F00-A30B-4EB0-B2E3-257167F7715B/UniversalMac_26.1_25B78_Restore.ipsw"
vm_name = "tahoe-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 50
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "180s"
boot_command = [
# hello, hola, bonjour, etc.
"<wait60s><spacebar>",
# Language: most of the times we have a list of "English"[1], "English (UK)", etc. with
# "English" language already selected. If we type "english", it'll cause us to switch
# to the "English (UK)", which is not what we want. To solve this, we switch to some other
# language first, e.g. "Italiano" and then switch back to "English". We'll then jump to the
# first entry in a list of "english"-prefixed items, which will be "English".
#
# [1]: should be named "English (US)", but oh well 🤷
"<wait30s>italiano<esc>english<enter>",
# Select Your Country or Region
"<wait60s>united states<leftShiftOn><tab><leftShiftOff><spacebar>",
# Transfer Your Data to This Mac
"<wait10s><tab><tab><tab><spacebar><tab><tab><spacebar>",
# Written and Spoken Languages
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Accessibility
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Data & Privacy
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Create a Mac Account
"<wait10s><tab><tab><tab><tab><tab><tab>Managed via Tart<tab>admin<tab>admin<tab>admin<tab><tab><spacebar><tab><tab><spacebar>",
# Enable Voice Over
"<wait120s><leftAltOn><f5><leftAltOff>",
# Sign In with Your Apple ID
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you want to skip signing in with an Apple ID?
"<wait10s><tab><spacebar>",
# Terms and Conditions
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# I have read and agree to the macOS Software License Agreement
"<wait10s><tab><spacebar>",
# Enable Location Services
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you don't want to use Location Services?
"<wait10s><tab><spacebar>",
# Select Your Time Zone
"<wait10s><tab><tab><tab>UTC<enter><leftShiftOn><tab><leftShiftOff><spacebar>",
# Analytics
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Screen Time
"<wait10s><tab><tab><spacebar>",
# Siri
"<wait10s><tab><spacebar><leftShiftOn><tab><leftShiftOff><spacebar>",
# You Mac is Ready for FileVault
"<wait10s><leftShiftOn><tab><tab><leftShiftOff><spacebar>",
# Mac Data Will Not Be Securely Encrypted
"<wait10s><tab><spacebar>",
# Choose Your Look
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Update Mac Automatically
"<wait10s><tab><tab><spacebar>",
# Welcome to Mac
"<wait30s><spacebar>",
# Disable Voice Over
"<wait10s><leftAltOn><f5><leftAltOff>",
# Enable Keyboard navigation
# This is so that we can navigate the System Settings app using the keyboard
"<wait10s><leftAltOn><spacebar><leftAltOff>Terminal<wait10s><enter>",
"<wait10s><wait10s>defaults write NSGlobalDomain AppleKeyboardUIMode -int 3<enter>",
# Now that the installation is done, open "System Settings"
# On Tahoe opening System Settings through Spotlight is not very reliable, sometimes opens System information
"<wait10s>open '/System/Applications/System Settings.app'<enter>",
# Navigate to "Sharing"
"<wait10s><leftCtrlOn><f2><leftCtrlOff><right><right><right><down>Sharing<enter>",
# Navigate to "Screen Sharing" and enable it
"<wait10s><tab><tab><tab><tab><tab><spacebar>",
# Navigate to "Remote Login" and enable it
"<wait10s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Quit System Settings
"<wait10s><leftAltOn>q<leftAltOff>",
# Disable Gatekeeper (1/2)
"<wait10s>sudo spctl --global-disable<enter>",
"<wait10s>admin<enter>",
# Disable Gatekeeper (2/2)
# On Tahoe opening System Settings through Spotlight is not very reliable, sometimes opens System information
"<wait10s>open '/System/Applications/System Settings.app'<enter>",
"<wait10s><leftCtrlOn><f2><leftCtrlOff><right><right><right><down>Privacy & Security<enter>",
"<wait10s><leftShiftOn><tab><tab><tab><tab><tab><leftShiftOff>",
"<wait10s><down><wait1s><down><wait1s><enter>",
"<wait10s>admin<enter>",
"<wait10s><leftShiftOn><tab><leftShiftOff><wait1s><spacebar>",
# Quit System Settings
"<wait10s><leftAltOn>q<leftAltOff>",
]
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
// Keep the recovery partition, otherwise it's not possible to "softwareupdate"
recovery_partition = "keep"
}
build {
sources = ["source.tart-cli.tart"]
provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"mkdir -p /etc/sudoers.d/; echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
// Enable auto-login
//
// See https://github.com/xfreebird/kcpassword for details.
"echo '00000000: 1ced 3f4a bcbc ba2c caca 4e82' | sudo xxd -r - /etc/kcpassword",
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
// Disable screensaver at login screen
"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
"sudo systemsetup -setsleep Off 2>/dev/null",
// Launch Safari to populate the defaults
"/Applications/Safari.app/Contents/MacOS/Safari &",
"SAFARI_PID=$!",
"disown",
"sleep 30",
"kill -9 $SAFARI_PID",
// Enable Safari's remote automation
"sudo safaridriver --enable",
// Disable screen lock
//
// Note that this only works if the user is logged-in,
// i.e. not on login screen.
"sysadminctl -screenLock off -password admin",
]
}
provisioner "shell" {
inline = [
# Ensure that Gatekeeper is disabled
"spctl --status | grep -q 'assessments disabled'"
]
}
}
+29 -1
View File
@@ -4,6 +4,10 @@ packer {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
}
}
@@ -14,7 +18,7 @@ source "tart-cli" "tart" {
vm_name = "ventura-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 40
disk_size_gb = 50
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "120s"
@@ -86,6 +90,9 @@ source "tart-cli" "tart" {
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
// Keep the recovery partition, otherwise it's not possible to "softwareupdate"
recovery_partition = "keep"
}
build {
@@ -124,4 +131,25 @@ build {
"defaults -currentHost write com.apple.screensaver idleTime 0"
]
}
provisioner "shell" {
inline = [
# Install command-line tools
"touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
"softwareupdate --list | sed -n 's/.*Label: \\(Command Line Tools for Xcode-.*\\)/\\1/p' | xargs -I {} softwareupdate --install '{}'",
"rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress",
]
}
provisioner "ansible" {
playbook_file = "ansible/playbook-system-updater.yml"
extra_arguments = [
"-vvv",
]
ansible_env_vars = [
"ANSIBLE_TRANSPORT=paramiko",
"ANSIBLE_HOST_KEY_CHECKING=False",
]
use_proxy = false
}
}
+191 -18
View File
@@ -15,6 +15,28 @@ variable "xcode_version" {
type = list(string)
}
variable "additional_ios_builds" {
type = list(string)
default = []
}
variable "additional_tvos_builds" {
type = list(string)
default = []
}
variable "xcode_components" {
type = list(string)
default = []
description = "Additional Xcode components to download."
}
variable "expected_runtimes_file" {
type = string
default = ""
description = "Path to file containing expected simulator runtimes. If empty, runtime verification is skipped."
}
variable "tag" {
type = string
default = ""
@@ -22,7 +44,7 @@ variable "tag" {
variable "disk_size" {
type = number
default = 100
default = 120
}
variable "disk_free_mb" {
@@ -32,13 +54,13 @@ variable "disk_free_mb" {
variable "android_sdk_tools_version" {
type = string
default = "11076708" # https://developer.android.com/studio/#command-tools
default = "11076708" # https://developer.android.com/studio#command-line-tools-only
}
source "tart-cli" "tart" {
vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-base:latest"
// use tag or the last element of the xcode_version list
vm_name = "${var.macos_version}-xcode:${var.tag != "" ? var.tag : var.xcode_version[length(var.xcode_version) - 1]}"
vm_name = "${var.macos_version}-xcode:${var.tag != "" ? var.tag : var.xcode_version[0]}"
cpu_count = 4
memory_gb = 8
disk_size_gb = var.disk_size
@@ -50,7 +72,7 @@ source "tart-cli" "tart" {
locals {
xcode_install_provisioners = [
for version in var.xcode_version : {
for version in reverse(sort(var.xcode_version)) : {
type = "shell"
inline = [
"source ~/.zprofile",
@@ -61,8 +83,9 @@ locals {
"APP_DIR=$(dirname $CONTENTS_DIR)",
"sudo mv $APP_DIR /Applications/Xcode_${version}.app",
"sudo xcode-select -s /Applications/Xcode_${version}.app",
"xcodebuild -downloadAllPlatforms",
"xcodebuild -downloadPlatform iOS",
"xcodebuild -runFirstLaunch",
"df -h",
]
}
]
@@ -107,7 +130,7 @@ build {
"rm android-sdk-tools.zip",
"mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest",
"yes | sdkmanager --licenses",
"yes | sdkmanager 'platform-tools' 'platforms;android-33' 'build-tools;34.0.0' 'ndk;25.2.9519653'"
"yes | sdkmanager 'platform-tools' 'platforms;android-35' 'build-tools;35.0.0' 'ndk;27.2.12479018'"
]
}
@@ -124,6 +147,13 @@ build {
destination = "/Users/admin/Downloads/"
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
"df -h",
]
}
// iterate over all Xcode versions and install them
// select the latest one as the default
dynamic "provisioner" {
@@ -134,6 +164,104 @@ build {
}
}
dynamic "provisioner" {
for_each = length(var.xcode_version) > 2 ? [2] : []
labels = ["shell"]
content {
inline = [
"source ~/.zprofile",
"sudo xcodes select '${var.xcode_version[2]}'",
"xcodebuild -downloadAllPlatforms",
]
}
}
dynamic "provisioner" {
for_each = length(var.xcode_version) > 1 ? [1] : []
labels = ["shell"]
content {
inline = [
"source ~/.zprofile",
"sudo xcodes select '${var.xcode_version[1]}'",
"xcodebuild -downloadAllPlatforms",
]
}
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
"sudo xcodes select '${var.xcode_version[0]}'",
"xcodebuild -downloadAllPlatforms",
]
}
provisioner "shell" {
inline = concat(
["source ~/.zprofile"],
[
for runtime in var.additional_ios_builds : "xcodebuild -downloadPlatform iOS -buildVersion ${runtime}"
]
)
}
provisioner "shell" {
inline = concat(
["source ~/.zprofile"],
[
for runtime in var.additional_tvos_builds : "xcodebuild -downloadPlatform tvOS -buildVersion ${runtime}"
]
)
}
provisioner "shell" {
inline = concat(
["source ~/.zprofile"],
[
for component in var.xcode_components : "xcodebuild -downloadComponent ${component}"
]
)
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
"brew install libimobiledevice ideviceinstaller ios-deploy carthage",
"brew install xcbeautify swiftformat swiftlint swiftgen licenseplist",
"brew install mint tuist/tuist/tuist",
"rbenv global 3.3.10", # fastlane conflicts with 3.4.0+ https://github.com/fastlane/fastlane/issues/29527
"gem update",
"gem install fastlane",
"gem install cocoapods",
"gem install xcpretty",
"gem uninstall --ignore-dependencies ffi && gem install ffi -- --enable-libffi-alloc"
]
}
// Copy expected runtimes file if provided
dynamic "provisioner" {
for_each = var.expected_runtimes_file != "" ? [1] : []
labels = ["file"]
content {
source = var.expected_runtimes_file
destination = "/Users/admin/runtimes.expected.txt"
}
}
// Verify simulator runtimes match expected list if file was provided
dynamic "provisioner" {
for_each = var.expected_runtimes_file != "" ? [1] : []
labels = ["shell"]
content {
inline = [
"source ~/.zprofile",
"xcrun simctl list runtimes > /Users/admin/runtimes.actual.txt",
"diff -q /Users/admin/runtimes.actual.txt /Users/admin/runtimes.expected.txt || (echo 'Simulator runtimes do not match expected list' && cat /Users/admin/runtimes.actual.txt && exit 1)",
"rm /Users/admin/runtimes.actual.txt /Users/admin/runtimes.expected.txt"
]
}
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
@@ -148,24 +276,14 @@ build {
"flutter precache",
]
}
provisioner "shell" {
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"
]
}
# useful utils for mobile development
provisioner "shell" {
inline = [
"source ~/.zprofile",
"brew install graphicsmagick imagemagick",
"brew install wix/brew/applesimutils"
"brew install wix/brew/applesimutils",
"brew install gnupg"
]
}
@@ -207,4 +325,59 @@ build {
"test -d /Users/runner"
]
}
# Disable apsd[1][2] daemon as it causes high CPU usage after boot
#
# [1]: https://iboysoft.com/wiki/apsd-mac.html
# [2]: https://discussions.apple.com/thread/4459153
provisioner "shell" {
inline = [
"sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.apsd.plist"
]
}
# Compatibility with GitHub Actions Runner Images, where
# /usr/local/bin belongs to the default user. Also see [2].
#
# [1]: https://github.com/actions/runner-images/blob/6bbddd20d76d61606bea5a0133c950cc44c370d3/images/macos/scripts/build/configure-machine.sh#L96
# [2]: https://github.com/actions/runner-images/discussions/7607
provisioner "shell" {
inline = [
"sudo chown admin /usr/local/bin"
]
}
# Wait for the "update_dyld_sim_shared_cache" process[1][2] to finish
# to avoid wasting CPU cycles after boot
#
# [1]: https://apple.stackexchange.com/questions/412101/update-dyld-sim-shared-cache-is-taking-up-a-lot-of-memory
# [2]: https://stackoverflow.com/a/68394101/9316533
provisioner "shell" {
inline = [
"sleep 1800"
]
}
// Install setup-info-generator
provisioner "shell" {
inline = [
"source ~/.zprofile",
"brew install cirruslabs/cli/setup-info-generator"
]
}
// Copy setup info template
provisioner "file" {
source = "data/setup-info-template.json"
destination = "~/setup-info-template.json"
}
// Generate setup info
provisioner "shell" {
inline = [
"source ~/.zprofile",
"cat ~/setup-info-template.json | setup-info-generator > ~/actions-runner/.setup_info",
"rm ~/setup-info-template.json"
]
}
}