From 46c2dd7d39651182be3ad918f45b8769efe01b5e Mon Sep 17 00:00:00 2001 From: Gabriel Weyer Date: Sat, 18 Nov 2023 13:41:43 +1100 Subject: [PATCH] Use .NET 8 to build [skip-release] --- .circleci/config.yml | 2 +- .github/workflows/build.yml | 7 +++++-- .github/workflows/security-scanning-csharp.yml | 6 ++++++ Directory.Packages.props | 1 - README.md | 12 ++++++------ appveyor.yml | 4 ++-- azure-pipelines.yml | 4 ++-- build.cake | 4 ++-- src/ExtraLogic/ExtraLogic.csproj | 6 ------ src/Logic/Logic.csproj | 4 ---- src/SuperLogic/SuperLogic.csproj | 6 ------ tests/HelloTests/HelloTests.csproj | 2 +- 12 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9983797..a051549 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: build: docker: - - image: mcr.microsoft.com/dotnet/sdk:6.0-focal + - image: mcr.microsoft.com/dotnet/sdk:8.0 steps: - checkout - run: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78ae119..14ba0fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,8 +39,11 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install latest .NET SDK - run: .\build\dotnet-install.ps1 + - uses: actions/setup-dotnet@v3 + name: Install .NET 8 + with: + dotnet-version: '8.0.x' + dotnet-quality: 'ga' - name: Restore .NET tools run: dotnet tool restore - name: Build diff --git a/.github/workflows/security-scanning-csharp.yml b/.github/workflows/security-scanning-csharp.yml index ce38e78..9bf59c9 100644 --- a/.github/workflows/security-scanning-csharp.yml +++ b/.github/workflows/security-scanning-csharp.yml @@ -26,6 +26,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - name: Install .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + dotnet-quality: 'ga' + - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/Directory.Packages.props b/Directory.Packages.props index 04192d2..5b0d65c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,6 +9,5 @@ - diff --git a/README.md b/README.md index f0fd77f..5d7476a 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ | CI | Status | Platform(s) | Framework(s) | Test Framework(s) | | --- | --- | --- | --- | --- | -| [AppVeyor](#appveyor) | [![Build Status][app-veyor-shield]][app-veyor] | `Windows` | `netstandard2.0`, `net462` | `net6.0`, `net462` | -| [Azure DevOps](#azure-devops) | [![Build Status][azure-devops-shield]][azure-devops] | `Linux` | `netstandard2.0` | `net6.0` | -| [CircleCI](#circleci) | [![Build Status][circle-ci-shield]][circle-ci] | `Docker`: `mcr.microsoft.com/dotnet/sdk:6.0-focal` | `netstandard2.0` | `net6.0` | -| [GitHub](#github) | [![Build Status][github-actions-shield]][github-actions] | `Windows` | `netstandard2.0`, `net462` | `net6.0`, `net462` | +| [AppVeyor](#appveyor) | [![Build Status][app-veyor-shield]][app-veyor] | `Windows` | `netstandard2.0`, `net462` | `net8.0`, `net462` | +| [Azure DevOps](#azure-devops) | [![Build Status][azure-devops-shield]][azure-devops] | `Linux` | `netstandard2.0` | `net8.0` | +| [CircleCI](#circleci) | [![Build Status][circle-ci-shield]][circle-ci] | `Docker`: `mcr.microsoft.com/dotnet/sdk:8.0` | `netstandard2.0` | `net8.0` | +| [GitHub](#github) | [![Build Status][github-actions-shield]][github-actions] | `Windows` | `netstandard2.0`, `net462` | `net8.0`, `net462` | Demonstrates a basic build of a `.NET` `NuGet` package using [Cake][cake]. @@ -45,7 +45,7 @@ This is done by using `Cake` as a `.NET` **local** tool. The version is specifie ### Pre-requisites -- [.NET SDK 6.0.x][dotnet-sdk] and higher +- [.NET SDK 8.0.x][dotnet-sdk] and higher ### Initial setup on Windows @@ -204,7 +204,7 @@ After a branch was configured as `protected`, `GitHub` will suggest available [s [github-status-checks]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging [circle-ci]: https://app.circleci.com/pipelines/github/gabrielweyer/cake-build [circle-ci-shield]: https://circleci.com/gh/gabrielweyer/cake-build/tree/main.svg?style=shield -[dotnet-sdk]: https://dotnet.microsoft.com/download/dotnet/6.0 +[dotnet-sdk]: https://dotnet.microsoft.com/download/dotnet/8.0 [azure-devops-shield]: https://dev.azure.com/gabrielweyer/cake-build/_apis/build/status/Cake?branchName=main [azure-devops]: https://dev.azure.com/gabrielweyer/cake-build/_build/latest?definitionId=12&branchName=main [cake-build-post]: https://gabrielweyer.net/2018/04/21/cake-build/ diff --git a/appveyor.yml b/appveyor.yml index f35d195..8a6d78e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ assembly_info: # We'll version the binaries and the NuGet package in the build script patch: false # We'll run the tests in the build script -test: off +test: false # AppVeyor will create a release tag if a matching one does not exist # hence triggering another build skip_tags: true @@ -16,7 +16,7 @@ environment: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # `install` will run before `build_script` install: - # Cake build is targeting `.NET` `6.0.x`, so we can safely install the latest supported `SDK` + # Cake build is targeting `.NET` `8.0.x`, so we can safely install the latest supported `SDK` # The `SDK` is required to restore, build, publish... a `.NET` application # https://www.microsoft.com/net/download/windows - pwsh: .\build\dotnet-install.ps1 -InstallDir 'C:\Program Files\dotnet\' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9e3ffa1..4f147b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,10 +17,10 @@ trigger: steps: - task: UseDotNet@2 - displayName: 'Install .NET SDK 6.0.100' + displayName: 'Install .NET SDK 8' inputs: packageType: sdk - version: 6.0.100 + version: 8.0.x installationPath: $(Agent.ToolsDirectory)/dotnet - bash: | diff --git a/build.cake b/build.cake index fd649f5..242413a 100644 --- a/build.cake +++ b/build.cake @@ -104,7 +104,7 @@ Task("Build") .ToList() .ForEach(f => DotNetBuild(f.FullPath, settings)); - settings.Framework = "net6.0"; + settings.Framework = "net8.0"; GetFiles("./tests/*/*Tests.csproj") .ToList() @@ -124,7 +124,7 @@ Task("ListTestProjectsAndFrameworkVersions") parsedProject.TargetFrameworkVersions.ToList().ForEach(frameworkVersion => { - if (IsRunningOnLinuxOrDarwin() && frameworkVersion != "net6.0") + if (IsRunningOnLinuxOrDarwin() && frameworkVersion != "net8.0") { Information($"Skipping test project '{parsedProject.AssemblyName}' framework '{frameworkVersion}' as we're not running on Windows"); return; diff --git a/src/ExtraLogic/ExtraLogic.csproj b/src/ExtraLogic/ExtraLogic.csproj index 81d19e9..44df772 100644 --- a/src/ExtraLogic/ExtraLogic.csproj +++ b/src/ExtraLogic/ExtraLogic.csproj @@ -7,10 +7,4 @@ Contoso.Hello.ExtraLogic false - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/src/Logic/Logic.csproj b/src/Logic/Logic.csproj index f344c7f..7b5ec96 100644 --- a/src/Logic/Logic.csproj +++ b/src/Logic/Logic.csproj @@ -16,9 +16,5 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/SuperLogic/SuperLogic.csproj b/src/SuperLogic/SuperLogic.csproj index b188ec4..c2fbd44 100644 --- a/src/SuperLogic/SuperLogic.csproj +++ b/src/SuperLogic/SuperLogic.csproj @@ -26,10 +26,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/tests/HelloTests/HelloTests.csproj b/tests/HelloTests/HelloTests.csproj index 83ac992..a9cb2f2 100644 --- a/tests/HelloTests/HelloTests.csproj +++ b/tests/HelloTests/HelloTests.csproj @@ -1,6 +1,6 @@  - net6.0;net462 + net462;net8.0 latest enable false