mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Fix software and release URLs for windows and ubuntu (#7790)
This commit is contained in:
committed by
GitHub
parent
7d99ce2cad
commit
3ede1f95a7
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
imagedata_file=$IMAGEDATA_FILE
|
imagedata_file=$IMAGEDATA_FILE
|
||||||
image_version=$IMAGE_VERSION
|
image_version=$IMAGE_VERSION
|
||||||
|
image_version_major=${image_version/.*/}
|
||||||
|
image_version_minor=$(echo $image_version | cut -d "." -f 2)
|
||||||
os_name=$(lsb_release -ds | sed "s/ /\\\n/g")
|
os_name=$(lsb_release -ds | sed "s/ /\\\n/g")
|
||||||
os_version=$(lsb_release -rs)
|
os_version=$(lsb_release -rs)
|
||||||
image_label="ubuntu-${os_version}"
|
image_label="ubuntu-${os_version}"
|
||||||
@@ -9,8 +11,8 @@ version_major=${os_version/.*/}
|
|||||||
version_wo_dot=${os_version/./}
|
version_wo_dot=${os_version/./}
|
||||||
github_url="https://github.com/actions/runner-images/blob"
|
github_url="https://github.com/actions/runner-images/blob"
|
||||||
|
|
||||||
software_url="${github_url}/ubuntu${version_major}/${image_version}/images/linux/Ubuntu${version_wo_dot}-Readme.md"
|
software_url="${github_url}/ubuntu${version_major}/${image_version_major}.${image_version_minor}/images/linux/Ubuntu${version_wo_dot}-Readme.md"
|
||||||
releaseUrl="https://github.com/actions/runner-images/releases/tag/ubuntu${version_major}%2F${image_version}"
|
releaseUrl="https://github.com/actions/runner-images/releases/tag/ubuntu${version_major}%2F${image_version_major}.${image_version_minor}"
|
||||||
|
|
||||||
cat <<EOF > $imagedata_file
|
cat <<EOF > $imagedata_file
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -4,17 +4,20 @@ $osName = $caption.Substring(0, $caption.LastIndexOf(" "))
|
|||||||
$osEdition = $caption.Substring($caption.LastIndexOf(" ")+1)
|
$osEdition = $caption.Substring($caption.LastIndexOf(" ")+1)
|
||||||
$osVersion = $os.Version
|
$osVersion = $os.Version
|
||||||
$imageVersion = $env:IMAGE_VERSION
|
$imageVersion = $env:IMAGE_VERSION
|
||||||
|
$imageVersionComponents = $imageVersion.Split('.')
|
||||||
|
$imageMajorVersion = $imageVersionComponents[0]
|
||||||
|
$imageMinorVersion = $imageVersionComponents[1]
|
||||||
$imageDataFile = $env:IMAGEDATA_FILE
|
$imageDataFile = $env:IMAGEDATA_FILE
|
||||||
$githubUrl="https://github.com/actions/runner-images/blob"
|
$githubUrl="https://github.com/actions/runner-images/blob"
|
||||||
|
|
||||||
if (Test-IsWin22) {
|
if (Test-IsWin22) {
|
||||||
$imageLabel = "windows-2022"
|
$imageLabel = "windows-2022"
|
||||||
$softwareUrl = "${githubUrl}/win22/${imageVersion}/images/win/Windows2022-Readme.md"
|
$softwareUrl = "${githubUrl}/win22/$imageMajorVersion.$imageMinorVersion/images/win/Windows2022-Readme.md"
|
||||||
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win22%2F${imageVersion}"
|
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win22%2F$imageMajorVersion.$imageMinorVersion"
|
||||||
} elseif (Test-IsWin19) {
|
} elseif (Test-IsWin19) {
|
||||||
$imageLabel = "windows-2019"
|
$imageLabel = "windows-2019"
|
||||||
$softwareUrl = "${githubUrl}/win19/${imageVersion}/images/win/Windows2019-Readme.md"
|
$softwareUrl = "${githubUrl}/win19/$imageMajorVersion.$imageMinorVersion/images/win/Windows2019-Readme.md"
|
||||||
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win19%2F${imageVersion}"
|
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win19%2F$imageMajorVersion.$imageMinorVersion"
|
||||||
} else {
|
} else {
|
||||||
throw "Invalid platform version is found. Either Windows Server 2019 or 2022 are required"
|
throw "Invalid platform version is found. Either Windows Server 2019 or 2022 are required"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user