diff --git a/.github/workflows/pull_request_dev.yml b/.github/workflows/pull_request_dev.yml new file mode 100644 index 0000000..c1bdb03 --- /dev/null +++ b/.github/workflows/pull_request_dev.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/push_dev.yml b/.github/workflows/push_dev.yml new file mode 100644 index 0000000..2e22ba3 --- /dev/null +++ b/.github/workflows/push_dev.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/push_main.yml b/.github/workflows/push_main.yml index 88c4dec..77c25db 100644 --- a/.github/workflows/push_main.yml +++ b/.github/workflows/push_main.yml @@ -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: diff --git a/TimetableDesigner.Backend.Events/BuilderExtensions.cs b/TimetableDesigner.Backend.Events/BuilderExtensions.cs deleted file mode 100644 index c36d41d..0000000 --- a/TimetableDesigner.Backend.Events/BuilderExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; - -namespace TimetableDesigner.Backend.Events; - -public static class BuilderExtensions -{ - public static IServiceCollection AddEventQueue(this IServiceCollection services, Action configuration) where T : EventQueue, new() - { - T builder = new T(); - configuration(builder); - builder.Setup(services); - return services; - } - - public static void AddEventHandler(this WebApplication app, Func handler) where T : class - { - IEventQueueSubscriber subscriber = app.Services.GetService()!; - subscriber.Subscribe(handler); - } -} \ No newline at end of file diff --git a/TimetableDesigner.Backend.Events/TimetableDesigner.Backend.Events.csproj b/TimetableDesigner.Backend.Events/TimetableDesigner.Backend.Events.csproj index 08b58a6..e31a96a 100644 --- a/TimetableDesigner.Backend.Events/TimetableDesigner.Backend.Events.csproj +++ b/TimetableDesigner.Backend.Events/TimetableDesigner.Backend.Events.csproj @@ -4,6 +4,12 @@ net10.0 enable enable + TimetableDesigner.Backend.Events + Mateusz Skoczek + https://github.com/TimetableDesigner/ + icon.png + https://github.com/TimetableDesigner/TimetableDesigner.Backend.Events + @@ -12,9 +18,10 @@ - - C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\10.0.2\Microsoft.AspNetCore.dll - + + True + + diff --git a/TimetableDesigner.Backend.Events/icon.png b/TimetableDesigner.Backend.Events/icon.png new file mode 100644 index 0000000..98f0c54 Binary files /dev/null and b/TimetableDesigner.Backend.Events/icon.png differ