From 169bb9d9618cfd76fe9ee68174bb90c4974ce6a9 Mon Sep 17 00:00:00 2001 From: "Michel v. Varendorff" <80046268+mvarendorff2@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:04:10 +0200 Subject: [PATCH] feat: Release pipeline (#45) * feat: set release parameters / add readme * feat: release pipeline --- .github/workflows/publish.yml | 32 +++++++++++++ .../Fluss.HotChocolate.csproj | 11 +++++ src/Fluss.HotChocolate/README.md | 14 ++++++ src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj | 11 +++++ src/Fluss.PostgreSQL/README.md | 9 ++++ src/Fluss.Regen/Fluss.Regen.csproj | 10 ++++- src/Fluss.Regen/README.md | 21 +++++++++ src/Fluss.Regen/Readme.md | 45 ------------------- src/Fluss.Testing/Fluss.Testing.csproj | 14 +++++- src/Fluss.Testing/README.md | 7 +++ src/Fluss/Fluss.csproj | 8 ++++ 11 files changed, 135 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 src/Fluss.HotChocolate/README.md create mode 100644 src/Fluss.PostgreSQL/README.md create mode 100644 src/Fluss.Regen/README.md delete mode 100644 src/Fluss.Regen/Readme.md create mode 100644 src/Fluss.Testing/README.md diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6d1577f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish on NuGet + +on: + release: + types: [created] + +env: + VERSION: ${{ github.event.release.tag_name }} + +jobs: + publish-nuget: + runs-on: ubuntu-latest + strategy: + matrix: + package: [ Fluss, Fluss.HotChocolate, Fluss.PostgreSQL, Fluss.Regen, Fluss.Testing ] + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.x + 9.x + - name: Strip v from tag to determine version + run: echo "VERSION=${VERSION/v/}" >> $GITHUB_ENV + - name: Package + run: dotnet pack --configuration Release /p:Version=${VERSION} + working-directory: src/${{ matrix.package }} + - name: Publish + run: dotnet nuget push bin/Release/${{ matrix.package }}.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + working-directory: src/${{ matrix.package }} + diff --git a/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj b/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj index ed43774..bd24d8e 100644 --- a/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj +++ b/src/Fluss.HotChocolate/Fluss.HotChocolate.csproj @@ -4,6 +4,13 @@ net8.0;net9.0 enable enable + README.md + Fluss.HotChocolate + ATMINA Solutions GmbH + Adapter between Fluss and HotChocolate to turn one-off queries into live-queries. + https://github.com/atmina/fluss + git + MIT true @@ -17,5 +24,9 @@ + + + + diff --git a/src/Fluss.HotChocolate/README.md b/src/Fluss.HotChocolate/README.md new file mode 100644 index 0000000..e509381 --- /dev/null +++ b/src/Fluss.HotChocolate/README.md @@ -0,0 +1,14 @@ +# Fluss.HotChocolate + +This package contains an adapter to connect Fluss to [HotChocolate](https://chillicream.com/docs/hotchocolate/v13) to +turn all GraphQL queries into live-queries backed by event-sourcing to get fresh data in your client the moment it changes. + +## Usage + +Assuming you have already configured both Fluss for your general event-sourcing needs and HotChocolate for everything +GraphQL, setting up the adapter is as easy as calling `requestExecutorBuilder.AddLiveEventSourcing()`. + +> [!NOTE] +> You also need to configure your client to run `query` operations through a websocket to benefit from the +> subscription-like behaviour. This is different between different clients, so consult the respective documentation for +> that. diff --git a/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj b/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj index 4bfb836..eee5d38 100644 --- a/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj +++ b/src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj @@ -4,6 +4,13 @@ net8.0;net9.0 enable enable + README.md + Fluss.PostgreSQL + ATMINA Solutions GmbH + Package for Fluss to use a Postgres database as event storage. + https://github.com/atmina/fluss + git + MIT true @@ -18,4 +25,8 @@ + + + + diff --git a/src/Fluss.PostgreSQL/README.md b/src/Fluss.PostgreSQL/README.md new file mode 100644 index 0000000..cd3bc1a --- /dev/null +++ b/src/Fluss.PostgreSQL/README.md @@ -0,0 +1,9 @@ +# Fluss.PostgreSQL + +Use a PostgreSQL database as event storage for Fluss. + +## Usage + +To configure, call `.AddPostgresEventSourcingRepository(connectionString)` on your `IServiceCollection`. Doing so will +run the required migrations on startup, register the database as event storage and register a database-trigger for new +events. diff --git a/src/Fluss.Regen/Fluss.Regen.csproj b/src/Fluss.Regen/Fluss.Regen.csproj index d12bdd4..24fa3d5 100644 --- a/src/Fluss.Regen/Fluss.Regen.csproj +++ b/src/Fluss.Regen/Fluss.Regen.csproj @@ -2,7 +2,6 @@ netstandard2.1 - false enable latest @@ -10,7 +9,13 @@ true Fluss.Regen + README.md Fluss.Regen + ATMINA Solutions GmbH + Support package for Fluss to generate repetitive bits of code. + https://github.com/atmina/fluss + git + MIT true @@ -24,5 +29,8 @@ + + + diff --git a/src/Fluss.Regen/README.md b/src/Fluss.Regen/README.md new file mode 100644 index 0000000..bac3c30 --- /dev/null +++ b/src/Fluss.Regen/README.md @@ -0,0 +1,21 @@ +# Fluss.Regen + +Regen is the "Repetitive Event-sourcing code-GENerator", and removes the need for assembly scanning to register +resources like + +- Upcasters +- Validators +- SideEffects +- Policies + +It also adds support for cached selector-functions, marked by the `[Selector]` attribute. + +## Usage + +To register all components listed above detected by Regen, call the generated `.Add*ESComponents()` function on your +`IServiceCollection`. The name depends on the name of your assembly. + +### Selector + +Marking a `static` function with `[Selector]` creates an extension method on `IUnitOfWork` which adds an easy way of +caching in the context of an `IUnitOfWork`, returning known, previously computed data if available. diff --git a/src/Fluss.Regen/Readme.md b/src/Fluss.Regen/Readme.md deleted file mode 100644 index b4f36c0..0000000 --- a/src/Fluss.Regen/Readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# Roslyn Source Generators Sample - -A set of three projects that illustrates Roslyn source generators. Enjoy this template to learn from and modify source -generators for your own needs. - -## Content - -### Fluss.Regen - -A .NET Standard project with implementations of sample source generators. -**You must build this project to see the result (generated code) in the IDE.** - -- [SampleSourceGenerator.cs](SampleSourceGenerator.cs): A source generator that creates C# classes based on a text - file (in this case, Domain Driven Design ubiquitous language registry). -- [SampleIncrementalSourceGenerator.cs](SampleIncrementalSourceGenerator.cs): A source generator that creates a custom - report based on class properties. The target class should be annotated with the `Generators.ReportAttribute` - attribute. - -### Fluss.Regen.Sample - -A project that references source generators. Note the parameters of `ProjectReference` -in [Fluss.Regen.Sample.csproj](../Fluss.Regen.Sample/Fluss.Regen.Sample.csproj), they make sure that the project is -referenced as a set of source generators. - -### Fluss.Regen.Tests - -Unit tests for source generators. The easiest way to develop language-related features is to start with unit tests. - -## How To? - -### How to debug? - -- Use the [launchSettings.json](Properties/launchSettings.json) profile. -- Debug tests. - -### How can I determine which syntax nodes I should expect? - -Consider installing the Roslyn syntax tree viewer plugin [Rossynt](https://plugins.jetbrains.com/plugin/16902-rossynt/). - -### How to learn more about wiring source generators? - -Watch the walkthrough -video: [Let’s Build an Incremental Source Generator With Roslyn, by Stefan Pölz](https://youtu.be/azJm_Y2nbAI) -The complete set of information is available -in [Source Generators Cookbook](https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md). \ No newline at end of file diff --git a/src/Fluss.Testing/Fluss.Testing.csproj b/src/Fluss.Testing/Fluss.Testing.csproj index add6c01..ffdbe90 100644 --- a/src/Fluss.Testing/Fluss.Testing.csproj +++ b/src/Fluss.Testing/Fluss.Testing.csproj @@ -4,6 +4,13 @@ net8.0;net9.0 enable enable + README.md + Fluss.Testing + ATMINA Solutions GmbH + Package for testing projects using Fluss. + https://github.com/atmina/fluss + git + MIT true @@ -13,7 +20,12 @@ - + + + + + + diff --git a/src/Fluss.Testing/README.md b/src/Fluss.Testing/README.md new file mode 100644 index 0000000..d5655a6 --- /dev/null +++ b/src/Fluss.Testing/README.md @@ -0,0 +1,7 @@ +# Fluss.Testing + +Package to provide utilities for unit-testing projects using Fluss. + +## Usage + +TBD diff --git a/src/Fluss/Fluss.csproj b/src/Fluss/Fluss.csproj index b651dd4..0c42f56 100644 --- a/src/Fluss/Fluss.csproj +++ b/src/Fluss/Fluss.csproj @@ -4,8 +4,13 @@ net8.0;net9.0 enable enable + README.md Fluss ATMINA Solutions GmbH + Easily implement Event-Sourcing and CQS concepts with support packages for HotChocolate and storage adapters. + https://github.com/atmina/fluss + git + MIT true @@ -22,4 +27,7 @@ + + +