diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1a2872..b6e7398 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,20 +4,11 @@ on: push: jobs: - test-nix: - name: Test on *NIX - timeout-minutes: 30 - strategy: - matrix: - os: - - "ubuntu-24.04" - dotnet-version: - - "net8.0" - runs-on: ${{ matrix.os }} + build: + name: Build + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up .NET uses: actions/setup-dotnet@v4 @@ -28,9 +19,9 @@ jobs: - uses: actions/cache@v4 with: path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + key: nuget-${{ hashFiles('**/*.csproj') }} restore-keys: | - ${{ runner.os }}-nuget- + nuget- - name: Install dependencies run: | @@ -38,34 +29,6 @@ jobs: - name: Build run: | - dotnet build -f ${{ matrix.dotnet-version }} --no-restore - - test-windows: - name: Test on Windows - timeout-minutes: 30 - strategy: - matrix: - dotnet-version: - - "net8.0" - runs-on: "windows-2022" - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive + dotnet build --no-restore - - name: Set up .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 8.0.x - - - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: | - ${{ runner.os }}-nuget- - - - name: Install dependencies - run: | - dotnet restore + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 68a6b52..502284b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 0.2.0-beta + 0.2.0-charlie KJB Conseil https://github.com/kjbconseil/logtoapi-dotnet-sdk https://github.com/kjbconseil/logtoapi-dotnet-sdk diff --git a/src/Logto.WebApi.Sdk/Common/ApiClient.cs b/src/Logto.WebApi.Sdk/Common/ApiClient.cs index c0028b2..ee8f440 100644 --- a/src/Logto.WebApi.Sdk/Common/ApiClient.cs +++ b/src/Logto.WebApi.Sdk/Common/ApiClient.cs @@ -1,4 +1,5 @@ using System.Net.Http.Headers; +using System.Reflection; using System.Text; using System.Text.Json; using Logto.WebApi.Sdk.Authentication; @@ -65,6 +66,8 @@ protected async Task AuthenticateAsync() } request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _currentToken!.Value); + request.Headers.UserAgent.Add(new ProductInfoHeaderValue("logto-webapi-dotnet-sdk", Assembly.GetExecutingAssembly().GetName().Version?.ToString())); + request.Headers.UserAgent.Add(new ProductInfoHeaderValue("dotnet-version", Environment.Version.ToString())); var response = await HttpClient.SendAsync(request); response.EnsureSuccessStatusCode();