feature: add .NET installation (#90)

* file: add .NET installation script dotnet.sh

* feat: add dotnet installation to custom image

* feat: add dotnet to build matrix

* Prepend `PATH` correctly
This commit is contained in:
Christian Helmich
2023-04-25 13:00:17 +02:00
committed by GitHub
parent efcaf8c96c
commit 15f9808a68
4 changed files with 35 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash -e
################################################################################
## File: dotnet.sh
## Desc: Installs dotnet CLI
## Must be run as non-root user after homebrew
################################################################################
# Install dotnet CLI
. /imagegeneration/installers/helpers/etc-environment.sh
printf "\n\t🐋 Installing .NET 🐋\t\n"
#apt-get install -y dotnet-sdk-7.0 dotnet-sdk-6.0 dotnet-runtime-7.0 dotnet-runtime-6.0
curl -LO https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
cat ./dotnet-install.sh
bash ./dotnet-install.sh --install-dir /opt/hostedtoolcache/dotnet --no-path --channel STS # net 7.0
bash ./dotnet-install.sh --install-dir /opt/hostedtoolcache/dotnet --no-path --channel LTS # net 6.0
rm ./dotnet-install.sh
export DOTNET_ROOT=/opt/hostedtoolcache/dotnet
export PATH=$PATH:$DOTNET_ROOT
{
echo "DOTNET_ROOT=${DOTNET_ROOT}"
} | tee -a /etc/environment
prependEtcEnvironmentPath "${DOTNET_ROOT}"
which dotnet
dotnet --version
dotnet --info
#dotnet --list-sdks
#dotnet --list-runtimes
printf "\n\t🐋 Installed .NET 🐋\t\n"