Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotNet 8 #42

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.11
- name: Setup .NET Core
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
dotnet-version: |
8.x
- name: Build with dotnet
run: dotnet build --configuration Release -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
- name: Test with dotnet
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ jobs:
steps:
- name: Download artifact
run: wget -nv ${{ github.event.release.assets[0].browser_download_url }}
- name: Setup .NET Core
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
dotnet-version: |
8.x
- name: Publish package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ jobs:
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.11
- name: Setup .NET Core
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
dotnet-version: |
8.x
- name: Build with dotnet
run: dotnet build --configuration Release -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
- name: Test with dotnet
Expand Down
17 changes: 9 additions & 8 deletions Kontent.Statiq.Tests/Kontent.Statiq.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="6.0.0" />
<PackageReference Include="FakeItEasy" Version="8.1.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="Statiq.Core" Version="1.0.0-*" />
<PackageReference Include="Statiq.Razor" Version="1.0.0-*" />
<PackageReference Include="Statiq.Testing" Version="1.0.0-*" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.assert" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 1 addition & 2 deletions Kontent.Statiq.Tests/Tools/LoggerTestExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public static void VerifyLogged(this ILogger logger, LogLevel level, string logM

if (actualLevel != level)
{
throw new AssertActualExpectedException($"[{level}] {logMessage}", $"[{actualLevel}] {actualMessage}",
$"Unexpected log level for log message");
throw new XunitException($"Unexpected log level for log message. Expected: [{level}] `{logMessage}`. Actual: [{actualLevel}] `{actualMessage}`");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ internal sealed class TestContentItemSystemAttributes : IContentItemSystemAttrib
public string Codename { get; internal set; } = "";
public string Type { get; internal set; } = "";
public string Collection { get; } = "";
public string Workflow => "";
public string WorkflowStep { get; internal set; } = "";
public IList<string> SitemapLocation { get; internal set; } = Array.Empty<string>();
public DateTime LastModified { get; internal set; }
Expand Down
2 changes: 1 addition & 1 deletion Kontent.Statiq.Tests/Tools/XUnitLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public XunitLogger(ITestOutputHelper testOutputHelper, string categoryName)
_categoryName = categoryName;
}

public IDisposable BeginScope<TState>(TState state)
public IDisposable? BeginScope<TState>(TState state) where TState : notnull
{
return NoopDisposable.Instance;
}
Expand Down
6 changes: 3 additions & 3 deletions Kontent.Statiq/Kontent.Statiq.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<Authors>Marnix van Valen</Authors>
<Company>Kontent.Statiq</Company>
<Description>Kentico Kontent module for Statiq. Fetch content and assets from Kontent headless CMS.</Description>
Expand Down Expand Up @@ -29,8 +29,8 @@
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Kontent.Ai.Delivery" Version="17.0.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.38.0.46746">
<PackageReference Include="Kontent.Ai.Delivery" Version="18.0.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.20.0.85982">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Module to retrieve content from [Kentico Kontent](https://kontent.ai) for building static websites with [Statiq](https://Statiq.dev).

Works with .NET 6.
Works with .NET 8.

## Getting started

Expand Down Expand Up @@ -63,7 +63,7 @@ public static class Program
services.AddSingleton<ITypeProvider, CustomTypeProvider>();
// Configure Delivery SDK
services.AddDeliveryClient(opts =>
opts.WithProjectId("<your-project-id>")
opts.WithEnvironmentId("<your-environment-id>")
.UseProductionApi()
.Build());
})
Expand Down
Loading