From f94b8f27f0181299bc88942d75351732ea5cabf7 Mon Sep 17 00:00:00 2001 From: Kindeman Date: Sat, 30 Mar 2024 17:10:04 +1100 Subject: [PATCH] add support for .NET 8 --- .github/workflows/dotnet.yml | 2 +- CHANGELOG.md | 9 +- README.md | 2 +- README_zh.md | 108 ++++++++++++++++++ azure-pipelines.yml | 15 ++- src/NLog.Targets.MicrosoftTeams.sln | 1 + .../NLog.Targets.MicrosoftTeams.csproj | 4 +- 7 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 README_zh.md diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c063dfc..7af557f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore working-directory: src diff --git a/CHANGELOG.md b/CHANGELOG.md index eacc15b..5d29a21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Changelog -### 2.0.0 - 2023-01-08 +### 5.0.0 - 2023-01-08 +- Add Support for .NET 8 +- Remove support for .Net Core 3.1, .Net Framework + +### 4.0.0 - 2023-01-08 +- Add Support for netstandard2.1 + +### 4.0.0 - 2023-01-08 - Support .Net 7.0 ### 3.0.0 - 2022-06-04 diff --git a/README.md b/README.md index 8e45ea5..b1c06b6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A NLog target that write log to Microsoft Teams channel via O365 Webhook Connect - Support custom ApplicationName layout - Support custom Teams message card title -- Support .Net Framework, .Net Core, .Net 5/6/7, and .Net Standard +- Support .Net Framework, .Net Core, .Net 5/6/7/8, and .Net Standard - Options to configure your Webhook URL in NLog.conf, app.config, or appsetting.json diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..e01372d --- /dev/null +++ b/README_zh.md @@ -0,0 +1,108 @@ +[![NuGet版本(NLog.Targets.MicrosoftTeams)](https://img.shields.io/nuget/v/NLog.Targets.MicrosoftTeams.svg?style=flat)](https://www.nuget.org/packages/NLog.Targets.MicrosoftTeams) +[![构建状态](https://dev.azure.com/jedipi/NLog.Targets.MicrosoftTeams/_apis/build/status/jedipi.NLog.Targets.MicrosoftTeams?branchName=master)](https://dev.azure.com/jedipi/NLog.Targets.MicrosoftTeams/_build/latest?definitionId=1&branchName=master) +[![.NET](https://github.com/jedipi/NLog.Targets.MicrosoftTeams/actions/workflows/dotnet.yml/badge.svg?branch=master)](https://github.com/jedipi/NLog.Targets.MicrosoftTeams/actions/workflows/dotnet.yml) +![GitHub](https://img.shields.io/github/license/jedipi/NLog.Targets.MicrosoftTeams) +[![NuGet下载](https://img.shields.io/nuget/dt/NLog.Targets.MicrosoftTeams)](https://www.nuget.org/packages/NLog.Targets.MicrosoftTeams) +[![点击计数](http://hits.dwyl.com/jedipi/NLogTargetsMicrosoftTeams.svg)](https://github.com/jedipi/NLog.Targets.MicrosoftTeams) +##### 构建历史 +[![构建历史](https://buildstats.info/github/chart/jedipi/NLog.Targets.MicrosoftTeams?branch=master)](https://github.com/jedipi/NLog.Targets.MicrosoftTeams/actions?query=branch%3Amaster) +##### Stargazers & Forkers +[![Stargazers名册 @jedipi/NLog.Targets.MicrosoftTeams](https://reporoster.com/stars/jedipi/NLog.Targets.MicrosoftTeams)](https://github.com/jedipi/NLog.Targets.MicrosoftTeams/stargazers) +[![Forkers名册 @jedipi/NLog.Targets.MicrosoftTeams](https://reporoster.com/forks/jedipi/NLog.Targets.MicrosoftTeams)](https://github.com/jedipi/NLog.Targets.MicrosoftTeams/network/members) + + +# NLog.Targets.MicrosoftTeams +![](image/nlog-teams.png) +
+一个NLog目标,通过O365 Webhook连接器将日志写入Microsoft Teams频道。 + +- 支持自定义ApplicationName布局 +- 支持自定义Teams消息卡片标题 +- 支持.Net Framework、.Net Core、.Net 5/6/7/8和.Net Standard +- 可以在NLog.conf、app.config或appsetting.json中配置你的Webhook URL + + +关于Teams中的webhhoks的更多信息请阅读: +- https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors +- https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook + +# 输出 +![示例NLog.Targets.MicrosoftTeams输出](image/output.png) + +# 入门 +### 安装 + +将NLog.Targets.MicrosoftTeams包从nuget添加到你的项目中。 + +```cmd +PM> Install-Package NLog.Targets.MicrosoftTeams + + +
+ +### Usage +```xml + + + + + + + + + + +``` + + + +NLog.config +```xml +NLog.config + + + +``` + +```xml + + + +``` + +```xml + + + + + +``` + + +# Support +如果你从我创建的任何内容中获得了价值,就请我喝一杯吧。 + +[![请我喝一杯](https://www.lifeofanarchitect.com/wp-content/uploads/2017/12/Ko-Fi-Image-Buy-Me-a-Beer.png)](https://www.paypal.com/donate/?hosted_button_id=WW82TCHX3P6EG) + + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index afe9378..ccefbfc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,16 @@ # https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 trigger: -- master + branches: + include: + - master + paths: + include: + - NLog.Targets.MicrosoftTeams + exclude: + - '*.yaml' + - '*.yml' + - '*.md' pool: vmImage: 'windows-latest' @@ -16,9 +25,9 @@ variables: steps: - task: UseDotNet@2 - displayName: 'Use dotnet 7' + displayName: 'Use dotnet 8' inputs: - version: '7.0.x' + version: '8.0.x' - task: NuGetToolInstaller@1 diff --git a/src/NLog.Targets.MicrosoftTeams.sln b/src/NLog.Targets.MicrosoftTeams.sln index 7611ab9..8a70586 100644 --- a/src/NLog.Targets.MicrosoftTeams.sln +++ b/src/NLog.Targets.MicrosoftTeams.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{4A422B13-E ProjectSection(SolutionItems) = preProject ..\CHANGELOG.md = ..\CHANGELOG.md ..\README.md = ..\README.md + ..\README_zh.md = ..\README_zh.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipeline", "pipeline", "{240274A7-1530-49FB-B96F-D06B1A561A84}" diff --git a/src/NLog.Targets.MicrosoftTeams/NLog.Targets.MicrosoftTeams.csproj b/src/NLog.Targets.MicrosoftTeams/NLog.Targets.MicrosoftTeams.csproj index 7bc11b0..01bd478 100644 --- a/src/NLog.Targets.MicrosoftTeams/NLog.Targets.MicrosoftTeams.csproj +++ b/src/NLog.Targets.MicrosoftTeams/NLog.Targets.MicrosoftTeams.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net472;netcoreapp3.1;net5.0;net6;net7.0 + netstandard2.1;net472;net6;net7.0;net8.0 true A NLog target that writes to Microsoft Teams Channel via O365 Webhook Connector. Copyright © Kin Tam 2022 @@ -15,7 +15,7 @@ https://github.com/jedipi/NLog.Targets.MicrosoftTeams nlog-teams.png - support .NET 7.0 + add support for net8