onnxruntime/tools/ci_build/github/linux/docker/scripts/install_dotnet.sh
Scott McKay 44fc7b443c
Update C# test projects (#21631)
### Description
<!-- Describe your changes. -->
Update various test projects to .net8 from EOL frameworks.
Replace the Xamarin based Android and iOS test projects with a MAUI
based project that uses .net 8.
Add new CoreML flags to C# bindings

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Remove usage of EOL frameworks.
2024-09-05 08:21:23 +10:00

23 lines
969 B
Bash
Executable file

#!/bin/bash
set -e -x
if [ -f /etc/redhat-release ]; then
# If you found the following command went successfully but dotnet command still reports no sdk was found, most likely
# it was because the dotnet packages were installed from more than one dnf repos.
dnf install -y dotnet-sdk-8.0 dotnet-runtime-8.0
elif [ -f /etc/os-release ]; then
# Get Ubuntu version
declare repo_version
repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
# Download Microsoft signing key and repository
wget "https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb
# Install Microsoft signing key and repository
dpkg -i packages-microsoft-prod.deb
# Clean up
rm packages-microsoft-prod.deb
# Update packages
apt-get update && apt-get install -y dotnet-sdk-8.0
else
echo "Unsupported OS"
exit 1
fi