mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
[ubuntu] Rework Mono installation to avoid using apt repos (#3289)
* Rework Mono installation to avoid using apt repos on Ubuntu images * Use rest of line to read full AptSourceRepository
This commit is contained in:
@@ -58,7 +58,8 @@ function Get-ErlangVersion {
|
|||||||
|
|
||||||
function Get-MonoVersion {
|
function Get-MonoVersion {
|
||||||
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
|
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
|
||||||
return "Mono $monoVersion"
|
$aptSourceRepo = Get-AptSourceRepository -PackageName "mono"
|
||||||
|
return "Mono $monoVersion (apt source repository: $aptSourceRepo)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MsbuildVersion {
|
function Get-MsbuildVersion {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function Get-CachedToolInstances
|
|||||||
function Get-AptSourceRepository {
|
function Get-AptSourceRepository {
|
||||||
param([String] $PackageName)
|
param([String] $PackageName)
|
||||||
|
|
||||||
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part 1
|
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
||||||
return $sourceUrl
|
return $sourceUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,8 @@ echo "deb https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME mai
|
|||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget
|
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget
|
||||||
|
|
||||||
|
rm /etc/apt/sources.list.d/mono-official-stable.list
|
||||||
|
rm -f /etc/apt/sources.list.d/mono-official-stable.list.save
|
||||||
|
echo "mono https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME main" >> $HELPER_SCRIPTS/apt-sources.txt
|
||||||
|
|
||||||
invoke_tests "Tools" "Mono"
|
invoke_tests "Tools" "Mono"
|
||||||
|
|||||||
Reference in New Issue
Block a user