Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/cache-4
Browse files Browse the repository at this point in the history
  • Loading branch information
snovak7 authored Jun 22, 2024
2 parents e0a4f2c + dc974f7 commit ba836ea
Show file tree
Hide file tree
Showing 18 changed files with 356 additions and 50 deletions.
63 changes: 63 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
change-template: "- $TITLE by @$AUTHOR (#$NUMBER)"
no-changes-template: "- No changes"

prerelease: true
prerelease-identifier: rc
include-pre-releases: true

categories:
- title: "📚 Documentation"
labels:
- "documentation"
- title: "🚀 New Features"
labels:
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "bug"
- title: "🧰 Maintenance"
labels:
- "maintenance"
- title: "🚨 Security Updates"
labels:
- "security"
- title: "🔄 Dependency Updates"
collapse-after: 3
labels:
- "dependencies"

version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
template: |
$CHANGES
## 👨🏼‍💻 Contributors
$CONTRIBUTORS
autolabeler:
- label: "github_actions"
files:
- ".github/**/*"
- label: "documentation"
files:
- "docs/**/*"
- label: "maintenance"
files:
- ".github/**/*"
- ".devcontainer/**/*"
- "test/**/*"

exclude-contributors:
- dependabot
- dependabot[bot]
43 changes: 37 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,79 @@
name: build

on:
push:
pull_request:
types: [opened, synchronize, reopened]
types:
- opened
- synchronize
- reopened
push:
branches:
- main
workflow_dispatch:

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Start RabbitMQ
uses: namoshek/rabbitmq-github-action@v1
with:
version: '3.12'
ports: '5672:5672 5552:5552'
plugins: rabbitmq_stream

- name: Setup .NET Core SDK 7, 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
- name: Restore .NET Packages
run: dotnet restore

- name: Build .NET Solution
run: dotnet build --configuration Release --no-restore

- name: Test .NET Solution
run: dotnet test --configuration Release --no-build --filter="Category=UnitTest|Category=IntegrationTest" --logger "trx;LogFilePrefix=test-results"

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
path: "**/test-results*.trx"

- name: Pack .NET Solution
run: dotnet pack --configuration Release --no-build --output pack/
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

- name: Publish .NET Solution to GitHub Packages
continue-on-error: true
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

