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
6 changes: 3 additions & 3 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ updates:
- package-ecosystem: nuget
directories:
- "/src/Ulid"
- "/src/Dapper.Impl"
- "/src/EFCore.Impl"
- "/src/LinqToDB.Impl"
- "/src/Dapper"
- "/src/EFCore"
- "/src/LinqToDB"
- "/src/DB.Shared"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-aot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore src/ByteAether.Ulid.slnx -p:Configuration=CI-Release --use-current-runtime -p:SelfContained=true
run: dotnet restore src/Ulid.Tests.AotConsole/Tests.AotConsole.csproj -p:Configuration=CI-Release --use-current-runtime -p:SelfContained=true

- name: Build and Publish AOT Console Application (${{ matrix.os }})
run: dotnet publish src/Ulid.Tests.AotConsole/Tests.AotConsole.csproj --configuration CI-Release --no-restore --use-current-runtime --self-contained true -o ./publish
Expand Down
104 changes: 62 additions & 42 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,77 @@ on:
workflow_dispatch:

jobs:
build:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Checkout code
uses: actions/checkout@v7

- name: Get Short SHA
id: vars
run: echo "sha_short=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Get Short SHA
id: vars
run: echo "sha_short=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
10.x
9.x
8.x
7.x
6.x
5.x
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.x

- name: Restore dependencies
run: dotnet restore src/ByteAether.Ulid.slnx -p:Configuration=CI-Release
- name: Restore dependencies
run: dotnet restore src/ByteAether.Ulid.slnx -p:Configuration=CI-Debug

- name: Build
run: dotnet build src/ByteAether.Ulid.slnx --configuration CI-Release --no-restore
- name: Build
run: dotnet build src/ByteAether.Ulid.slnx --configuration CI-Debug --no-restore

- name: Upload DLLs
uses: actions/upload-artifact@v7
with:
name: dlls-${{ steps.vars.outputs.sha_short }}
path: |
./**/Ulid/bin/**/*.dll
./**/EFCore.Impl/bin/**/*.dll
- name: Upload DLLs
uses: actions/upload-artifact@v7
with:
name: dlls-${{ steps.vars.outputs.sha_short }}
path: |
./**/Ulid/bin/**/*.dll
./**/EFCore/bin/**/*.dll
./**/LinqToDB/bin/**/*.dll
./**/Dapper/bin/**/*.dll

- name: Run tests
continue-on-error: true
run: dotnet test src/ByteAether.Ulid.slnx --configuration CI-Release --no-build --verbosity normal --logger "trx"
- name: Run framework tests
run: |
frameworks=(
"net10.0"
"net9.0"
"net8.0"
"net7.0"
"net6.0"
"net5.0"
"netstandard2.1"
"netstandard2.0"
)

failed=0
for tfm in "${frameworks[@]}"; do
echo "::group::Testing $tfm"
if ! dotnet test src/ByteAether.Ulid.slnx --configuration CI-Debug -p:ImplTargetFramework=$tfm --verbosity normal --logger "trx;LogFileName=results-$tfm.trx"; then
echo "❌ Tests failed for $tfm"
failed=1
fi
echo "::endgroup::"
done

if [ $failed -eq 1 ]; then
echo "One or more target framework tests failed."
exit 1
fi

- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: test-results-${{ steps.vars.outputs.sha_short }}
path: ./**/TestResults/**/*.trx
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: test-results-${{ steps.vars.outputs.sha_short }}
path: ./**/TestResults/**/*.trx

- name: Pack
run: dotnet pack src/ByteAether.Ulid.slnx --configuration CI-Release -p:ContinuousIntegrationBuild=true -p:PackageVersion=0.0.0-ci-${{ steps.vars.outputs.sha_short }} -p:PackageReleaseNotes="CI Build ${{ steps.vars.outputs.sha_short }}" --output ./output
- name: Pack
run: dotnet pack src/ByteAether.Ulid.slnx --configuration CI-Debug -p:ContinuousIntegrationBuild=true -p:PackageVersion=0.0.0-ci-${{ steps.vars.outputs.sha_short }} -p:PackageReleaseNotes="CI Build ${{ steps.vars.outputs.sha_short }}" --output ./output

