Skip to content

Commit

Permalink
Merge pull request #11 from NerosoftDev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Codespilot authored Dec 27, 2023
2 parents 8decc73 + 2e84910 commit 7058aa1
Show file tree
Hide file tree
Showing 25 changed files with 3,826 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/push-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pack

on:
push:
tags:
- '*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore Starfish.Build.slnf
- name: Build
run: dotnet build Starfish.Build.slnf --no-restore --configuration Release
- name: Pack
run: dotnet pack Starfish.Build.slnf -c Release -o artifacts/
- name: Publish NuGet
run: dotnet nuget push artifacts/*.nupkg --api-key ${{secrets.NUGET_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
15 changes: 11 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<PackageVersion Include="Euonia.Pipeline" Version="$(EuoniaPackageVersion)" />
<PackageVersion Include="Euonia.Validation" Version="$(EuoniaPackageVersion)" />
<PackageVersion Include="Euonia.Repository.EfCore" Version="$(EuoniaPackageVersion)" />
<PackageVersion Include="Google.Api.CommonProtos" Version="2.13.0" />
<PackageVersion Include="Google.Protobuf" Version="3.25.1" />
<PackageVersion Include="Grpc.Net.Client" Version="2.59.0" />
<PackageVersion Include="Grpc.Tools" Version="2.60.0" />
<PackageVersion Include="IdentityModel" Version="6.2.0" />
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.11" />
<PackageVersion Include="StackExchange.Redis" Version="2.7.10" />
Expand All @@ -40,6 +44,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFrameworkVersion.Equals('v6.0')) ">
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="[6.0.0]" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="[6.0.0]" />
Expand Down Expand Up @@ -90,19 +99,17 @@
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageVersion Include="MongoDB.EntityFrameworkCore" Version="7.0.0-preview.1" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

<!-- Tests -->
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="xunit" Version="2.6.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageVersion Include="xunit" Version="2.6.4" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
Expand Down
2 changes: 2 additions & 0 deletions Source/Starfish.Client/ConfigurationBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Nerosoft.Starfish.Client;

// ReSharper disable MemberCanBePrivate.Global

namespace Microsoft.Extensions.Configuration;

public static class ConfigurationBuilderExtensions
Expand Down
4 changes: 3 additions & 1 deletion Source/Starfish.Client/Starfish.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

<PropertyGroup>
<IsPackable>true</IsPackable>
<Description>A lightweight powerful distributed configuration server for .NET application.</Description>
<Title>Sratfish configuration client</Title>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Sratfish configuration client.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
34 changes: 34 additions & 0 deletions Source/Starfish.Common/AsyncHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Globalization;

namespace Nerosoft.Starfish.Common;
/// <summary>
/// Provides some helper methods to work with async methods.
/// </summary>
public static class AsyncHelper
{
private static readonly TaskFactory _factory = new(CancellationToken.None, TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.Default);

public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
var cultureUi = CultureInfo.CurrentUICulture;
var culture = CultureInfo.CurrentCulture;
return _factory.StartNew(() =>
{
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = cultureUi;
return func();
}).Unwrap().GetAwaiter().GetResult();
}

public static void RunSync(Func<Task> func)
{
var cultureUi = CultureInfo.CurrentUICulture;
var culture = CultureInfo.CurrentCulture;
_factory.StartNew(() =>
{
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = cultureUi;
return func();
}).Unwrap().GetAwaiter().GetResult();
}
}
Loading

0 comments on commit 7058aa1

Please sign in to comment.