Skip to content

Commit

Permalink
feat: Release pipeline (#45)
Browse files Browse the repository at this point in the history
* feat: set release parameters / add readme

* feat: release pipeline
  • Loading branch information
mvarendorff2 authored Sep 27, 2024
1 parent 0a94dc1 commit 169bb9d
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 47 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}

11 changes: 11 additions & 0 deletions src/Fluss.HotChocolate/Fluss.HotChocolate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Fluss.HotChocolate</PackageId>
<Authors>ATMINA Solutions GmbH</Authors>
<Description>Adapter between Fluss and HotChocolate to turn one-off queries into live-queries.</Description>
<RepositoryUrl>https://github.com/atmina/fluss</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -17,5 +24,9 @@
<ItemGroup>
<ProjectReference Include="..\Fluss\Fluss.csproj"/>
</ItemGroup>

<ItemGroup>
<None Include="./README.md" Pack="True" PackagePath="/" />
</ItemGroup>

</Project>
14 changes: 14 additions & 0 deletions src/Fluss.HotChocolate/README.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions src/Fluss.PostgreSQL/Fluss.PostgreSQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Fluss.PostgreSQL</PackageId>
<Authors>ATMINA Solutions GmbH</Authors>
<Description>Package for Fluss to use a Postgres database as event storage.</Description>
<RepositoryUrl>https://github.com/atmina/fluss</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -18,4 +25,8 @@
<ProjectReference Include="..\Fluss\Fluss.csproj"/>
</ItemGroup>

<ItemGroup>
<None Include="./README.md" Pack="True" PackagePath="/" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions src/Fluss.PostgreSQL/README.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 9 additions & 1 deletion src/Fluss.Regen/Fluss.Regen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>

<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<IsRoslynComponent>true</IsRoslynComponent>

<RootNamespace>Fluss.Regen</RootNamespace>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Fluss.Regen</PackageId>
<Authors>ATMINA Solutions GmbH</Authors>
<Description>Support package for Fluss to generate repetitive bits of code.</Description>
<RepositoryUrl>https://github.com/atmina/fluss</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -24,5 +29,8 @@
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="./README.md" Pack="True" PackagePath="/" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions src/Fluss.Regen/README.md
Original file line number Diff line number Diff line change
@@ -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.
45 changes: 0 additions & 45 deletions src/Fluss.Regen/Readme.md

This file was deleted.

14 changes: 13 additions & 1 deletion src/Fluss.Testing/Fluss.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Fluss.Testing</PackageId>
<Authors>ATMINA Solutions GmbH</Authors>
<Description>Package for testing projects using Fluss.</Description>
<RepositoryUrl>https://github.com/atmina/fluss</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -13,7 +20,12 @@

<ItemGroup>
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.assert" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
</ItemGroup>

<ItemGroup>
<None Include="./README.md" Pack="True" PackagePath="/" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/Fluss.Testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Fluss.Testing

Package to provide utilities for unit-testing projects using Fluss.

## Usage

TBD
8 changes: 8 additions & 0 deletions src/Fluss/Fluss.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Fluss</PackageId>
<Authors>ATMINA Solutions GmbH</Authors>
<Description>Easily implement Event-Sourcing and CQS concepts with support packages for HotChocolate and storage adapters.</Description>
<RepositoryUrl>https://github.com/atmina/fluss</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Expand All @@ -22,4 +27,7 @@
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
</ItemGroup>

<ItemGroup>
<None Include="./README.md" Pack="True" PackagePath="/" />
</ItemGroup>
</Project>

0 comments on commit 169bb9d

Please sign in to comment.