Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference updates #34

Merged
merged 22 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f87a1e7
Updates of the references; supporting .NET 8.0
tsutomi Jan 30, 2024
0c01963
Version update
tsutomi Jan 30, 2024
3dd2842
Installing .NET 8.0 at the CI/CD runtime
tsutomi Jan 30, 2024
cc42855
Using strategy to build CI
tsutomi Jan 30, 2024
5821613
Building PR with matrix of .NET frameworks
tsutomi Jan 30, 2024
f88fa09
Update the reference to the Test SDK
tsutomi Jan 30, 2024
d7a02bb
Trying to lower the version of the Test SDK
tsutomi Jan 30, 2024
7a4dd4a
Updating the references to the framework
tsutomi Feb 20, 2024
6102af9
Changing the CI/CD pipelines to pack separately from build
tsutomi Feb 20, 2024
f096ae5
Updating references to the XUnit and Test Framework
tsutomi Feb 20, 2024
1e45e29
Trying to run PR Build only on specific frameworks
tsutomi Feb 20, 2024
0b9723a
Fixing typo in PR Build env variable emit
tsutomi Feb 20, 2024
8c1fa71
Lowering the version of the Test SDK to address a possible error in .…
tsutomi Feb 20, 2024
16de5e3
diagnostic logging of tests to catch the crash of the test host
tsutomi Feb 20, 2024
6727c5c
Reference updates
tsutomi Feb 20, 2024
2a50a72
Adding missing reference in a test project
tsutomi Feb 20, 2024
ea01d39
Adding missing references for .NET 8.0 framework in test projects
tsutomi Feb 20, 2024
2e64229
Further reference updates
tsutomi Feb 20, 2024
46f6adb
Externalizing the TFM parsing to a common workflow
tsutomi Feb 21, 2024
4d95d83
Attempting to fix the workflow ref
tsutomi Feb 21, 2024
77a3747
Changing the way to call reusable workflow
tsutomi Feb 21, 2024
a30279b
Revert the methods to generate the TFM in actions
tsutomi Feb 21, 2024
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
56 changes: 38 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,71 @@
name: Repository CI/CD

permissions:
contents: read
packages: write

on:
push:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ]

steps:
- uses: actions/checkout@v3

- name: Setup .NET Framework
uses: actions/setup-dotnet@v3
- uses: actions/checkout@v4

- name: Emit .NET 6.0 Framework Version
if: matrix.dotnet == '6.0.x'
run: echo "DOTNET_FX_VERSION=net6.0" >> $GITHUB_ENV

- name: Emit .NET 7.0 Framework Version
if: matrix.dotnet == '7.0.x'
run: echo "DOTNET_FX_VERSION=net7.0" >> $GITHUB_ENV

- name: Emit .NET 8.0 Framework Version
if: matrix.dotnet == '8.0.x'
run: echo "DOTNET_FX_VERSION=net8.0" >> $GITHUB_ENV

- name: Setup .NET ${{ matrix.dotnet }} Framework
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet }}

- name: Install SQLite Spatial
run: sudo apt-get install -y libsqlite3-mod-spatialite

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text
# - name: Add Deveel GitHub NuGet Source
# run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --version-suffix $GITHUB_RUN_ID -c Release
run: dotnet build --no-restore --version-suffix $GITHUB_RUN_ID -c Release -f ${{ env.DOTNET_FX_VERSION }}

- name: Test
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
run: dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_FX_VERSION }} /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Collect to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Collect to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

pack:
needs: build
runs-on: ubuntu-latest
steps:
- name: Pack NuGet
run: dotnet pack --version-suffix $GITHUB_RUN_ID -c Release -o ./nuget

