mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
* set -e and fix all the scripts * add source utils to finalize_vm script * change xcode version in postbuild script * fix for softwareupdates and for xcode version
28 lines
886 B
Bash
28 lines
886 B
Bash
#!/bin/bash -e -o pipefail
|
|
|
|
source ~/utils/utils.sh
|
|
source ~/utils/xamarin-utils.sh
|
|
|
|
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
|
|
if [ $VSMAC_VERSION == "latest" ]; then
|
|
VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version | tr -d \")
|
|
fi
|
|
VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION)
|
|
|
|
TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX`
|
|
TMPMOUNT_DOWNLOADS="$TMPMOUNT/downloads"
|
|
mkdir $TMPMOUNT_DOWNLOADS
|
|
|
|
download_with_retries $VSMAC_DOWNLOAD_URL $TMPMOUNT_DOWNLOADS
|
|
|
|
echo "Mounting Visual studio..."
|
|
VISUAL_STUDIO_NAME=${VSMAC_DOWNLOAD_URL##*/}
|
|
hdiutil attach "$TMPMOUNT_DOWNLOADS/$VISUAL_STUDIO_NAME" -mountpoint "$TMPMOUNT"
|
|
|
|
echo "Moving Visual Studio to /Applications/..."
|
|
pushd $TMPMOUNT
|
|
tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
|
|
|
|
popd
|
|
sudo hdiutil detach "$TMPMOUNT"
|
|
sudo rm -rf "$TMPMOUNT" |