mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
[ubuntu] Install yq (#3646)
This commit is contained in:
@@ -123,6 +123,7 @@ $toolsList = @(
|
|||||||
(Get-HHVMVersion),
|
(Get-HHVMVersion),
|
||||||
(Get-SVNVersion),
|
(Get-SVNVersion),
|
||||||
(Get-JqVersion),
|
(Get-JqVersion),
|
||||||
|
(Get-YqVersion),
|
||||||
(Get-KindVersion),
|
(Get-KindVersion),
|
||||||
(Get-KubectlVersion),
|
(Get-KubectlVersion),
|
||||||
(Get-KustomizeVersion),
|
(Get-KustomizeVersion),
|
||||||
|
|||||||
@@ -278,3 +278,8 @@ function Get-ZstdVersion {
|
|||||||
$zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter ","
|
$zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter ","
|
||||||
return "zstd $zstdVersion (homebrew)"
|
return "zstd $zstdVersion (homebrew)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-YqVersion {
|
||||||
|
$yqVersion = ($(yq -V) -Split " ")[-1]
|
||||||
|
return "yq $yqVersion"
|
||||||
|
}
|
||||||
|
|||||||
16
images/linux/scripts/installers/yq.sh
Normal file
16
images/linux/scripts/installers/yq.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
# Source the helpers for use with the script
|
||||||
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|
||||||
|
YQ_BINARY=yq_linux_amd64
|
||||||
|
|
||||||
|
# As per https://github.com/mikefarah/yq#wget
|
||||||
|
YQ_URL=$(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r ".assets[].browser_download_url | select(endswith(\"$YQ_BINARY.tar.gz\"))")
|
||||||
|
echo "Downloading latest yq from $YQ_URL"
|
||||||
|
|
||||||
|
download_with_retries "$YQ_URL" "/tmp" "${YQ_BINARY}.tar.gz"
|
||||||
|
tar xzf "/tmp/${YQ_BINARY}.tar.gz" -C "/tmp"
|
||||||
|
mv /tmp/${YQ_BINARY} /usr/local/bin/yq
|
||||||
|
|
||||||
|
invoke_tests "Tools" "yq"
|
||||||
@@ -377,3 +377,9 @@ Describe "Ruby" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Describe "yq" {
|
||||||
|
It "yq" {
|
||||||
|
"yq -V" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -248,6 +248,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||||
"{{template_dir}}/scripts/installers/android.sh",
|
"{{template_dir}}/scripts/installers/android.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/yq.sh",
|
||||||
"{{template_dir}}/scripts/installers/pypy.sh",
|
"{{template_dir}}/scripts/installers/pypy.sh",
|
||||||
"{{template_dir}}/scripts/installers/python.sh"
|
"{{template_dir}}/scripts/installers/python.sh"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -248,6 +248,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||||
"{{template_dir}}/scripts/installers/android.sh",
|
"{{template_dir}}/scripts/installers/android.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/yq.sh",
|
||||||
"{{template_dir}}/scripts/installers/pypy.sh",
|
"{{template_dir}}/scripts/installers/pypy.sh",
|
||||||
"{{template_dir}}/scripts/installers/python.sh",
|
"{{template_dir}}/scripts/installers/python.sh",
|
||||||
"{{template_dir}}/scripts/installers/graalvm.sh"
|
"{{template_dir}}/scripts/installers/graalvm.sh"
|
||||||
|
|||||||
@@ -269,4 +269,4 @@ function Get-SwigVersion {
|
|||||||
(swig -version | Out-String) -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
(swig -version | Out-String) -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$swigVersion = $Matches.Version
|
$swigVersion = $Matches.Version
|
||||||
return "Swig $swigVersion"
|
return "Swig $swigVersion"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user