mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[macOS] Rename build scripts (#8887)
Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
46
images/macos/scripts/build/configure-preimagedata.sh
Normal file
46
images/macos/scripts/build/configure-preimagedata.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
################################################################################
|
||||
## File: configure-preimagedata.sh
|
||||
## Desc: Configure data used in the image
|
||||
################################################################################
|
||||
|
||||
source ~/utils/utils.sh
|
||||
|
||||
arch=$(get_arch)
|
||||
imagedata_file="$HOME/imagedata.json"
|
||||
image_version=$(echo $IMAGE_VERSION | cut -d _ -f 2)
|
||||
os_name=$(sw_vers -productName)
|
||||
os_version=$(sw_vers -productVersion)
|
||||
os_build=$(sw_vers -buildVersion)
|
||||
label_version=$(echo $os_version | cut -d. -f1)
|
||||
|
||||
if [[ $arch == "arm64" ]]; then
|
||||
image_label="macos-${label_version}-arm64"
|
||||
else
|
||||
image_label="macos-${label_version}"
|
||||
fi
|
||||
release_label="macOS-${label_version}"
|
||||
|
||||
if is_VenturaX64 || is_SonomaX64; then
|
||||
software_url="https://github.com/actions/runner-images/blob/${image_label}/${image_version}/images/macos/${image_label}-Readme.md"
|
||||
releaseUrl="https://github.com/actions/runner-images/releases/tag/${image_label}%2F${image_version}"
|
||||
else
|
||||
software_url="https://github.com/actions/runner-images/blob/${release_label}/${image_version}/images/macos/${image_label}-Readme.md"
|
||||
releaseUrl="https://github.com/actions/runner-images/releases/tag/${release_label}%2F${image_version}"
|
||||
fi
|
||||
|
||||
cat <<EOF > $imagedata_file
|
||||
[
|
||||
{
|
||||
"group": "Operating System",
|
||||
"detail": "${os_name}\n${os_version}\n${os_build}"
|
||||
},
|
||||
{
|
||||
"group": "Runner Image",
|
||||
"detail": "Image: ${image_label}\nVersion: ${image_version}\nIncluded Software: ${software_url}\nImage Release: ${releaseUrl}"
|
||||
}
|
||||
]
|
||||
EOF
|
||||
|
||||
echo "export ImageVersion=$image_version" >> $HOME/.bashrc
|
||||
echo "export ImageOS=$IMAGE_OS" >> $HOME/.bashrc
|
||||
Reference in New Issue
Block a user