mirror of
https://github.com/cirruslabs/macos-image-templates.git
synced 2026-09-30 03:42:04 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
159d4c1c36 | ||
|
|
2a0a476e3b | ||
|
|
74040f6870 | ||
|
|
9f061dacb4 | ||
|
|
f8fd129df6 | ||
|
|
80bedb81db | ||
|
|
7692f27396 | ||
|
|
2bd3a78831 | ||
|
|
39e0ccf2e4 | ||
|
|
e3cad7e8c2 | ||
|
|
47f36a33f8 | ||
|
|
c198ef9957 | ||
|
|
d038ed85d2 | ||
|
|
da102cc5e6 | ||
|
|
b0520dfd1d | ||
|
|
37c77845c8 | ||
|
|
9a16028831 | ||
|
|
cd817762c5 | ||
|
|
32c59db145 | ||
|
|
8dcd824d76 | ||
|
|
200bc65efb | ||
|
|
74aca70ef6 | ||
|
|
1e710b24b9 | ||
|
|
26c6575d1c | ||
|
|
63e491fbf8 | ||
|
|
600cb89e35 | ||
|
|
dbde34c6a8 | ||
|
|
ef6d97a77e | ||
|
|
760e04e340 | ||
|
|
b863116992 | ||
|
|
444b21aba2 | ||
|
|
525f51a54e | ||
|
|
5c7259d9a9 | ||
|
|
24ff639c4d | ||
|
|
0be36e7056 | ||
|
|
ed0b1e4c15 | ||
|
|
489255bec4 | ||
|
|
92c70a2e79 | ||
|
|
5de5e0997b | ||
|
|
127683c285 | ||
|
|
98a8ed97a4 | ||
|
|
3d76cfe25e | ||
|
|
4a45e89e9f | ||
|
|
f887c42ab1 | ||
|
|
cabda00d2a | ||
|
|
118270dd45 | ||
|
|
c80a91a5bf | ||
|
|
da6beb5b44 | ||
|
|
7a36c811f9 |
@@ -0,0 +1,19 @@
|
|||||||
|
task:
|
||||||
|
name: "Update Base Images ($MACOS_VERSION)"
|
||||||
|
alias: update-base
|
||||||
|
matrix:
|
||||||
|
- env:
|
||||||
|
MACOS_VERSION: sonoma
|
||||||
|
- env:
|
||||||
|
MACOS_VERSION: sequoia
|
||||||
|
<<: *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
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
task:
|
||||||
|
name: "Release Xcode $CIRRUS_TAG ($MACOS_VERSION)"
|
||||||
|
matrix:
|
||||||
|
- env:
|
||||||
|
MACOS_VERSION: sonoma
|
||||||
|
- env:
|
||||||
|
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\"]" 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
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
task:
|
||||||
|
name: "Update Runner Image ($MACOS_VERSION)"
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- MACOS_VERSION: sonoma
|
||||||
|
XCODE_VERSIONS: 16,15.4,15.3,15.2
|
||||||
|
- MACOS_VERSION: sequoia
|
||||||
|
XCODE_VERSIONS: "16.1,\"16.2-beta-1\",16,15.4"
|
||||||
|
<<: *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=300 \
|
||||||
|
-var disk_free_mb=100000 \
|
||||||
|
-var macos_version="$MACOS_VERSION" \
|
||||||
|
-var xcode_version="[$XCODE_VERSIONS]" \
|
||||||
|
-var additional_runtimes="[$ADDITIONAL_RUNTIMES]" \
|
||||||
|
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"
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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
|
||||||
|
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.1
|
||||||
|
always:
|
||||||
|
cleanup_script:
|
||||||
|
- tart delete sequoia-vanilla
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
task:
|
||||||
|
name: "Update Xcode Images ($MACOS_VERSION $XCODE_VERSION)"
|
||||||
|
depends_on: update-base
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- MACOS_VERSION: sequoia
|
||||||
|
XCODE_VERSION: 16.1
|
||||||
|
LATEST: true
|
||||||
|
- MACOS_VERSION: sequoia
|
||||||
|
XCODE_VERSION: 16
|
||||||
|
- MACOS_VERSION: sonoma
|
||||||
|
XCODE_VERSION: 16
|
||||||
|
LATEST: true
|
||||||
|
- MACOS_VERSION: sonoma
|
||||||
|
XCODE_VERSION: 15.4
|
||||||
|
- MACOS_VERSION: sonoma
|
||||||
|
XCODE_VERSION: 15.3
|
||||||
|
- MACOS_VERSION: sonoma
|
||||||
|
XCODE_VERSION: 15.2
|
||||||
|
<<: *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"
|
||||||
+44
-4
@@ -1,7 +1,47 @@
|
|||||||
|
load("cirrus", "env", "http", "fs")
|
||||||
load("github.com/cirrus-modules/graphql", "rerun_task_if_issue_in_logs")
|
load("github.com/cirrus-modules/graphql", "rerun_task_if_issue_in_logs")
|
||||||
|
|
||||||
|
|
||||||
def on_task_failed(ctx):
|
def on_task_failed(ctx):
|
||||||
if ctx.payload.data.task.automaticReRun:
|
if ctx.payload.data.task.automaticReRun:
|
||||||
print("Task is already an automatic re-run! Won't even try to re-run it...")
|
print("Task is already an automatic re-run! Won't even try to re-run it...")
|
||||||
return
|
return
|
||||||
rerun_task_if_issue_in_logs(ctx.payload.data.task.id, "The network connection was lost")
|
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("https://slack.com/api/chat.postMessage", headers={
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": "Bearer " + env.get("SLACK_TOKEN"),
|
||||||
|
}, json_body={
|
||||||
|
"channel": "#image-updates",
|
||||||
|
"text": "Build <https://cirrus-ci.com/build/{build_id}|{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),
|
||||||
|
})
|
||||||
|
|
||||||
|
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")
|
||||||
|
if env.get("CIRRUS_CRON") == "weekly":
|
||||||
|
result += fs.read(".ci/cirrus.runner.yml")
|
||||||
|
return result
|
||||||
|
|||||||
-111
@@ -19,114 +19,3 @@ defaults: &defaults
|
|||||||
info_script:
|
info_script:
|
||||||
- tart --version
|
- tart --version
|
||||||
- packer --version
|
- packer --version
|
||||||
|
|
||||||
task:
|
|
||||||
name: "Update Vanilla Images"
|
|
||||||
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.4.1
|
|
||||||
always:
|
|
||||||
cleanup_script:
|
|
||||||
- tart delete sonoma-vanilla
|
|
||||||
|
|
||||||
task:
|
|
||||||
name: "Update Base Images ($MACOS_VERSION)"
|
|
||||||
alias: update-base
|
|
||||||
env:
|
|
||||||
matrix:
|
|
||||||
MACOS_VERSION: sonoma
|
|
||||||
MACOS_VERSION: ventura
|
|
||||||
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: ventura
|
|
||||||
XCODE_VERSION: 14.3.1
|
|
||||||
LATEST: true
|
|
||||||
- MACOS_VERSION: ventura
|
|
||||||
XCODE_VERSION: 14.2
|
|
||||||
<<: *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: 15.2,15.3,15.4
|
|
||||||
only_if: $CIRRUS_TAG != "" || $CIRRUS_CRON == "weekly" # Every Sunday at 14 UTC
|
|
||||||
<<: *defaults
|
|
||||||
pull_base_script:
|
|
||||||
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
|
|
||||||
build_xcode_script:
|
|
||||||
- packer init templates/xcode.pkr.hcl
|
|
||||||
- packer build -var tag=runner -var disk_size=250 -var disk_free_mb=100000 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl
|
|
||||||
push_script: |
|
|
||||||
tart push "$MACOS_VERSION-xcode:runner" ghcr.io/cirruslabs/macos-runner:$MACOS_VERSION
|
|
||||||
always:
|
|
||||||
cleanup_script:
|
|
||||||
- tart delete "$MACOS_VERSION-xcode:runner"
|
|
||||||
|
|
||||||
task:
|
|
||||||
name: "Release Xcode $CIRRUS_TAG"
|
|
||||||
only_if: $CIRRUS_TAG != ""
|
|
||||||
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
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## macOS Packer Templates for Tart
|
## macOS Packer Templates for Tart
|
||||||
|
|
||||||
Repository with Packer templates to build macOS [Tart](https://tart.app/) virtual machines to use with [Cirrus Runners](https://cirrus-runners.app/),
|
Repository with Packer templates to build macOS [Tart](https://tart.run/) virtual machines to use with [Cirrus Runners](https://cirrus-runners.app/),
|
||||||
[Cirrus CI](https://cirrus-ci.org/guide/macOS/) or [any other automation](https://tart.run/integrations/cirrus-cli/).
|
[Cirrus CI](https://cirrus-ci.org/guide/macOS/) or [any other automation](https://tart.run/integrations/cirrus-cli/).
|
||||||
|
|
||||||
The following image variants are currently available:
|
The following image variants are currently available:
|
||||||
|
|
||||||
* `macos-{ventura,sonoma}-base` image has only `brew` pre-installed and the latest version of `macOS` available
|
* `macos-{sequoia,sonoma}-base` image has only `brew` pre-installed and the latest version of `macOS` available
|
||||||
* `macos-{ventura,sonoma}-xcode:N` image is based on `macos-{monterey,ventura}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
|
* `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-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.
|
||||||
|
|
||||||
See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
|
See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
|
||||||
@@ -14,7 +14,7 @@ See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packa
|
|||||||
## Release Cadence
|
## Release Cadence
|
||||||
|
|
||||||
Once a new version of Xcode is released, we will initiate a GitHub release which will automatically build and push
|
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-sonoma-xcode:N` image as well as `macos-runner:sonoma`. This generally happens within 24 hours
|
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.
|
of a release. Please watch this repository releases to get notified about new images.
|
||||||
|
|
||||||
## Update Cadence
|
## Update Cadence
|
||||||
@@ -22,9 +22,9 @@ of a release. Please watch this repository releases to get notified about new im
|
|||||||
Some of the images are regularly getting rebuild in order to update the pre-installed packages. The following images are updated
|
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:
|
monthly on the first Saturday of the month:
|
||||||
|
|
||||||
* `ghcr.io/cirruslabs/macos-{ventura,sonoma}-base`
|
* `ghcr.io/cirruslabs/macos-{sequoia,sonoma}-base`
|
||||||
* `ghcr.io/cirruslabs/macos-ventura-xcode:{latest,14.3.1,14.2}`
|
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{16-beta,latest,15.4,15.3,15.2}`
|
||||||
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{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/)
|
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.
|
on Cirrus Runners and Cirrus CI services.
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
packer {
|
||||||
|
required_plugins {
|
||||||
|
tart = {
|
||||||
|
version = ">= 1.12.0"
|
||||||
|
source = "github.com/cirruslabs/tart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
source "tart-cli" "tart" {
|
||||||
|
from_ipsw = "https://updates.cdn-apple.com/2024FallFCS/fullrestores/072-12340/78D28AC4-CCFC-45D2-BD27-1E5D915E43F9/UniversalMac_15.1_24B83_Restore.ipsw"
|
||||||
|
vm_name = "sequoia-vanilla"
|
||||||
|
cpu_count = 4
|
||||||
|
memory_gb = 8
|
||||||
|
disk_size_gb = 40
|
||||||
|
ssh_password = "admin"
|
||||||
|
ssh_username = "admin"
|
||||||
|
ssh_timeout = "300s"
|
||||||
|
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 and Region
|
||||||
|
"<wait30s>united states<leftShiftOn><tab><leftShiftOff><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>",
|
||||||
|
# Sign In with Your Apple ID
|
||||||
|
"<wait10s><leftShiftOn><tab><leftShiftOff><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>",
|
||||||
|
# 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>",
|
||||||
|
# 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>",
|
||||||
|
# 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>",
|
||||||
|
]
|
||||||
|
|
||||||
|
// A (hopefully) temporary workaround for Virtualization.Framework's
|
||||||
|
// installation process not fully finishing in a timely manner
|
||||||
|
create_grace_time = "30s"
|
||||||
|
}
|
||||||
|
|
||||||
|
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",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ packer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source "tart-cli" "tart" {
|
source "tart-cli" "tart" {
|
||||||
from_ipsw = "https://updates.cdn-apple.com/2024SpringFCS/fullrestores/062-01897/C874907B-9F82-4109-87EB-6B3C9BF1507D/UniversalMac_14.5_23F79_Restore.ipsw"
|
from_ipsw = "https://updates.cdn-apple.com/2024SummerFCS/fullrestores/052-69922/F5DA2B64-25EB-4370-9E89-FA5689859796/UniversalMac_14.6_23G80_Restore.ipsw"
|
||||||
vm_name = "sonoma-vanilla"
|
vm_name = "sonoma-vanilla"
|
||||||
cpu_count = 4
|
cpu_count = 4
|
||||||
memory_gb = 8
|
memory_gb = 8
|
||||||
|
|||||||
+25
-3
@@ -15,6 +15,11 @@ variable "xcode_version" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "additional_runtimes" {
|
||||||
|
type = list(string)
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
variable "tag" {
|
variable "tag" {
|
||||||
type = string
|
type = string
|
||||||
default = ""
|
default = ""
|
||||||
@@ -38,7 +43,7 @@ variable "android_sdk_tools_version" {
|
|||||||
source "tart-cli" "tart" {
|
source "tart-cli" "tart" {
|
||||||
vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-base:latest"
|
vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-base:latest"
|
||||||
// use tag or the last element of the xcode_version list
|
// 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
|
cpu_count = 4
|
||||||
memory_gb = 8
|
memory_gb = 8
|
||||||
disk_size_gb = var.disk_size
|
disk_size_gb = var.disk_size
|
||||||
@@ -50,7 +55,7 @@ source "tart-cli" "tart" {
|
|||||||
|
|
||||||
locals {
|
locals {
|
||||||
xcode_install_provisioners = [
|
xcode_install_provisioners = [
|
||||||
for version in var.xcode_version : {
|
for version in reverse(sort(var.xcode_version)) : {
|
||||||
type = "shell"
|
type = "shell"
|
||||||
inline = [
|
inline = [
|
||||||
"source ~/.zprofile",
|
"source ~/.zprofile",
|
||||||
@@ -134,6 +139,22 @@ build {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = [
|
||||||
|
"source ~/.zprofile",
|
||||||
|
"sudo xcodes select '${var.xcode_version[0]}'",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = concat(
|
||||||
|
["source ~/.zprofile"],
|
||||||
|
[
|
||||||
|
for runtime in var.additional_runtimes : "sudo xcodes runtimes install ${runtime}"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
"source ~/.zprofile",
|
"source ~/.zprofile",
|
||||||
@@ -165,7 +186,8 @@ build {
|
|||||||
inline = [
|
inline = [
|
||||||
"source ~/.zprofile",
|
"source ~/.zprofile",
|
||||||
"brew install graphicsmagick imagemagick",
|
"brew install graphicsmagick imagemagick",
|
||||||
"brew install wix/brew/applesimutils"
|
"brew install wix/brew/applesimutils",
|
||||||
|
"brew install gnupg"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user