From edf51bcd09049f369ab84abd99e6698b7f756aae Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 15 Jan 2024 12:31:40 -0800 Subject: [PATCH] Update build to use .NET SDK 8 and C# 12 --- .github/workflows/.global.json | 6 ++++++ .github/workflows/pull-request.yaml | 6 +++++- .github/workflows/push-main.yaml | 6 +++++- Directory.build.props | 2 +- build.ps1 | 4 ++-- test/Directory.Build.props | 2 +- tools/builder/build.csproj | 3 +-- 7 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/.global.json diff --git a/.github/workflows/.global.json b/.github/workflows/.global.json new file mode 100644 index 00000000..c19a2e05 --- /dev/null +++ b/.github/workflows/.global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "8.0.100", + "rollForward": "latestMinor" + } +} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index cc9e5328..8e1c74ec 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -19,12 +19,16 @@ jobs: - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1 + - name: Replace global.json + run: cp .github/workflows/.global.json global.json + shell: bash + - name: Install .NET SDK uses: actions/setup-dotnet@v3 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - name: Get .NET information run: dotnet --info diff --git a/.github/workflows/push-main.yaml b/.github/workflows/push-main.yaml index 7f492e72..8c1b63c4 100644 --- a/.github/workflows/push-main.yaml +++ b/.github/workflows/push-main.yaml @@ -22,12 +22,16 @@ jobs: - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1 + - name: Replace global.json + run: cp .github/workflows/.global.json global.json + shell: bash + - name: Install .NET SDK uses: actions/setup-dotnet@v3 with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - name: Get .NET information run: dotnet --info diff --git a/Directory.build.props b/Directory.build.props index 051bc124..81c914e7 100644 --- a/Directory.build.props +++ b/Directory.build.props @@ -7,7 +7,7 @@ Copyright (c) .NET Foundation and Contributors. embedded true - latest + 12.0 false logo-512-transparent.png MIT diff --git a/build.ps1 b/build.ps1 index ab07d380..d57d44e0 100644 --- a/build.ps1 +++ b/build.ps1 @@ -21,8 +21,8 @@ if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) { } $version = [Version]$([regex]::matches((&dotnet --version), '^(\d+\.)?(\d+\.)?(\*|\d+)').value) -if ($version.Major -lt 7) { - throw ".NET SDK version ($version) is too low; please install version 7.0 or later" +if ($version.Major -lt 8) { + throw ".NET SDK version ($version) is too low; please install version 8.0 or later" } if ($null -eq (Get-Command "msbuild.exe" -ErrorAction Ignore)) { diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 0ab2a9fd..a9562c55 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -5,7 +5,7 @@ true portable false - latest + 12.0 $(MSBuildProjectName) 99.99.99-dev true diff --git a/tools/builder/build.csproj b/tools/builder/build.csproj index 55187ba4..0f6aaf88 100644 --- a/tools/builder/build.csproj +++ b/tools/builder/build.csproj @@ -1,11 +1,10 @@ - 10.0 $(NoWarn);CS8002 enable Exe - net6.0 + net8.0 true