- name: Store .NET Package
uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: pack/*.nupkg
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

- name: Publish .NET Solution to NuGet.org
continue-on-error: true
env:
apikey: ${{ secrets.NUGET_ORG_KEY }}
if: ${{ env.apikey != '' && github.event_name != 'pull_request' && github.ref_name == 'main' }}
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
continue-on-error: true
if: ${{ env.apikey != '' && github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}

39 changes: 39 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
workflow_dispatch:
inputs:
release-type:
type: choice
default: prerelease
description: Release Type
options:
- release
- prerelease

concurrency:
group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref_type != 'tag' }}

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: "Draft Release"
uses: release-drafter/release-drafter@v6.0.0
with:
prerelease: ${{ github.event.inputs.release-type != 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
if: github.repository_owner == 'escendit'
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
uses: gittools/actions/gitversion/setup@v1
with:
versionSpec: '5.x'
- name: Set up JDK 17
Expand All @@ -33,7 +33,7 @@ jobs:
with:
fetch-depth: 0
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
uses: gittools/actions/gitversion/execute@v1
with:
useConfigFile: true
- name: Cache SonarCloud packages
Expand Down
76 changes: 38 additions & 38 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.Abstractions" Version="0.2.0" />
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.AmqpProtocol" Version="0.2.0" />
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.StreamProtocol" Version="0.2.0" />
<PackageVersion Include="Escendit.Tools.Branding" Version="1.0.2" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NetAnalyzers" Version="0.5.0" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NSubstituteAnalyzers" Version="0.1.0-rc.18" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SecurityCodeScanAnalyzers" Version="0.5.0" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers" Version="0.5.0" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.StyleCopAnalyzers" Version="0.5.0" />
<PackageVersion Include="Escendit.Tools.CodeAnalysis.xUnitAnalyzers" Version="0.1.0-rc.21" />
<PackageVersion Include="Escendit.Tools.SourceLink.GitHub" Version="0.4.0" />
<PackageVersion Include="GitVersion.MsBuild" Version="5.12.0" />
<PackageVersion Include="JunitXml.TestLogger" Version="3.0.134" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="xunit" Version="2.6.3" />
<PackageVersion Include="xunit.categories" Version="2.0.8" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.Orleans.EventSourcing" Version="7.2.4" />
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="7.2.4" />
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="7.2.4" />
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="7.2.4" />
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="7.2.4" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Orleans.EventSourcing" Version="8.0.0-rc1" />
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="8.0.0-rc1" />
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="8.0.0-rc1" />
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="8.0.0-rc1" />
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="8.0.0-rc1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
</Project>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.0"/>
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.Abstractions" Version="0.2.0"/>
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.AmqpProtocol" Version="0.2.0"/>
<PackageVersion Include="Escendit.Extensions.DependencyInjection.RabbitMQ.StreamProtocol" Version="0.2.0"/>
<PackageVersion Include="Escendit.Tools.Branding" Version="1.0.2"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NetAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NSubstituteAnalyzers" Version="0.1.0-rc.18"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SecurityCodeScanAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.StyleCopAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.xUnitAnalyzers" Version="0.1.0-rc.21"/>
<PackageVersion Include="Escendit.Tools.SourceLink.GitHub" Version="0.4.0"/>
<PackageVersion Include="GitVersion.MsBuild" Version="5.12.0"/>
<PackageVersion Include="JunitXml.TestLogger" Version="3.0.134"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageVersion Include="NSubstitute" Version="5.1.0"/>
<PackageVersion Include="xunit" Version="2.6.3"/>
<PackageVersion Include="xunit.categories" Version="2.0.8"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.Orleans.EventSourcing" Version="7.2.6"/>
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="7.2.6"/>
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="7.2.6"/>
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="7.2.6"/>
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="7.2.6"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Orleans.EventSourcing" Version="8.1.0"/>
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="8.1.0"/>
<PackageVersion Include="Microsoft.Orleans.Sdk" Version="8.1.0"/>
<PackageVersion Include="Microsoft.Orleans.Streaming" Version="8.1.0"/>
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="8.1.0"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions src/Orleans/AmqpProtocol/Builder/RabbitMqClientOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Escendit.Orleans.Streaming.RabbitMQ.AmqpProtocol.Builder;

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using RabbitMQ.Builder;

Expand All @@ -11,28 +12,54 @@ namespace Escendit.Orleans.Streaming.RabbitMQ.AmqpProtocol.Builder;
/// </summary>
internal class RabbitMqClientOptionsBuilder : IRabbitMqClientOptionsBuilder
{
#if NET8_0_OR_GREATER
/// <summary>
/// Initializes a new instance of the <see cref="RabbitMqClientOptionsBuilder"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="services">The services.</param>
/// <param name="configuration">The configuration.</param>
/// <param name="configurator">The configurator.</param>
public RabbitMqClientOptionsBuilder(
string name,
IServiceCollection services,
IConfiguration configuration,
ClusterClientPersistentStreamConfigurator configurator)
{
Name = name;
Services = services;
Configuration = configuration;
Configurator = configurator;
}
#else
/// <summary>
/// Initializes a new instance of the <see cref="RabbitMqClientOptionsBuilder"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="services">The services.</param>
/// <param name="configurator">The configurator.</param>
public RabbitMqClientOptionsBuilder(
string name,
IServiceCollection services,
ClusterClientPersistentStreamConfigurator configurator)
{
Name = name;
Services = services;
Configurator = configurator;
}
#endif

/// <inheritdoc/>
public string Name { get; }

/// <inheritdoc/>
public IServiceCollection Services { get; }

#if NET8_0_OR_GREATER
/// <inheritdoc/>
public IConfiguration Configuration { get; }
#endif

/// <inheritdoc/>
public ClusterClientPersistentStreamConfigurator Configurator { get; }

Expand Down
Loading

0 comments on commit ba836ea

Please sign in to comment.