Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename artefact to artifact, Update packages, Remove Microsoft.AspNetCore.WebUtilities #174

Merged
merged 4 commits into from
Mar 8, 2024
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
14 changes: 7 additions & 7 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
run: sed -i "s|%%CS2VERSION%%|1.39.6.5/13965 9842|g" ./release.json;
- name: replace METAMODVERSION variable in meta files
run: sed -i "s|%%METAMODVERSION%%|2.0 - 1256|g" ./release.json;
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -220,23 +220,23 @@ jobs:
- name: move package
run: mv PugSharp_with_cssharp_and_runtime_linux_$PUGSHARPNETVER.zip ../
working-directory: ./packagebuild
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: latest_build_linux
path: |
./PugSharp_linux_*.zip
retention-days: 10
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: latest_build_linux_with_cssharp
path: |
./PugSharp_with_cssharp_linux_*.zip
retention-days: 10
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -318,23 +318,23 @@ jobs:
shell: bash
run: mv PugSharp_with_cssharp_and_runtime_windows_$PUGSHARPNETVER.zip ../
working-directory: ./packagebuild
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: latest_build_windows
path: |
./PugSharp_windows_*.zip
retention-days: 10
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: latest_build_windows_with_cssharp
path: |
./PugSharp_with_cssharp_windows_*.zip
retention-days: 10
- name: upload artefact
- name: upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.136">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.145">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
33 changes: 12 additions & 21 deletions PugSharp.Api.Contract/PugSharp.Api.Contract.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.16" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>
</Project>
23 changes: 6 additions & 17 deletions PugSharp.Api.G5Api.Tests/PugSharp.Api.G5Api.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Testcontainers" Version="3.7.0" />
<PackageReference Include="Testcontainers.MariaDb" Version="3.7.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PugSharp.Api.G5Api\PugSharp.Api.G5Api.csproj" />
<ProjectReference Include="..\PugSharp.Api.G5Api\PugSharp.Api.G5Api.csproj" />
</ItemGroup>


<ItemGroup>
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
17 changes: 4 additions & 13 deletions PugSharp.Api.G5Api/PugSharp.Api.G5Api.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.16" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PugSharp.Config\PugSharp.Config.csproj" />
<ProjectReference Include="..\PugSharp.Shared\PugSharp.Shared.csproj" />
<ProjectReference Include="..\PugSharp.Config\PugSharp.Config.csproj" />
<ProjectReference Include="..\PugSharp.Shared\PugSharp.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
39 changes: 15 additions & 24 deletions PugSharp.Api.Json/PugSharp.Api.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PugSharp.Api.Contract\PugSharp.Api.Contract.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.16" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PugSharp.Api.Contract\PugSharp.Api.Contract.csproj" />
</ItemGroup>
</Project>
23 changes: 17 additions & 6 deletions PugSharp.ApiStats/ApiStats.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Globalization;
using System.Web;

using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Logging;

using PugSharp.Api.Contract;
Expand Down Expand Up @@ -42,7 +42,7 @@ public async Task GoingLiveAsync(GoingLiveParams goingLiveParams, CancellationTo
{ApiStatsConstants.StatsMapName, goingLiveParams.MapName},
};

var uri = QueryHelpers.AddQueryString(string.Create(CultureInfo.InvariantCulture, $"golive/{goingLiveParams.MapNumber}"), queryParams);
var uri = AppendQuery(string.Create(CultureInfo.InvariantCulture, $"golive/{goingLiveParams.MapNumber}"), queryParams);

var response = await HttpClient.PostAsync(uri, content: null, cancellationToken).ConfigureAwait(false);

Expand All @@ -69,7 +69,7 @@ public async Task RoundStatsUpdateAsync(RoundStatusUpdateParams roundStatusUpdat
{"team2score", CreateIntParam(roundStatusUpdateParams.CurrentMap.Team2.Score)},
};

var uri = QueryHelpers.AddQueryString(string.Create(CultureInfo.InvariantCulture, $"updateround/{roundStatusUpdateParams.MapNumber}"), queryParams);
var uri = AppendQuery(string.Create(CultureInfo.InvariantCulture, $"updateround/{roundStatusUpdateParams.MapNumber}"), queryParams);

var response = await HttpClient.PostAsync(uri, content: null, cancellationToken).ConfigureAwait(false);

Expand Down Expand Up @@ -105,7 +105,7 @@ public async Task FinalizeMapAsync(MapResultParams finalizeMapParams, Cancellati
{ApiStatsConstants.StatsMapWinner, finalizeMapParams.WinnerTeamName},
};

var uri = QueryHelpers.AddQueryString(string.Create(CultureInfo.InvariantCulture, $"finalize/{finalizeMapParams.MapNumber}"), queryParams);
var uri = AppendQuery(string.Create(CultureInfo.InvariantCulture, $"finalize/{finalizeMapParams.MapNumber}"), queryParams);

var response = await HttpClient.PostAsync(uri, content: null, cancellationToken).ConfigureAwait(false);

Expand All @@ -130,7 +130,7 @@ public async Task FinalizeAsync(SeriesResultParams seriesResultParams, Cancellat
{ApiStatsConstants.StatsSeriesForfeit, CreateIntParam(Convert.ToInt32(seriesResultParams.Forfeit))},
};

var uri = QueryHelpers.AddQueryString($"finalize", queryParams);
var uri = AppendQuery(string.Create(CultureInfo.InvariantCulture, $"finalize"), queryParams);

var response = await HttpClient.PostAsync(uri, content: null, cancellationToken).ConfigureAwait(false);

Expand Down Expand Up @@ -179,7 +179,7 @@ private async Task UpdatePlayerStatsInternalAsync(int mapNumber, ITeamInfo teamI

Dictionary<string, string> queryParams = CreateUpdatePlayerQueryParameters(teamName, playerStatistics);

var uri = QueryHelpers.AddQueryString(string.Create(CultureInfo.InvariantCulture, $"updateplayer/{mapNumber}/{player.Key}"), queryParams);
var uri = AppendQuery(string.Create(CultureInfo.InvariantCulture, $"updateplayer/{mapNumber}/{player.Key}"), queryParams);

var response = await HttpClient.PostAsync(uri, content: null, cancellationToken).ConfigureAwait(false);

Expand Down Expand Up @@ -235,6 +235,17 @@ internal static string CreateIntParam(int param)
return param.ToString(CultureInfo.InvariantCulture);
}

internal static string AppendQuery(string baseUri, Dictionary<string, string> queryParams)
{
var query = HttpUtility.ParseQueryString(string.Empty);
foreach (var dict in queryParams)
{
query[dict.Key] = dict.Value;
}

return string.Join('?', baseUri.TrimEnd('/').TrimEnd('?'), query.ToString());
}

private static class ApiStatsConstants
{
#pragma warning disable S125 // Sections of code should not be commented out
Expand Down
9 changes: 5 additions & 4 deletions PugSharp.ApiStats/BaseApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
using System.Net;

using Microsoft.Extensions.Logging;

namespace PugSharp.ApiStats;

Expand Down Expand Up @@ -33,11 +34,11 @@ protected void InitializeBase(string? baseUrl, string? authKey)

HttpClient.BaseAddress = new Uri(baseUrl);

HttpClient.DefaultRequestHeaders.Remove(HeaderNames.Authorization);
HttpClient.DefaultRequestHeaders.Remove(nameof(HttpRequestHeader.Authorization));

if (!string.IsNullOrEmpty(authKey))
{
HttpClient.DefaultRequestHeaders.Add(HeaderNames.Authorization, authKey);
HttpClient.DefaultRequestHeaders.Add(nameof(HttpRequestHeader.Authorization), authKey);
}
}
catch (Exception ex)
Expand Down
15 changes: 4 additions & 11 deletions PugSharp.ApiStats/PugSharp.ApiStats.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\PugSharp.Config\PugSharp.Config.csproj" />
<ProjectReference Include="..\PugSharp.Match.Contract\PugSharp.Match.Contract.csproj" />
<ProjectReference Include="..\PugSharp.Config\PugSharp.Config.csproj" />
<ProjectReference Include="..\PugSharp.Match.Contract\PugSharp.Match.Contract.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.16" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
</Project>
6 changes: 3 additions & 3 deletions PugSharp.Config/ConfigProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json;
using System.Net;
using System.Text.Json;

using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;

using OneOf;
using OneOf.Types;
Expand Down Expand Up @@ -72,7 +72,7 @@ public async Task<OneOf<Error<string>, MatchConfig>> LoadMatchConfigFromUrlAsync

if (!string.IsNullOrEmpty(authToken))
{
httpRequestMessage.Headers.Add(HeaderNames.Authorization, authToken);
httpRequestMessage.Headers.Add(nameof(HttpRequestHeader.Authorization), authToken);
}

var response = await _HttpClient.SendAsync(httpRequestMessage).ConfigureAwait(false);
Expand Down
12 changes: 1 addition & 11 deletions PugSharp.Config/PugSharp.Config.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -8,18 +7,9 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.16" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="OneOf" Version="3.0.263" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Update="Meziantou.Analyzer" Version="2.0.127">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Loading
Loading