diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 50e2d31..14f0643 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -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" diff --git a/.github/workflows/build-and-test-aot.yml b/.github/workflows/build-and-test-aot.yml index eb0e45c..9b2e8a6 100644 --- a/.github/workflows/build-and-test-aot.yml +++ b/.github/workflows/build-and-test-aot.yml @@ -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 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ea780bc..8b10e80 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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 diff --git a/README.md b/README.md index 507891d..04c07d1 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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: @@ -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: @@ -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: diff --git a/src/ByteAether.Ulid.slnx b/src/ByteAether.Ulid.slnx index 60758b9..5491095 100644 --- a/src/ByteAether.Ulid.slnx +++ b/src/ByteAether.Ulid.slnx @@ -8,8 +8,12 @@ - - + + + + + + @@ -18,24 +22,33 @@ - + + + - + + + - + + + - + + + + diff --git a/src/DB.Shared.Tests/DB.Shared.Tests.csproj b/src/DB.Shared.Tests/DB.Shared.Tests.csproj index 04bc9b4..030a53a 100644 --- a/src/DB.Shared.Tests/DB.Shared.Tests.csproj +++ b/src/DB.Shared.Tests/DB.Shared.Tests.csproj @@ -2,7 +2,9 @@ net10.0 - true + net10.0;net8.0;net6.0;netstandard2.0 + + true true @@ -11,8 +13,7 @@ - - + diff --git a/src/DB.Shared/DB.Shared.csproj b/src/DB.Shared/DB.Shared.csproj index c70a182..91ba7c7 100644 --- a/src/DB.Shared/DB.Shared.csproj +++ b/src/DB.Shared/DB.Shared.csproj @@ -1,9 +1,9 @@  - net8.0;net6.0;netstandard2.0 + net10.0;net8.0;net6.0;netstandard2.0 library - true + true true ByteAether.Ulid.DB.Shared diff --git a/src/Dapper.IntegrationTests/Dapper.IntegrationTests.csproj b/src/Dapper.IntegrationTests/Dapper.IntegrationTests.csproj index 2654b2a..90dbf5f 100644 --- a/src/Dapper.IntegrationTests/Dapper.IntegrationTests.csproj +++ b/src/Dapper.IntegrationTests/Dapper.IntegrationTests.csproj @@ -1,8 +1,10 @@  - net10.0;net8.0;net7.0 - true + net10.0 + net10.0;net8.0;netstandard2.0 + + true NU1903 ByteAether.Ulid.Dapper.IntegrationTests @@ -13,7 +15,7 @@ - + diff --git a/src/Dapper/PACKAGE.md b/src/Dapper/PACKAGE.md index b68027c..6683f49 100644 --- a/src/Dapper/PACKAGE.md +++ b/src/Dapper/PACKAGE.md @@ -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. diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c618f25..00e8893 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -25,6 +25,8 @@ MIT + + net10.0 true @@ -48,14 +50,8 @@ - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 0000000..831c72e --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,22 @@ + + + + true + + + $(DefineConstants);NETCOREAPP + + + $(DefineConstants);NETSTANDARD + $(DefineConstants);NETSTANDARD2_0;NETSTANDARD2_0_OR_GREATER + $(DefineConstants);NETSTANDARD2_0_OR_GREATER;NETSTANDARD2_1;NETSTANDARD2_1_OR_GREATER + + + $(DefineConstants);NET5_0;NET5_0_OR_GREATER + $(DefineConstants);NET6_0;NET6_0_OR_GREATER + $(DefineConstants);NET7_0;NET7_0_OR_GREATER + $(DefineConstants);NET8_0;NET8_0_OR_GREATER + $(DefineConstants);NET9_0;NET9_0_OR_GREATER + $(DefineConstants);NET10_0;NET10_0_OR_GREATER + + diff --git a/src/EFCore.IntegrationTests/EFCore.IntegrationTests.csproj b/src/EFCore.IntegrationTests/EFCore.IntegrationTests.csproj index 2868a56..7e87269 100644 --- a/src/EFCore.IntegrationTests/EFCore.IntegrationTests.csproj +++ b/src/EFCore.IntegrationTests/EFCore.IntegrationTests.csproj @@ -1,8 +1,10 @@ - net10.0;net9.0;net8.0;net7.0;net6.0 - true + net10.0 + net10.0;net9.0;net8.0;net7.0;net6.0 + + true NU1903 ByteAether.Ulid.EntityFrameworkCore.IntegrationTests @@ -17,7 +19,7 @@ - + diff --git a/src/EFCore/PACKAGE.md b/src/EFCore/PACKAGE.md index 1d6655a..d827395 100644 --- a/src/EFCore/PACKAGE.md +++ b/src/EFCore/PACKAGE.md @@ -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. diff --git a/src/LinqToDB.IntegrationTests/LinqToDB.IntegrationTests.csproj b/src/LinqToDB.IntegrationTests/LinqToDB.IntegrationTests.csproj index 9fbbd9f..0666659 100644 --- a/src/LinqToDB.IntegrationTests/LinqToDB.IntegrationTests.csproj +++ b/src/LinqToDB.IntegrationTests/LinqToDB.IntegrationTests.csproj @@ -1,8 +1,10 @@  - net10.0;net8.0;net7.0 - true + net10.0 + net10.0;net8.0;netstandard2.0 + + true NU1903 ByteAether.Ulid.LinqToDB.IntegrationTests @@ -14,7 +16,7 @@ - + diff --git a/src/LinqToDB/PACKAGE.md b/src/LinqToDB/PACKAGE.md index bb612b8..a8eeab2 100644 --- a/src/LinqToDB/PACKAGE.md +++ b/src/LinqToDB/PACKAGE.md @@ -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 **[LinqToDB](https://github.com/linq2db/linq2db) versions 6.0.0 and newer**. - **Automated Configuration**: Register mappings globally for both nullable and non-nullable `Ulid` types using a single extension method on your `DataOptions`. diff --git a/src/Ulid.Tests/Tests.csproj b/src/Ulid.Tests/Tests.csproj index 6e9d5c0..a9feaca 100644 --- a/src/Ulid.Tests/Tests.csproj +++ b/src/Ulid.Tests/Tests.csproj @@ -1,7 +1,10 @@  - true + net10.0 + net10.0;net9.0;net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0 + + true true @@ -9,20 +12,11 @@ ByteAether.Ulid.Tests - - net10.0;net9.0;net8.0;net7.0;net6.0 - - - - net10.0;net9.0;net8.0;net7.0;net6.0;net472 - - - + - diff --git a/src/Ulid.Tests/UlidJsonConverterTests.cs b/src/Ulid.Tests/UlidJsonConverterTests.cs index f5d5f56..49be272 100644 --- a/src/Ulid.Tests/UlidJsonConverterTests.cs +++ b/src/Ulid.Tests/UlidJsonConverterTests.cs @@ -97,6 +97,7 @@ public void Deserialize_GoodJsonToDto(bool useCustomOptions) Assert.Equal(ulid, resultDto.UlidProperty); } +#if NET6_0_OR_GREATER [Theory] [InlineData(true)] [InlineData(false)] @@ -135,5 +136,6 @@ public void Deserialize_UlidAsPropertyName(bool useCustomOptions) Assert.True(deserializedDictionary.ContainsKey(ulid)); Assert.Equal("value", deserializedDictionary[ulid]); } -} #endif +} +#endif \ No newline at end of file diff --git a/src/Ulid/PACKAGE.md b/src/Ulid/PACKAGE.md index 9c788f7..d98a3e3 100644 --- a/src/Ulid/PACKAGE.md +++ b/src/Ulid/PACKAGE.md @@ -15,11 +15,11 @@ For more detailed documentation, visit our [GitHub repository](https://github.co ![.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.