Skip to content
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: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --logger GitHubActions
run: dotnet test -c Release --no-build

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ on:
tags:
- '**'

permissions:
contents: write

jobs:
release:
permissions:
id-token: write # enable GitHub OIDC token issuance for this job
contents: write # enable github releases

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: Restore dependencies
run: dotnet restore
Expand All @@ -31,8 +32,15 @@ jobs:

- name: Package
run: dotnet pack -c Release --no-build --property:PackageOutputPath=../../nupkgs

- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: viceroypenguin

- name: Push to Nuget
run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGETPUBLISHKEY }}
run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ steps.login.outputs.NUGET_API_KEY }}

- name: Create Release
uses: ncipollo/release-action@v1
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>14</LangVersion>
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting <LangVersion>14</LangVersion> effectively requires a .NET SDK/new enough compiler for all contributors. Since there is no global.json in the repo to pin/declare the required SDK, builds may fail inconsistently depending on the locally installed SDK. Consider adding a global.json that pins a compatible SDK (or reverting to latest/latestMajor) to make the requirement explicit.

Suggested change
<LangVersion>14</LangVersion>
<LangVersion>latest</LangVersion>

Copilot uses AI. Check for mistakes.

<Nullable>enable</Nullable>
<WarningsAsErrors>$(WarningsAsErrors);nullable;</WarningsAsErrors>
Expand All @@ -11,12 +12,12 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<CollectCoverage>true</CollectCoverage>
Expand Down
29 changes: 17 additions & 12 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Immediate.Handlers" Version="2.1.0" />
<PackageVersion Include="MinVer" Version="6.0.0" />
<PackageVersion Include="TUnit.Engine" Version="0.19.86" />
<PackageVersion Include="xunit.v3.assert" Version="2.0.1" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="2.0.2" />
<PackageVersion Include="Immediate.Handlers" Version="3.1.0" />
<PackageVersion Include="MinVer" Version="7.0.0" />
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net8.0'">
Expand All @@ -22,14 +20,21 @@
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net9.0'">
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.12" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.12" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.12" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.12" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net10.0'">
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
</ItemGroup>

<ItemGroup>
<GlobalPackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="All" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.197" PrivateAssets="All" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.298" PrivateAssets="All" />
<GlobalPackageReference Include="Meziantou.Polyfill" Version="1.0.101" PrivateAssets="All" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Immediate.Cache.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<File Path=".gitignore" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="global.json" />
<File Path="readme.md" />
</Folder>
<Folder Name="/.root/workflows/">
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
5 changes: 0 additions & 5 deletions src/Immediate.Cache.Shared/Immediate.Cache.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<RootNamespace>Immediate.Cache</RootNamespace>
</PropertyGroup>

Expand All @@ -12,8 +11,4 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
</ItemGroup>

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the conditional MSBuild <Using Alias="Lock" Include="System.Object" ...> breaks builds for net8.0: the code uses the Lock type (e.g., ApplicationCacheBase.cs), but Lock is only available on newer frameworks. Since the repo still targets net8.0 (via Directory.Build.props), reintroduce a conditional alias for net8.0 (or change the code to use object / conditional compilation) so multi-targeting continues to compile.

Suggested change
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<Using Include="System.Object" Alias="Lock" />
</ItemGroup>

Copilot uses AI. Check for mistakes.
<ItemGroup>
<Using Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Alias="Lock" Include="System.Object" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/Immediate.Cache/Immediate.Cache.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
Expand Down
Loading