Skip to content

Commit b1c8503

Browse files
committed
initial setup
1 parent 28cb8b9 commit b1c8503

9 files changed

Lines changed: 143 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Event Bus Abstractions NuGet
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup .NET (use global.json)
17+
uses: actions/setup-dotnet@v4
18+
19+
- name: Restore dependencies
20+
run: dotnet restore **/CodeChavez.EventBus.Abstractions/CodeChavez.EventBus.Abstractions.csproj --configfile nuget.config --no-cache
21+
22+
- name: Build project
23+
run: dotnet build **/CodeChavez.EventBus.Abstractions/CodeChavez.EventBus.Abstractions.csproj --configuration Release
24+
25+
- name: Package Common
26+
run: dotnet pack **/CodeChavez.EventBus.Abstractions/CodeChavez.EventBus.Abstractions.csproj --configuration Release --no-build --output ./artifacts
27+
28+
- name: Push NuGet package
29+
run: dotnet nuget push "./artifacts/*.nupkg" --api-key $NUGET_AUTH_TOKEN --source https://api.nuget.org/v3/index.json
30+
env:
31+
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36301.6
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeChavez.EventBus.Abstractions", "src\CodeChavez.EventBus.Abstractions\CodeChavez.EventBus.Abstractions.csproj", "{54618F5E-5C1B-4FE4-A4D8-C1CB2B10BB5D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{54618F5E-5C1B-4FE4-A4D8-C1CB2B10BB5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{54618F5E-5C1B-4FE4-A4D8-C1CB2B10BB5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{54618F5E-5C1B-4FE4-A4D8-C1CB2B10BB5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{54618F5E-5C1B-4FE4-A4D8-C1CB2B10BB5D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {4EC7ECDF-0ACB-40A3-A27F-3599FBD516EA}
24+
EndGlobalSection
25+
EndGlobal

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.305",
4+
"rollForward": "latestFeature"
5+
}
6+
}

nuget.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
</configuration>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
8+
<PackageId>CodeChavez.EventBus.Abstractions</PackageId>
9+
<Title>CodeChavez EventBus Abstractions Library</Title>
10+
<Authors>Victor A Chavez</Authors>
11+
<Product>CodeChavez.EventBus.Abstractions</Product>
12+
<Version>9.0.0</Version>
13+
<Copyright>2020-2025</Copyright>
14+
<Description>It has all necessary interfaces to be implemented</Description>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
<PackageProjectUrl>https://github.com/codechavez/CodeChavez.EventBus.Abstractions</PackageProjectUrl>
17+
<RepositoryUrl>https://github.com/codechavez/CodeChavez.EventBus.Abstractions</RepositoryUrl>
18+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
19+
<PackageTags>codechavez,event,bus,events,helpers,utilities,.net</PackageTags>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
24+
<None Include="..\..\LICENSE" Pack="true" PackagePath="\"/>
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<PackageReference Include="CodeChavez.Common" Version="9.0.1" />
29+
</ItemGroup>
30+
31+
</Project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using MediatR;
2+
3+
namespace CodeChavez.EventBus.Abstractions.EventNotifications;
4+
5+
public abstract class DomainEvent : INotification
6+
{
7+
public Guid Id { get; set; } = Guid.NewGuid();
8+
public DateTime CreatedOn { get; private set; } = DateTime.UtcNow;
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using MediatR;
2+
3+
namespace CodeChavez.EventBus.Abstractions.EventNotifications;
4+
5+
public class DomainEventNotification<TDomainEvent> : INotification where TDomainEvent : DomainEvent
6+
{
7+
public TDomainEvent DomainEvent { get; }
8+
9+
public DomainEventNotification(TDomainEvent domainEvent)
10+
{
11+
DomainEvent = domainEvent;
12+
}
13+
}
14+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using MediatR;
2+
3+
namespace CodeChavez.EventBus.Abstractions.EventNotifications;
4+
5+
public abstract class IntegrationEvent : INotification
6+
{
7+
public Guid Id { get; set; } = Guid.NewGuid();
8+
public DateTime CreatedOn { get; private set; } = DateTime.UtcNow;
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using CodeChavez.EventBus.Abstractions.EventNotifications;
2+
3+
namespace CodeChavez.EventBus.Abstractions.Interfaces;
4+
5+
public interface IIntegrationEventHandler<in TIntegrationEvent> : IIntegrationEventHandler where TIntegrationEvent : IntegrationEvent
6+
{
7+
Task Handle(TIntegrationEvent @event);
8+
}
9+
10+
public interface IIntegrationEventHandler { }
11+

0 commit comments

Comments
 (0)