Skip to content

Commit

Permalink
Update template with .NET 8 support, reusable workflows and add defau…
Browse files Browse the repository at this point in the history
…lt target of .NET Standard 2.0 (MAFIN-Squad#75)

* Add .NET 8 support

* Upgrade dependencies

* Fix push symbols to NuGet issue

* Update pipelines to target reusable workflows

* Remove unnecessary package

* Move to target netstandard2.0

---------

Co-authored-by: Yauhen Klimiashuk <[email protected]>
  • Loading branch information
Molnix888 and Yauhen Klimiashuk authored Dec 7, 2023
1 parent f3fbd90 commit 3194066
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 48 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ on:
tags:
- 'v*'

env:
CONFIGURATION: Release
PACKAGE_OUPUT_DIRECTORY: ${{ github.workspace }}/output

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

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Pack solution
run: dotnet pack -o ${{ env.PACKAGE_OUPUT_DIRECTORY }} -c ${{ env.CONFIGURATION }} --include-symbols

- name: Publish to NuGet
run: dotnet nuget push ${{ env.PACKAGE_OUPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_API_KEY }}
uses: MAFIN-Squad/workflows/.github/workflows/package-release.yml@main
25 changes: 1 addition & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,6 @@ on:
push:
branches: [ main ]

env:
CONFIGURATION: Release

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

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build solution
run: dotnet build -c ${{ env.CONFIGURATION }} --no-restore

- name: Run unit tests
run: dotnet test tests/*.Unit/*.csproj -c ${{ env.CONFIGURATION }} --no-build --collect:"XPlat Code Coverage"

- name: Upload code coverage results
uses: codecov/codecov-action@v3
uses: MAFIN-Squad/workflows/.github/workflows/package-test.yml@main
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Features>strict</Features>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CST.DevSkim" PrivateAssets="all" />
<PackageReference Include="Philips.CodeAnalysis.DuplicateCodeAnalyzer" PrivateAssets="all" />
<PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers.Unstable" PrivateAssets="all" />
Expand Down
3 changes: 1 addition & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions.Analyzers" Version="0.26.0" />
<PackageVersion Include="Microsoft.CST.DevSkim" Version="1.0.23" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Philips.CodeAnalysis.DuplicateCodeAnalyzer" Version="1.1.7" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.12.0.78982" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.15.0.81779" />
<PackageVersion Include="StyleCop.Analyzers.Unstable" Version="1.2.0.507" />
<PackageVersion Include="xunit.analyzers" Version="1.6.0" />
<PackageVersion Include="xunit.core" Version="2.6.2" />
Expand Down
2 changes: 1 addition & 1 deletion src/Mafin.Template/Mafin.Template.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netstandard2.1</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Mafin.Template</PackageId>
<Description>MAFIN Template package</Description>
<Authors>MAFIN Squad</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit 3194066

Please sign in to comment.