From 3a00820d01ad5b55e3ff2cf78558115a24eccc1b Mon Sep 17 00:00:00 2001 From: KevinB <67744786+KevinBTech@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:06:30 +0200 Subject: [PATCH 1/4] feat: add user-agent when sending HTTP request sdk current version + dotnet current version --- Directory.Build.props | 2 +- src/Logto.WebApi.Sdk/Common/ApiClient.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 68a6b52..34b6798 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 0.2.0-beta + 0.2.0-charlie.2 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(); From 1a5693ec759403b4530abe227bfd9205ee95d7d9 Mon Sep 17 00:00:00 2001 From: KevinB <67744786+KevinBTech@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:07:25 +0200 Subject: [PATCH 2/4] version: 0.2.0-charlie --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 34b6798..502284b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 0.2.0-charlie.2 + 0.2.0-charlie KJB Conseil https://github.com/kjbconseil/logtoapi-dotnet-sdk https://github.com/kjbconseil/logtoapi-dotnet-sdk From 96d26d8b342a80e7fc1a9084d51c005fc6a328d3 Mon Sep 17 00:00:00 2001 From: KevinB <67744786+KevinBTech@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:23:10 +0200 Subject: [PATCH 3/4] ci: simplify tests on windows and unix --- .github/workflows/build.yml | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1a2872..c460118 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,20 +4,19 @@ on: push: jobs: - test-nix: - name: Test on *NIX + build: + name: Build timeout-minutes: 30 strategy: matrix: os: - "ubuntu-24.04" + - "windows-2022" dotnet-version: - "net8.0" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - with: - submodules: recursive - name: Set up .NET uses: actions/setup-dotnet@v4 @@ -40,32 +39,4 @@ jobs: 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 - - - 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 From b72dd890b803d7b1397aa4c9bb0bb2570a8166dc Mon Sep 17 00:00:00 2001 From: KevinB <67744786+KevinBTech@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:25:37 +0200 Subject: [PATCH 4/4] ci: remove windows build --- .github/workflows/build.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c460118..b6e7398 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,15 +6,7 @@ on: jobs: build: name: Build - timeout-minutes: 30 - strategy: - matrix: - os: - - "ubuntu-24.04" - - "windows-2022" - dotnet-version: - - "net8.0" - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,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: | @@ -37,6 +29,6 @@ jobs: - name: Build run: | - dotnet build -f ${{ matrix.dotnet-version }} --no-restore + dotnet build --no-restore \ No newline at end of file