Skip to content

Commit

Permalink
Use .NET 8 to build
Browse files Browse the repository at this point in the history
[skip-release]
  • Loading branch information
gabrielweyer committed Nov 18, 2023
1 parent 3f3050c commit 46c2dd7
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/security-scanning-csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\'
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions src/ExtraLogic/ExtraLogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@
<RootNamespace>Contoso.Hello.ExtraLogic</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
4 changes: 0 additions & 4 deletions src/Logic/Logic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,5 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions src/SuperLogic/SuperLogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,4 @@
<BuildOutputInPackage Include="$(OutputPath)Contoso.Hello.ExtraLogic.dll" />
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/HelloTests/HelloTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down

0 comments on commit 46c2dd7

Please sign in to comment.