Skip to content

Commit 95f6bf5

Browse files
authored
install: update install-from-source to use .NET 10.0 (#2330)
The project now targets net10.0 but the install-from-source script still referenced .NET SDK 8.0. Update all references to 10.0 and fix the version parsing to use field-based extraction instead of fixed-width character slicing, which broke for two-digit major versions.
2 parents d8846d1 + 14737f4 commit 95f6bf5

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/validate-install-from-source.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
push:
66
branches:
77
- main
8+
pull_request:
9+
branches:
10+
- main
811

912
jobs:
1013
docker:
@@ -15,7 +18,7 @@ jobs:
1518
matrix:
1619
vector:
1720
- image: ubuntu
18-
- image: debian:bullseye
21+
- image: debian:bookworm
1922
- image: fedora
2023
# Centos no longer officially maintains images on Docker Hub. However,
2124
# tgagor is a contributor who pushes updated images weekly, which should

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ the preferred install method for Linux because you can use it to install on any
210210
distribution][dotnet-supported-distributions]. You
211211
can also use this method on macOS if you so choose.
212212

213-
**Note:** Make sure you have installed [version 8.0 of the .NET
213+
**Note:** Make sure you have installed [version 10.0 of the .NET
214214
SDK][dotnet-install] before attempting to run the following `dotnet tool`
215215
commands. After installing, you will also need to follow the output instructions
216216
to add the tools directory to your `PATH`.

src/linux/Packaging.Linux/install-from-source.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ensure_dotnet_installed() {
9191
if [ -z "$(verify_existing_dotnet_installation)" ]; then
9292
curl -LO https://dot.net/v1/dotnet-install.sh
9393
chmod +x ./dotnet-install.sh
94-
bash -c "./dotnet-install.sh --channel 8.0"
94+
bash -c "./dotnet-install.sh --channel 10.0"
9595

9696
# Since we have to run the dotnet install script with bash, dotnet isn't
9797
# added to the process PATH, so we manually add it here.
@@ -103,10 +103,10 @@ ensure_dotnet_installed() {
103103

104104
verify_existing_dotnet_installation() {
105105
# Get initial pieces of installed sdk version(s).
106-
sdks=$(dotnet --list-sdks | cut -c 1-3)
106+
sdks=$(dotnet --list-sdks | cut -d' ' -f1 | cut -d. -f1,2)
107107

108108
# If we have a supported version installed, return.
109-
supported_dotnet_versions="8.0"
109+
supported_dotnet_versions="10.0"
110110
for v in $supported_dotnet_versions; do
111111
if [ $(echo $sdks | grep "$v") ]; then
112112
echo $sdks
@@ -185,7 +185,7 @@ case "$distribution" in
185185
$sudo_cmd apt update
186186
$sudo_cmd apt install apt-transport-https -y
187187
$sudo_cmd apt update
188-
$sudo_cmd apt install dotnet-sdk-8.0 dpkg-dev -y
188+
$sudo_cmd apt install dotnet-sdk-10.0 dpkg-dev -y
189189
fi
190190
fi
191191
;;

0 commit comments

Comments
 (0)