- name: Upload NuGet package
uses: actions/upload-artifact@v7
with:
name: nugets-${{ steps.vars.outputs.sha_short }}
path: ./output/*.nupkg
- name: Upload NuGet package
uses: actions/upload-artifact@v7
with:
name: nugets-${{ steps.vars.outputs.sha_short }}
path: ./output/*.nupkg
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ This library explicitly **multi-targets** each runtime version listed below, ena
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 9.0](https://img.shields.io/badge/.NET-9.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-green)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-green)
![.NET 5.0](https://img.shields.io/badge/.NET-5.0-yellow)
![.NET Standard 2.1](https://img.shields.io/badge/.NET-Standard_2.1-yellow)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-green)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-brightgreen)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-brightgreen)
![.NET 5.0](https://img.shields.io/badge/.NET-5.0-brightgreen)
![.NET Standard 2.1](https://img.shields.io/badge/.NET-Standard_2.1-brightgreen)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-brightgreen)

- **Universally Unique**: Ensures global uniqueness across systems.
- **Sortable**: Lexicographically ordered for time-based sorting.
Expand Down Expand Up @@ -321,8 +321,8 @@ Includes a `JsonConverter` for easy serialization and deserialization.
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 9.0](https://img.shields.io/badge/.NET-9.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-green)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-green)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-brightgreen)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-brightgreen)

To seamlessly use ULIDs with [Entity Framework Core](https://github.com/dotnet/efcore), install the specialized extension package:

Expand Down Expand Up @@ -387,7 +387,7 @@ More details in the package's [PACKAGE.md](./src/EFCore/PACKAGE.md) file.
![.NET AOT Ready](https://img.shields.io/badge/.NET-AOT_Ready-blue)
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-green)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-brightgreen)

To integrate with [LinqToDB](https://github.com/linq2db/linq2db), install the specialized extension package:

Expand Down Expand Up @@ -423,7 +423,7 @@ More details in the package's [PACKAGE.md](./src/LinqToDB/PACKAGE.md) file.
![.NET AOT Ready](https://img.shields.io/badge/.NET-AOT_Ready-blue)
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-green)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-brightgreen)

To integrate with [Dapper](https://github.com/DapperLib/Dapper), install the specialized extension package:

Expand Down
25 changes: 19 additions & 6 deletions src/ByteAether.Ulid.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

<Folder Name="/Ulid/">
<Project Path="Ulid/Impl.csproj" />
<Project Path="Ulid.Tests/Tests.csproj" />
<Project Path="Ulid.Tests.AotConsole/Tests.AotConsole.csproj" />
<Project Path="Ulid.Tests/Tests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
<Project Path="Ulid.Tests.AotConsole/Tests.AotConsole.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
<Project Path="Ulid.Benchmarks/Benchmarks.csproj">
<Build Solution="CI-Debug|*" Project="false" />
<Build Solution="CI-Release|*" Project="false" />
Expand All @@ -18,24 +22,33 @@

<Folder Name="/DB/">
<Project Path="DB.Shared/DB.Shared.csproj" />
<Project Path="DB.Shared.Tests/DB.Shared.Tests.csproj" />
<Project Path="DB.Shared.Tests/DB.Shared.Tests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
</Folder>
<Folder Name="/DB/EFCore/">
<Project Path="EFCore/EFCore.Impl.csproj" />
<Project Path="EFCore.IntegrationTests/EFCore.IntegrationTests.csproj" />
<Project Path="EFCore.IntegrationTests/EFCore.IntegrationTests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
</Folder>
<Folder Name="/DB/LinqToDB/">
<Project Path="LinqToDB\LinqToDB.Impl.csproj" />
<Project Path="LinqToDB.IntegrationTests\LinqToDB.IntegrationTests.csproj" />
<Project Path="LinqToDB.IntegrationTests\LinqToDB.IntegrationTests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
</Folder>
<Folder Name="/DB/Dapper/">
<Project Path="Dapper/Dapper.Impl.csproj" />
<Project Path="Dapper.IntegrationTests/Dapper.IntegrationTests.csproj" />
<Project Path="Dapper.IntegrationTests/Dapper.IntegrationTests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
</Folder>

<Folder Name="/Solution Items/">
<File Path="../README.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path=".editorconfig" />
<File Path=".runsettings" />
</Folder>
Expand Down
7 changes: 4 additions & 3 deletions src/DB.Shared.Tests/DB.Shared.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<IsTestProject>true</IsTestProject>
<SupportedImplFrameworks>net10.0;net8.0;net6.0;netstandard2.0</SupportedImplFrameworks>

<IsTestProject Condition="$(SupportedImplFrameworks.Contains('$(ImplTargetFramework)'))">true</IsTestProject>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<UseDataCollector/>
Expand All @@ -11,8 +13,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\DB.Shared\DB.Shared.csproj" />
<ProjectReference Include="..\Ulid\Impl.csproj" />
<ProjectReference Include="..\DB.Shared\DB.Shared.csproj" SetTargetFramework="TargetFramework=$(ImplTargetFramework)" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/DB.Shared/DB.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net10.0;net8.0;net6.0;netstandard2.0</TargetFrameworks>
<OutputType>library</OutputType>
<IsAotCompatible>true</IsAotCompatible>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<RootNamespace>ByteAether.Ulid.DB.Shared</RootNamespace>
Expand Down
8 changes: 5 additions & 3 deletions src/Dapper.IntegrationTests/Dapper.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net8.0;net7.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<TargetFramework>net10.0</TargetFramework>
<SupportedImplFrameworks>net10.0;net8.0;netstandard2.0</SupportedImplFrameworks>

<IsTestProject Condition="$(SupportedImplFrameworks.Contains('$(ImplTargetFramework)'))">true</IsTestProject>
<NoWarn>NU1903</NoWarn>

<RootNamespace>ByteAether.Ulid.Dapper.IntegrationTests</RootNamespace>
Expand All @@ -13,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.Impl.csproj" />
<ProjectReference Include="..\Dapper\Dapper.Impl.csproj" SetTargetFramework="TargetFramework=$(ImplTargetFramework)" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Dapper/PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For the core library and full details, visit our [GitHub repository](https://git
![.NET AOT Ready](https://img.shields.io/badge/.NET-AOT_Ready-blue)
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-green)
![.NET Standard 2.0](https://img.shields.io/badge/.NET-Standard_2.0-brightgreen)

- **Version Support**: Fully compatible with **[Dapper](https://github.com/DapperLib/Dapper) versions 2.0.0 and newer**.
- **Automated Configuration**: Register mappings globally across your entire application runtime using a single configuration call.
Expand Down
12 changes: 4 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

<PackageLicenseExpression>MIT</PackageLicenseExpression>

<!-- Default to net10.0 if not specified via CLI -->
<ImplTargetFramework Condition="'$(ImplTargetFramework)' == ''">net10.0</ImplTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'CI-Release'"><Optimize>true</Optimize>
Expand All @@ -48,14 +50,8 @@
</ItemGroup>

<ItemGroup Condition="$(IsTestProject) == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0'"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'"/>

<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2" Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" Condition="'$(TargetFramework)' != 'net6.0' And '$(TargetFramework)' != 'net7.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
22 changes: 22 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<PropertyGroup Condition="'$(IsTestProject)' == 'true' And '$(ImplTargetFramework)' != ''">
<!-- 1. Stop .NET SDK from automatically adding default net10.0 symbols -->
<DisableImplicitFrameworkDefines>true</DisableImplicitFrameworkDefines>

<!-- 2. NETCOREAPP (defined only for non-netstandard / non-net4x) -->
<DefineConstants Condition="!$(ImplTargetFramework.StartsWith('netstandard')) And !$(ImplTargetFramework.StartsWith('net4'))">$(DefineConstants);NETCOREAPP</DefineConstants>

<!-- 3. NETSTANDARD -->
<DefineConstants Condition="$(ImplTargetFramework.StartsWith('netstandard'))">$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants Condition="'$(ImplTargetFramework)' == 'netstandard2.0'">$(DefineConstants);NETSTANDARD2_0;NETSTANDARD2_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="'$(ImplTargetFramework)' == 'netstandard2.1'">$(DefineConstants);NETSTANDARD2_0_OR_GREATER;NETSTANDARD2_1;NETSTANDARD2_1_OR_GREATER</DefineConstants>

<!-- 4. Version-specific compatibility constants -->
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net5.0'))">$(DefineConstants);NET5_0;NET5_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net6.0'))">$(DefineConstants);NET6_0;NET6_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net7.0'))">$(DefineConstants);NET7_0;NET7_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net8.0'))">$(DefineConstants);NET8_0;NET8_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net9.0'))">$(DefineConstants);NET9_0;NET9_0_OR_GREATER</DefineConstants>
<DefineConstants Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(ImplTargetFramework)', 'net10.0'))">$(DefineConstants);NET10_0;NET10_0_OR_GREATER</DefineConstants>
</PropertyGroup>
</Project>
8 changes: 5 additions & 3 deletions src/EFCore.IntegrationTests/EFCore.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<TargetFramework>net10.0</TargetFramework>
<SupportedImplFrameworks>net10.0;net9.0;net8.0;net7.0;net6.0</SupportedImplFrameworks>

<IsTestProject Condition="$(SupportedImplFrameworks.Contains('$(ImplTargetFramework)'))">true</IsTestProject>
<NoWarn>NU1903</NoWarn>

<RootNamespace>ByteAether.Ulid.EntityFrameworkCore.IntegrationTests</RootNamespace>
Expand All @@ -17,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EFCore\EFCore.Impl.csproj" />
<ProjectReference Include="..\EFCore\EFCore.Impl.csproj" SetTargetFramework="TargetFramework=$(ImplTargetFramework)" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/EFCore/PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ For the core library and full details, visit our [GitHub repository](https://git
![.NET 10.0](https://img.shields.io/badge/.NET-10.0-brightgreen)
![.NET 9.0](https://img.shields.io/badge/.NET-9.0-brightgreen)
![.NET 8.0](https://img.shields.io/badge/.NET-8.0-brightgreen)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-green)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-green)
![.NET 7.0](https://img.shields.io/badge/.NET-7.0-brightgreen)
![.NET 6.0](https://img.shields.io/badge/.NET-6.0-brightgreen)

- **Version Support**: Fully compatible with **[Entity Framework Core](https://github.com/dotnet/efcore) versions 6.0.0 and newer**.
- **Automated Configuration**: Register mappings globally for both nullable and non-nullable `Ulid` types using a single extension method.
Expand Down
Loading