mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
[macos] add cookie based installation for Xcode (#7666)
This commit is contained in:
committed by
GitHub
parent
be83ef6796
commit
afd68edefb
9
.github/workflows/macos-generation.yml
vendored
9
.github/workflows/macos-generation.yml
vendored
@@ -105,6 +105,13 @@ jobs:
|
|||||||
-VIPassword ${{ secrets.VI_PASSWORD }} `
|
-VIPassword ${{ secrets.VI_PASSWORD }} `
|
||||||
-Cluster ${{ env.ESXI_CLUSTER }}
|
-Cluster ${{ env.ESXI_CLUSTER }}
|
||||||
|
|
||||||
|
- name: Create xcversion session cookie file
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ runner.temp }}/xcversion-cookie
|
||||||
|
cookie='${{ secrets.XCVERSION_AUTH_COOKIE }}'
|
||||||
|
echo "$cookie" > ${{ runner.temp }}/xcversion-cookie/cookie
|
||||||
|
|
||||||
- name: Build VM
|
- name: Build VM
|
||||||
run: |
|
run: |
|
||||||
$SensitiveData = @(
|
$SensitiveData = @(
|
||||||
@@ -126,6 +133,7 @@ jobs:
|
|||||||
-var="baseimage_name=${{ inputs.base_image_name }}" `
|
-var="baseimage_name=${{ inputs.base_image_name }}" `
|
||||||
-var="xcode_install_user=${{ secrets.XCODE_USER }}" `
|
-var="xcode_install_user=${{ secrets.XCODE_USER }}" `
|
||||||
-var="xcode_install_password=${{ secrets.XCODE_PASSWORD }}" `
|
-var="xcode_install_password=${{ secrets.XCODE_PASSWORD }}" `
|
||||||
|
-var="xcversion_auth_cookie=${{ env.XCVERSION_COOKIE_PATH }}" `
|
||||||
-color=false `
|
-color=false `
|
||||||
${{ inputs.template_path }} `
|
${{ inputs.template_path }} `
|
||||||
| Where-Object {
|
| Where-Object {
|
||||||
@@ -138,6 +146,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PACKER_LOG: 1
|
PACKER_LOG: 1
|
||||||
PACKER_LOG_PATH: ${{ runner.temp }}/packer-log.txt
|
PACKER_LOG_PATH: ${{ runner.temp }}/packer-log.txt
|
||||||
|
XCVERSION_COOKIE_PATH: ${{ runner.temp }}/xcversion-cookie/cookie
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -58,6 +58,12 @@ jobs:
|
|||||||
-VIPassword '$(vcenter-password-v2)' `
|
-VIPassword '$(vcenter-password-v2)' `
|
||||||
-Cluster "$(esxi-cluster-v2)"
|
-Cluster "$(esxi-cluster-v2)"
|
||||||
|
|
||||||
|
- task: DownloadSecureFile@1
|
||||||
|
name: xcVersionCookie
|
||||||
|
displayName: 'Download xcversion session cookie'
|
||||||
|
inputs:
|
||||||
|
secureFile: 'cookie'
|
||||||
|
|
||||||
- pwsh: |
|
- pwsh: |
|
||||||
$SensitiveData = @(
|
$SensitiveData = @(
|
||||||
'IP address:',
|
'IP address:',
|
||||||
@@ -79,6 +85,7 @@ jobs:
|
|||||||
-var="baseimage_name=${{ parameters.base_image_name }}" `
|
-var="baseimage_name=${{ parameters.base_image_name }}" `
|
||||||
-var="xcode_install_user=$(xcode-installation-user)" `
|
-var="xcode_install_user=$(xcode-installation-user)" `
|
||||||
-var="xcode_install_password=$(xcode-installation-password)" `
|
-var="xcode_install_password=$(xcode-installation-password)" `
|
||||||
|
-var="xcversion_auth_cookie=$(xcVersionCookie.secureFilePath)" `
|
||||||
-color=false `
|
-color=false `
|
||||||
${{ parameters.template_path }} `
|
${{ parameters.template_path }} `
|
||||||
| Where-Object {
|
| Where-Object {
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ variable "xcode_install_password" {
|
|||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "xcversion_auth_cookie" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "vcpu_count" {
|
variable "vcpu_count" {
|
||||||
type = string
|
type = string
|
||||||
default = "6"
|
default = "6"
|
||||||
@@ -182,6 +187,15 @@ build {
|
|||||||
]
|
]
|
||||||
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
||||||
}
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = [
|
||||||
|
"mkdir -p ~/.fastlane/spaceship/${var.xcode_install_user}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "~/.fastlane/spaceship/${var.xcode_install_user}/cookie"
|
||||||
|
source = "${var.xcversion_auth_cookie}"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
script = "./provision/core/xcode.ps1"
|
script = "./provision/core/xcode.ps1"
|
||||||
environment_vars = [
|
environment_vars = [
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"github_api_pat": null,
|
"github_api_pat": null,
|
||||||
"xcode_install_user": null,
|
"xcode_install_user": null,
|
||||||
"xcode_install_password": null,
|
"xcode_install_password": null,
|
||||||
|
"xcversion_auth_cookie": null,
|
||||||
"image_os": "macos11"
|
"image_os": "macos11"
|
||||||
},
|
},
|
||||||
"builders": [
|
"builders": [
|
||||||
@@ -164,6 +165,15 @@
|
|||||||
"API_PAT={{user `github_api_pat`}}"
|
"API_PAT={{user `github_api_pat`}}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"inline": "mkdir -p ~/.fastlane/spaceship/{{user `xcode_install_user`}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{user `xcversion_auth_cookie`}}",
|
||||||
|
"destination": "~/.fastlane/spaceship/{{user `xcode_install_user`}}/cookie"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
|
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ variable "xcode_install_password" {
|
|||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "xcversion_auth_cookie" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "vcpu_count" {
|
variable "vcpu_count" {
|
||||||
type = string
|
type = string
|
||||||
default = "6"
|
default = "6"
|
||||||
@@ -183,6 +188,15 @@ build {
|
|||||||
]
|
]
|
||||||
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
||||||
}
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = [
|
||||||
|
"mkdir -p ~/.fastlane/spaceship/${var.xcode_install_user}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "~/.fastlane/spaceship/${var.xcode_install_user}/cookie"
|
||||||
|
source = "${var.xcversion_auth_cookie}"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
script = "./provision/core/xcode.ps1"
|
script = "./provision/core/xcode.ps1"
|
||||||
environment_vars = [
|
environment_vars = [
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"github_api_pat": null,
|
"github_api_pat": null,
|
||||||
"xcode_install_user": null,
|
"xcode_install_user": null,
|
||||||
"xcode_install_password": null,
|
"xcode_install_password": null,
|
||||||
|
"xcversion_auth_cookie": null,
|
||||||
"image_os": "macos12"
|
"image_os": "macos12"
|
||||||
},
|
},
|
||||||
"builders": [
|
"builders": [
|
||||||
@@ -166,6 +167,15 @@
|
|||||||
"USER_PASSWORD={{user `vm_password`}}"
|
"USER_PASSWORD={{user `vm_password`}}"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"inline": "mkdir -p ~/.fastlane/spaceship/{{user `xcode_install_user`}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{user `xcversion_auth_cookie`}}",
|
||||||
|
"destination": "~/.fastlane/spaceship/{{user `xcode_install_user`}}/cookie"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
|
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ variable "xcode_install_password" {
|
|||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "xcversion_auth_cookie" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "vcpu_count" {
|
variable "vcpu_count" {
|
||||||
type = string
|
type = string
|
||||||
default = "6"
|
default = "6"
|
||||||
@@ -177,6 +182,15 @@ build {
|
|||||||
]
|
]
|
||||||
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
||||||
}
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = [
|
||||||
|
"mkdir -p ~/.fastlane/spaceship/${var.xcode_install_user}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "~/.fastlane/spaceship/${var.xcode_install_user}/cookie"
|
||||||
|
source = "${var.xcversion_auth_cookie}"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
script = "./provision/core/xcode.ps1"
|
script = "./provision/core/xcode.ps1"
|
||||||
environment_vars = [
|
environment_vars = [
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ variable "xcode_install_password" {
|
|||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "xcversion_auth_cookie" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "vcpu_count" {
|
variable "vcpu_count" {
|
||||||
type = string
|
type = string
|
||||||
default = "6"
|
default = "6"
|
||||||
@@ -177,6 +182,15 @@ build {
|
|||||||
]
|
]
|
||||||
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
|
||||||
}
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = [
|
||||||
|
"mkdir -p ~/.fastlane/spaceship/${var.xcode_install_user}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "~/.fastlane/spaceship/${var.xcode_install_user}/cookie"
|
||||||
|
source = "${var.xcversion_auth_cookie}"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
script = "./provision/core/xcode.ps1"
|
script = "./provision/core/xcode.ps1"
|
||||||
environment_vars = [
|
environment_vars = [
|
||||||
|
|||||||
Reference in New Issue
Block a user