Skip to content

Commit

Permalink
Support .NET 6/7/8 (#17)
Browse files Browse the repository at this point in the history
* Use .NET 6.0, .NET 7.0, .NET 8.0
* Bump major versions of dependencies
  • Loading branch information
hbulens committed Aug 30, 2023
1 parent 66a0da8 commit ab8d5fe
Show file tree
Hide file tree
Showing 39 changed files with 349 additions and 742 deletions.
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: Build and test

on:
workflow_dispatch:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./src

steps:
- uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-quality: "preview"
dotnet-version: |
6.x.x
7.x.x
8.x.x
- name: Install dependencies
run: dotnet restore

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

- name: Test
run: dotnet test --no-restore --verbosity normal
35 changes: 0 additions & 35 deletions azure-pipelines-master.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0;</TargetFrameworks>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<None Remove="Attachments\Attachment.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Content Include="Attachments\Attachment.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Facteur.Attachments.IO\Facteur.Attachments.IO.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Facteur.Attachments.IO\Facteur.Attachments.IO.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Attachments\Attachment.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Facteur.Attachments.IO.Tests/FileAttachmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class FileAttachmentTests
[TestMethod]
public async Task FileAttachment_Txt_ShouldCreateFileAttachment()
{
IAttachmentSource fileAttachment = new Facteur.Attachments.IO.FileAttachment();
Attachment attachment = await fileAttachment.Fetch("Attachments\\Attachment.txt");
IAttachmentSource fileAttachment = new FileAttachment();
Attachment attachment = await fileAttachment.Fetch("Attachments/Attachment.txt");

Assert.IsTrue(attachment.Name == "Attachment.txt");
Assert.IsTrue(attachment.ContentBytes.Length == 14);
Expand Down
4 changes: 2 additions & 2 deletions src/Facteur.Attachments.IO/Facteur.Attachments.IO.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.1;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<AssemblyTitle>Facteur.Attachments.IO</AssemblyTitle>
<Company>Dime Software</Company>
Expand All @@ -20,7 +20,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>Add attachments using simple IO</Description>
<PackageTags>Facteur;Email;Mail;RazorEngine;Scriban;SendGrid;Graph;SMTP</PackageTags>
<Version>1.1.2</Version>
<Version>1.2.0</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
Expand Down
12 changes: 1 addition & 11 deletions src/Facteur.Attachments.IO/FileAttachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@ namespace Facteur.Attachments.IO
public class FileAttachment : IAttachmentSource
{
public async Task<Attachment> Fetch(string path)
{
#if NET461
return new Attachment()
{
ContentBytes = File.ReadAllBytes(path),
Name = Path.GetFileName(path)
};
#else
return new Attachment()
=> new Attachment()
{
ContentBytes = await File.ReadAllBytesAsync(path),
Name = Path.GetFileName(path)
};
#endif
}
}
}

This file was deleted.

30 changes: 0 additions & 30 deletions src/Facteur.Compilers.Razor.Tests/RazorEngineCompilerTests.cs

This file was deleted.

113 changes: 0 additions & 113 deletions src/Facteur.Compilers.Razor.Tests/Templates/Test.dhtml

This file was deleted.

7 changes: 0 additions & 7 deletions src/Facteur.Compilers.Razor.Tests/TestMailModel.cs

This file was deleted.

13 changes: 0 additions & 13 deletions src/Facteur.Compilers.Razor/DefaultViewModel.cs

This file was deleted.

Loading

0 comments on commit ab8d5fe

Please sign in to comment.