Files
runner-images/images/ubuntu/scripts/build/install-mono.sh
T

37 lines
1.2 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-mono.sh
## Desc: Install Mono
################################################################################
2023-12-29 12:36:27 +01:00
# Source the helpers for use with the script
2022-07-25 13:26:39 +04:00
source $HELPER_SCRIPTS/os.sh
2023-12-29 12:36:27 +01:00
os_label=$(lsb_release -cs)
REPO_URL="https://download.mono-project.com/repo/ubuntu"
GPG_KEY="/usr/share/keyrings/mono-official-stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/mono-official-stable.list"
2022-07-25 13:26:39 +04:00
# There are no packages for Ubuntu 22 in the repo, but developers confirmed that packages from Ubuntu 20 should work
2023-12-26 12:50:52 +01:00
if is_ubuntu22; then
2023-12-29 12:36:27 +01:00
os_label="focal"
2022-07-25 13:26:39 +04:00
fi
# Install Mono repo
curl -fsSL https://download.mono-project.com/repo/xamarin.gpg | gpg --dearmor -o $GPG_KEY
echo "deb [signed-by=$GPG_KEY] $REPO_URL stable-$os_label main" > $REPO_PATH
# Install Mono
apt-get update
2024-05-29 13:43:07 +02:00
apt-get install --no-install-recommends apt-transport-https mono-complete nuget
# Remove Mono's apt repo
rm $REPO_PATH
rm -f "${REPO_PATH}.save"
rm $GPG_KEY
2023-12-29 12:36:27 +01:00
# Document source repo
2023-12-29 12:36:27 +01:00
echo "mono https://download.mono-project.com/repo/ubuntu stable-$os_label main" >> $HELPER_SCRIPTS/apt-sources.txt
2020-12-29 10:02:46 +03:00
invoke_tests "Tools" "Mono"