From 8a0363fe316133906d09cc55306c219fc0b060f3 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Wed, 12 Nov 2025 17:22:30 -0500 Subject: [PATCH] split --- templates/xcode.pkr.hcl | 50 +++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/templates/xcode.pkr.hcl b/templates/xcode.pkr.hcl index fa79991..4e21bf3 100644 --- a/templates/xcode.pkr.hcl +++ b/templates/xcode.pkr.hcl @@ -134,17 +134,34 @@ build { ] } - provisioner "shell" { - inline = [ - "source ~/.zprofile", - "wget -q https://github.com/XcodesOrg/xcodes/releases/latest/download/xcodes.zip -O xcodes.zip", - "unzip -q xcodes.zip", - "chmod +x xcodes", - "sudo mv xcodes /usr/local/bin/", - "rm xcodes.zip", - "xcodes version", - ] - } + # 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" + ] + } + + provisioner "shell" { + inline = [ + "source ~/.zprofile", + "wget -q https://github.com/XcodesOrg/xcodes/releases/latest/download/xcodes.zip -O xcodes.zip", + "unzip -q xcodes.zip", + "chmod +x xcodes", + "sudo mv xcodes /usr/local/bin/", + "rm xcodes.zip" + ] + } + + provisioner "shell" { + inline = [ + "source ~/.zprofile", + "xcodes version" + ] + } provisioner "file" { sources = [ for version in var.xcode_version : pathexpand("~/XcodesCache/Xcode_${version}.xip")] @@ -340,17 +357,6 @@ build { ] } - # 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 #