- name: Push NutGet
run: dotnet nuget push ./nuget/*.nupkg -s "Deveel GitHub" --skip-duplicate --api-key ${{secrets.DEVEEL_NUGET_TOKEN}}
run: dotnet nuget push ./nuget/*.nupkg -s "https://nuget.pkg.github.com/deveel/index.json" --skip-duplicate --api-key ${{secrets.GITHUB_TOKEN}}

clean:
name: "Clean Old Packages"
needs: build
needs: pack
uses: ./.github/workflows/clean-packages.yml
33 changes: 21 additions & 12 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,40 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Emit .NET 6.0 Framework Version
if: matrix.dotnet == '6.0.x'
run: echo "DOTNET_FX_VERSION=net6.0" >> $GITHUB_ENV

- name: Emit .NET 7.0 Framework Version
if: matrix.dotnet == '7.0.x'
run: echo "DOTNET_FX_VERSION=net7.0" >> $GITHUB_ENV

- name: Emit .NET 8.0 Framework Version
if: matrix.dotnet == '8.0.x'
run: echo "DOTNET_FX_VERSION=net8.0" >> $GITHUB_ENV

- name: Setup .NET Framework
uses: actions/setup-dotnet@v3
- name: Setup .NET ${{ matrix.dotnet }} Framework
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet }}

- name: Install SQLite Spatial
run: sudo apt-get install -y libsqlite3-mod-spatialite

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --version-suffix $GITHUB_RUN_ID -c Release
run: dotnet build --no-restore --version-suffix $GITHUB_RUN_ID -c Release -f ${{ env.DOTNET_FX_VERSION }}

- name: Test
run: dotnet test --no-build --verbosity normal -c Release
run: dotnet test --no-build --no-restore -c Release -f ${{ env.DOTNET_FX_VERSION }} --verbosity normal

40 changes: 31 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Repository Release

permissions:
contents: read
packages: write

on:
push:
tags:
Expand All @@ -8,16 +12,30 @@ on:
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dotnet-version: [ '6.0.x', '7.0.x', '8.0.x' ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Emit .NET 6.0 Framework Version
if: matrix.dotnet == '6.0.x'
run: echo "DOTNET_FX_VERSION=net6.0" >> $GITHUB_ENV

- name: Emit .NET 7.0 Framework Version
if: matrix.dotnet == '7.0.x'
run: echo "DOTNET_FX_VERSION=net7.0" >> $GITHUB_ENV

- name: Emit .NET 8.0 Framework Version
if: matrix.dotnet == '8.0.x'
run: echo "DOTNET_FX_VERSION=net8.0" >> $GITHUB_ENV

- name: Setup .NET Framework
uses: actions/setup-dotnet@v3
- name: Setup .NET ${{ matrix.dotnet-version }} Framework
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet-version }}

- name: Get tag
id: tag
Expand All @@ -28,8 +46,8 @@ jobs:
- name: Install SQLite Spatial
run: sudo apt-get install -y libsqlite3-mod-spatialite

- name: Add Deveel GitHub NuGet Source
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text
# - name: Add Deveel GitHub NuGet Source
# run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text

- name: Restore dependencies
run: dotnet restore
Expand All @@ -45,11 +63,15 @@ jobs:
with:
token: ${{ secrets.DEVEEL_CODECOV_TOKEN }}

publish:
needs: release
runs-on: ubuntu-latest
steps:
- name: Pack NuGet
run: dotnet pack -p:PackageVersion=${{steps.tag.outputs.tag}} -c Release -o ./nuget

- name: Push Github Nuget
run: dotnet nuget push ./nuget/*.nupkg -s "Deveel GitHub" --skip-duplicate --api-key ${{secrets.DEVEEL_NUGET_TOKEN}}
run: dotnet nuget push ./nuget/*.nupkg -s "https://nuget.pkg.github.com/deveel/index.json" --skip-duplicate --api-key ${{secrets.GITHUB_TOKEN}}

- name: Push to Github.org
run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
25 changes: 25 additions & 0 deletions .github/workflows/tfm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Emit TFM"

on:
workflow_call:
inputs:
dotnet-version:
description: "The .NET Framework version to obtain the TFM"
required: true
type: string

jobs:
emit:
runs-on: ubuntu-latest
steps:
- name: Emit .NET 6.0 Framework Version
if: ${{ inputs.dotnet-version}} == '6.0.x'
run: echo "DOTNET_FX_VERSION=net6.0" >> $GITHUB_ENV

- name: Emit .NET 7.0 Framework Version
if: ${{ inputs.dotnet-version}} == '7.0.x'
run: echo "DOTNET_FX_VERSION=net7.0" >> $GITHUB_ENV

- name: Emit .NET 8.0 Framework Version
if: ${{ inputs.dotnet-version}} == '8.0.x'
run: echo "DOTNET_FX_VERSION=net8.0" >> $GITHUB_ENV
6 changes: 6 additions & 0 deletions src/Deveel.Repository.Core/Deveel.Repository.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.2.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.8" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.12" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant.EntityFrameworkCore" Version="6.12.0" />
<PackageReference Include="Finbuckle.MultiTenant.EntityFrameworkCore" Version="6.13.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Deveel.Repository.Core\Deveel.Repository.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Title>Deveel Repository Finbuckle Multi-Tenant Extension</Title>
Expand All @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant" Version="6.12.0" />
<PackageReference Include="Finbuckle.MultiTenant" Version="6.13.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyCaching.Core" Version="1.9.1" />
<PackageReference Include="EasyCaching.Core" Version="1.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant" Version="6.12.0" />
<PackageReference Include="MongoFramework" Version="0.29.0" />
</ItemGroup>

Expand Down
10 changes: 6 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>Deveel</RootNamespace>
<VersionPrefix>1.2.8</VersionPrefix>
<VersionPrefix>1.3.0</VersionPrefix>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- NuGet Metadata and Commands -->
<Authors>Antonello Provenzano</Authors>
<Company>Deveel AS</Company>
<Copyright>(C) 2022-2023 Deveel AS</Copyright>
<Copyright>(C) 2022-2024 Antonello Provenzano</Copyright>
<PackageProjectUrl>https://github.com/deveel/deveel.repository</PackageProjectUrl>
<RepositoryUrl>https://github.com/deveel/deveel.repository</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -24,7 +24,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="'$(TargetFramework)' != 'net8.0'"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" Condition="'$(TargetFramework)' == 'net8.0'"/>

</ItemGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\Deveel.Repository.Core\Deveel.Repository.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override async Task DisposeAsync() {

await dbContext.DisposeAsync();

await base.DisposeAsync();
// await base.DisposeAsync();
}
}
}
Loading
Loading