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
12 changes: 0 additions & 12 deletions .config/dotnet-tools.json

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
run-name: CI 🔍 ${{ github.event.pull_request.title }}

on:
pull_request:

concurrency:
group: ci-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
name: Tests dotnet ${{ matrix.dotnet-version }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
dotnet-version: [10]
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Build projects
shell: bash
run: dotnet build ./all.csproj -f net${{ matrix.dotnet-version }}.0 -graph:true

- name: Run tests
shell: bash
run: dotnet test ./all.csproj /p:BuildTestsOnly=true --no-build -f net${{ matrix.dotnet-version }}.0 -- RunConfiguration.MaxCpuCount=1
34 changes: 0 additions & 34 deletions .github/workflows/pull-request.yml

This file was deleted.

68 changes: 38 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Release
run-name: Release 🚀 ${{ github.ref_name }}

on:
push:
Expand All @@ -8,36 +9,43 @@ on:
jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use .NET SDK from global.json
uses: actions/setup-dotnet@v3
- name: Build, Test and Push
uses: swisslife-oss/actions/release-packages@main
with:
tag: ${{ github.ref_name }}
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
enable_push: 'yes'
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5

- name: Build projects
shell: bash
run: dotnet build ./all.csproj -c Release -graph:true

- name: Extract version
id: extract_version
shell: bash
run: |
PACKAGE_VERSION="${{ github.ref_name }}"
ASSEMBLY_VERSION="$(echo ${{ github.ref_name }} | grep -o '^[0-9]*\.[0-9]*\.[0-9]*').0"
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
echo "assembly_version=$ASSEMBLY_VERSION" >> $GITHUB_OUTPUT
echo "Package Version: $PACKAGE_VERSION"
echo "Assembly Version: $ASSEMBLY_VERSION"

- name: Pack
shell: bash
run: |
dotnet pack ./all.csproj \
-c Release \
-o ./out \
--no-build \
--include-symbols \
--include-source \
--verbosity Minimal \
/p:Version=${{ steps.extract_version.outputs.package_version }} \
/p:AssemblyVersion=${{ steps.extract_version.outputs.assembly_version }} \
/p:FileVersion=${{ steps.extract_version.outputs.assembly_version }}

# sonar:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: |
# 8
# - name: Restore tools
# run: dotnet tool restore
# - name: Build, Test and Sonar
# uses: swisslife-oss/actions/release-sonar@main
# with:
# tag: ${{ github.ref_name }}
# sonar_token: ${{ secrets.SONAR_TOKEN }}
# sonar_project_key: 'SwissLife-OSS_Mongo-Extensions'
# sonar_project_name: "mongo-extensions"
# sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
- name: Push
shell: bash
run: |
find . -name '*.nupkg' -not -name '*.symbols.nupkg' | xargs -I {} dotnet nuget push {} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
28 changes: 24 additions & 4 deletions src/Package.props → Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
<Project>

<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);nullable</WarningsAsErrors>
<!-- TODO: Fix nullable warnings introduced by SDK 8→10 upgrade -->
<NoWarn>$(NoWarn);CS8600;CS8602;CS8604;CS8618;CS8625;CS8714;CS0618;CS8620</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup>
<Version Condition="$(Version) == ''">0.0.0</Version>
<Product>MongoDB Extensions</Product>
<Authors>Swiss Life authors and contributors</Authors>
<Company>Swiss Life</Company>
<Copyright>Copyright © $(Company) $([System.DateTime]::Now.Year)</Copyright>
<PackageLicenseUrl>https://github.com/SwissLife-OSS/mongo-extensions/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/SwissLife-OSS/mongo-extensions</PackageProjectUrl>
<PackageReleaseNotes>Release notes: https://github.com/SwissLife-OSS/mongo-extensions/releases/$(Version)</PackageReleaseNotes>
<PackageTags>MongoDB Extensions DbContext Context Boostrap Mongo .Net</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIconUrl>https://github.com/SwissLife-OSS/mongo-extensions-docs/raw/master/logo.png</PackageIconUrl>
<IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
40 changes: 21 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.15.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
Expand All @@ -14,33 +16,33 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.102" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="MongoDB.Driver" Version="3.4.0" />
<PackageVersion Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="2.1.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="[8.0.0,9)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="[8.0.0,9)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="[8.0.0,9)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[8.0.0,9)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="[8.0.0,9)" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="[8.0.0,9)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="3.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="2.2.0" />

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="[10.0.0,11)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="[10.0.0,11)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="[10.0.0,11)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[10.0.0,11)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="[10.0.0,11)" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="[10.0.0,11)" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions all.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.Build.Traversal/4.1.82">

<PropertyGroup>
<BuildTestsOnly>false</BuildTestsOnly>
<IncludeInSolutionFile>false</IncludeInSolutionFile>
</PropertyGroup>

<ItemGroup Condition="'$(BuildTestsOnly)' != 'true'">
<ProjectReference Include="**/*.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(BuildTestsOnly)' == 'true'">
<ProjectReference Include="**/test/**/*.csproj" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"sdk": {
"version": "8.0.402",
"rollForward": "latestFeature"
"version": "10.0.103"
}
}
2 changes: 0 additions & 2 deletions samples/Context/DataAccess/DataAccess.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.DataAccess</AssemblyName>
<RootNamespace>SimpleBlog.DataAccess</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions samples/Context/Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.Domain</AssemblyName>
<RootNamespace>SimpleBlog.Domain</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion samples/Context/Host/Host.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>fbbac7be-63d2-4849-8dc4-31492a2367a2</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
Expand Down
2 changes: 0 additions & 2 deletions samples/Context/Models/Models.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.Models</AssemblyName>
<RootNamespace>SimpleBlog.Models</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

</Project>
1 change: 0 additions & 1 deletion samples/Migration/Migration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Context/Context.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyName>MongoDB.Extensions.Context</AssemblyName>
<RootNamespace>MongoDB.Extensions.Context</RootNamespace>
<PackageId>MongoDB.Extensions.Context</PackageId>
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -23,6 +24,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading