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:
committed by
GitHub
parent
efcaf8c96c
commit
15f9808a68
@@ -220,6 +220,7 @@ jobs:
|
|||||||
- js
|
- js
|
||||||
- pwsh
|
- pwsh
|
||||||
- rust
|
- rust
|
||||||
|
- dotnet
|
||||||
- custom
|
- custom
|
||||||
steps:
|
steps:
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ scripts=(
|
|||||||
js
|
js
|
||||||
rust
|
rust
|
||||||
vcpkg
|
vcpkg
|
||||||
|
dotnet
|
||||||
)
|
)
|
||||||
|
|
||||||
for SCRIPT in "${scripts[@]}"; do
|
for SCRIPT in "${scripts[@]}"; do
|
||||||
|
|||||||
Executable
+31
@@ -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"
|
||||||
@@ -26,7 +26,8 @@ function replaceEtcEnvironmentVariable {
|
|||||||
variable_value="$2"
|
variable_value="$2"
|
||||||
|
|
||||||
# modify /etc/environemnt in place by replacing a string that begins with variable_name
|
# modify /etc/environemnt in place by replacing a string that begins with variable_name
|
||||||
sudo sed -i -e "s%^${variable_name}=.*$%${variable_name}=\"${variable_value}\"%" /etc/environment
|
# removed quotes for the docker env metadata reader
|
||||||
|
sudo sed -i -e "s%^${variable_name}=.*$%${variable_name}=${variable_value}%" /etc/environment
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEtcEnvironmentVariable {
|
function setEtcEnvironmentVariable {
|
||||||
|
|||||||
Reference in New Issue
Block a user