Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 33 additions & 39 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build and Test

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "main", "dev" ]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

permissions:
pull-requests: write
contents: write
contents: read

strategy:
matrix:
Expand All @@ -25,35 +20,34 @@ jobs:
build-mode: autobuild

steps:

- uses: actions/checkout@v4
- name: Setup .NET 9.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '0'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "0"
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
41 changes: 41 additions & 0 deletions .github/workflows/release-abstractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Abstractions NuGet Package

on:
workflow_dispatch:

jobs:
publish:
permissions:
contents: read
id-token: write

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --configuration Release --no-build --logger trx

- name: Pack
run: dotnet pack ./src/MitMediator.InMemoryCache.Abstractions/MitMediator.InMemoryCache.Abstractions.csproj --configuration Release --no-build --output ./nupkg

- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
name: Publish NuGet Package
name: Publish InMemoryCache NuGet Package

on:
push:
tags:
- '*.*.*'
workflow_dispatch:

jobs:
publish:
permissions:
contents: read
id-token: write

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: "10.0.x"

- name: Restore dependencies
run: dotnet restore
Expand All @@ -30,14 +38,4 @@ jobs:
run: dotnet pack ./src/MitMediator.InMemoryCache/MitMediator.InMemoryCache.csproj --configuration Release --no-build --output ./nupkg

- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: v${{ github.ref_name }}
files: ./nupkg/*.nupkg
prerelease: ${{ steps.prerelease_check.outputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
18 changes: 18 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="10.1.0" />
<PackageVersion Include="FluentValidation" Version="12.2.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.2.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.13" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageVersion Include="MitMediator" Version="10.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.3.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.1" />
</ItemGroup>
</Project>
70 changes: 0 additions & 70 deletions MitMediator.InMemoryCache.sln

This file was deleted.

23 changes: 23 additions & 0 deletions MitMediator.InMemoryCache.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Solution>
<Configurations>
<Platform Name="Any CPU" />
<Platform Name="x64" />
<Platform Name="x86" />
</Configurations>
<Folder Name="/samples/">
<Project Path="samples/SimpleConsoleApp/SimpleConsoleApp.csproj" />
</Folder>
<Folder Name="/samples/BooksWebApi/">
<Project Path="samples/BooksWebApi/Books.Application/Books.Application.csproj" />
<Project Path="samples/BooksWebApi/Books.Domain/Books.Domain.csproj" />
<Project Path="samples/BooksWebApi/Books.Infrastructure/Books.Infrastructure.csproj" />
<Project Path="samples/BooksWebApi/Books.WebApi/Books.WebApi.csproj" />
</Folder>
<Folder Name="/src/">
<Project Path="src/MitMediator.InMemoryCache.Abstractions/MitMediator.InMemoryCache.Abstractions.csproj" />
<Project Path="src/MitMediator.InMemoryCache/MitMediator.InMemoryCache.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/MitMediator.InMemoryCache.Tests/MitMediator.InMemoryCache.Tests.csproj" />
</Folder>
</Solution>
Loading
Loading