Merge pull request #2 from TimetableDesigner/dev

Dev
This commit is contained in:
2026-01-15 21:14:37 +01:00
committed by GitHub
Unverified
6 changed files with 56 additions and 26 deletions

22
.github/workflows/pull_request_dev.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Build NuGet package on dev branch pull request
on:
pull_request:
branches:
- "dev"
paths:
- "TimetableDesigner.Backend.Events**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Build
run: dotnet build

22
.github/workflows/push_dev.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Build NuGet package on dev branch push
on:
push:
branches:
- "dev"
paths:
- "TimetableDesigner.Backend.Events**"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Build
run: dotnet build

View File

@@ -1,7 +1,7 @@
name: Build NuGet package on main branch pull request
name: Build NuGet package on main branch push
on:
pull_request:
push:
branches:
- "main"
paths:

View File

@@ -1,21 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace TimetableDesigner.Backend.Events;
public static class BuilderExtensions
{
public static IServiceCollection AddEventQueue<T>(this IServiceCollection services, Action<T> configuration) where T : EventQueue, new()
{
T builder = new T();
configuration(builder);
builder.Setup(services);
return services;
}
public static void AddEventHandler<T>(this WebApplication app, Func<T, Task> handler) where T : class
{
IEventQueueSubscriber subscriber = app.Services.GetService<IEventQueueSubscriber>()!;
subscriber.Subscribe(handler);
}
}

View File

@@ -4,6 +4,12 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>TimetableDesigner.Backend.Events</Title>
<Authors>Mateusz Skoczek</Authors>
<PackageProjectUrl>https://github.com/TimetableDesigner/</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>https://github.com/TimetableDesigner/TimetableDesigner.Backend.Events</RepositoryUrl>
<Version />
</PropertyGroup>
<ItemGroup>
@@ -12,9 +18,10 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore">
<HintPath>C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\10.0.2\Microsoft.AspNetCore.dll</HintPath>
</Reference>
<None Update="icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB