From 3dabd332f833f4383e06ef7a6df734d63dbceb7f Mon Sep 17 00:00:00 2001 From: Mykhailo Matviiv Date: Mon, 26 Jan 2026 00:18:02 +0100 Subject: [PATCH] Mark core and text.json libraries as AOT-compatible --- .github/workflows/build-core.yml | 28 +++++++++++++++++-- README.md | 2 +- ...TypeId.Serialization.SystemTextJson.csproj | 6 ++++ .../TypeId.Core/TypeId.Core.csproj | 6 ++++ 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-core.yml b/.github/workflows/build-core.yml index 744a23e..5dbc26b 100644 --- a/.github/workflows/build-core.yml +++ b/.github/workflows/build-core.yml @@ -36,17 +36,41 @@ jobs: run: dotnet build --no-restore --configuration Release - name: Test run: dotnet test --no-restore --no-build --configuration Release + + native-aot: + runs-on: ubuntu-latest + strategy: + matrix: + dotnet-version: [8, 10] + defaults: + run: + working-directory: ./src/FastIDs.TypeId + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ matrix.dotnet-version }} + - name: Restore dependencies + run: dotnet restore + - name: Native AOT publish + env: + TARGET_FRAMEWORK: "net${{ matrix.dotnet-version }}.0" + run: | + set -euo pipefail + dotnet publish ./TypeId.Core/TypeId.Core.csproj -c Release -r linux-x64 -f $TARGET_FRAMEWORK /p:PublishAot=true -o ./native-artifacts + ls -la ./native-artifacts pack-and-push: runs-on: ubuntu-latest - needs: build + needs: [build, native-aot] if: startsWith(github.ref, 'refs/tags/') defaults: run: working-directory: ./src/FastIDs.TypeId steps: - uses: actions/checkout@v3 - - name: Setup .NET 10 (for packing) + - name: Setup .NET 10 uses: actions/setup-dotnet@v4 with: dotnet-version: 10 diff --git a/README.md b/README.md index efb2731..558477f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NuGet Version](https://img.shields.io/nuget/v/FastIDs.TypeId)](https://www.nuget.org/packages/FastIDs.TypeId) -High-performance C# implementation of [TypeId](https://github.com/jetpack-io/typeid/). +High-performance, Native AOT-compatible C# implementation of [TypeId](https://github.com/jetpack-io/typeid/). Here's an example of a TypeID of type user: ``` diff --git a/src/FastIDs.TypeId.Serialization/TypeId.Serialization.SystemTextJson/TypeId.Serialization.SystemTextJson.csproj b/src/FastIDs.TypeId.Serialization/TypeId.Serialization.SystemTextJson/TypeId.Serialization.SystemTextJson.csproj index eac44d9..1f93e84 100644 --- a/src/FastIDs.TypeId.Serialization/TypeId.Serialization.SystemTextJson/TypeId.Serialization.SystemTextJson.csproj +++ b/src/FastIDs.TypeId.Serialization/TypeId.Serialization.SystemTextJson/TypeId.Serialization.SystemTextJson.csproj @@ -19,6 +19,12 @@ Copyright (c) Mykhailo Matviiv 2023. + + true + true + true + + diff --git a/src/FastIDs.TypeId/TypeId.Core/TypeId.Core.csproj b/src/FastIDs.TypeId/TypeId.Core/TypeId.Core.csproj index 8835d48..77dcb06 100644 --- a/src/FastIDs.TypeId/TypeId.Core/TypeId.Core.csproj +++ b/src/FastIDs.TypeId/TypeId.Core/TypeId.Core.csproj @@ -28,6 +28,12 @@ All true + + + true + true + true +