mirror of
https://github.com/actions/runner-images.git
synced 2025-12-29 21:42:55 +08:00
move source code to public
This commit is contained in:
22
images/macos/provision/core/stack.sh
Normal file
22
images/macos/provision/core/stack.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Get the latest Stack version..."
|
||||
StackRelease=$(curl -s "https://api.github.com/repos/commercialhaskell/stack/releases/latest")
|
||||
DownloadUrl=$(echo $StackRelease | jq -r '.assets[].browser_download_url | select(contains("osx-x86_64.tar.gz"))' | head -n 1)
|
||||
StackVersion=$(echo $StackRelease | jq -r '.name' | cut -c2-)
|
||||
StackArchive="/tmp/stack.tar.gz"
|
||||
|
||||
echo "Download stack version $StackVersion..."
|
||||
wget $DownloadUrl -O $StackArchive
|
||||
|
||||
StackToolcachePath="$AGENT_TOOLSDIRECTORY/stack/$StackVersion"
|
||||
DestinationPath="$StackToolcachePath/x64"
|
||||
|
||||
mkdir -p $DestinationPath
|
||||
|
||||
echo "Unzip stack archive..."
|
||||
tar -xzf $StackArchive -C $DestinationPath --strip 1
|
||||
|
||||
touch $StackToolcachePath/x64.complete
|
||||
|
||||
echo "export PATH="\$PATH":$DestinationPath" >> "$HOME/.bashrc"
|
||||
Reference in New Issue
Block a user