From e56991001e3c602c6e55b51eb903395635096ac3 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 09:55:41 +0300 Subject: [PATCH 01/13] update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 38f0d7a..69d6e6a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Serilog.Sinks.Autodesk.Revit +[![JetBrains Rider](https://img.shields.io/badge/JetBrains-Rider-blue.svg)](https://www.jetbrains.com/rider) +[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md) +[![Revit 2017-2025](https://img.shields.io/badge/Revit-2017--2025-blue.svg)](https://www.autodesk.com/products/revit/overview) + Writes [Serilog](https://serilog.net) events to Autodesk Revit [Journal](https://www.revitapidocs.com/2022/97ec1eca-ab92-1cee-fdda-7bf3ce91c504.htm). ### Getting started From 7809cc9f08b1165e45deff02be75f5ba17456c72 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 09:55:47 +0300 Subject: [PATCH 02/13] update LICENSE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 0a9bf81..be3736b 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Biseuv Olzhas (dosymep) +Copyright (c) 2024 Biseuv Olzhas (dosymep) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From c090534066b5c5cee7fb56e674d6a77297227a7c Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 09:55:59 +0300 Subject: [PATCH 03/13] add ci workflow --- .github/workflows/main.yml | 93 +++++++++++++++++++ .../Serilog.Sinks.Autodesk.Revit.csproj | 2 + 2 files changed, 95 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ea596b5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,93 @@ +name: main + +permissions: + packages: write + contents: write + +on: + # on pull_request to master + pull_request: + types: [ opened, synchronize ] + branches: [ main, master ] + + # manual + workflow_dispatch: + +env: + output: bin + project: Serilog.Sinks.Autodesk.Revit + configuration: Release + default_branch: ${{ github.event.repository.default_branch }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Install the .NET Core workload + - name: Install .NET 8.0 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + # Build project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build + - name: Build + run: dotnet build -c ${{ env.configuration }} + + # Test project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test + - name: Test + run: dotnet test -c ${{ env.configuration }} --logger trx --results-directory "TestResults" + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: TestResults + path: TestResults + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + - name: Pack + run: dotnet pack -c ${{ env.configuration }} -o ${{ env.output }} + + # Fetch version: https://github.com/kzrnm/get-net-sdk-project-versions-action + - name: Fetch version + uses: kzrnm/get-net-sdk-project-versions-action@v2 + id: get-version + with: + proj-path: src/${{ env.project }}/${{ env.project }}.csproj + + # Upload the nuget package: https://github.com/marketplace/actions/upload-a-build-artifact + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: nuget + path: | + ${{ env.output }}/*.nupkg + ${{ env.output }}/*.snupkg + + # Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push + - name: Publish nuget + if: github.ref_name == env.default_branch + run: dotnet nuget push ${{ env.output }}/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate + + # Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push + - name: Publish github + if: github.ref_name == env.default_branch + run: dotnet nuget push ${{ env.output }}/*.nupkg -s https://nuget.pkg.github.com/${{ github.REPOSITORY_OWNER }}/index.json -k ${{ github.TOKEN }} --skip-duplicate + + # Publish release: https://github.com/softprops/action-gh-release + - name: Publish Release + if: github.ref_name == env.default_branch + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + with: + tag_name: v${{ steps.get-version.outputs.package-version }} + name: v${{ steps.get-version.outputs.package-version }} + body: v${{ steps.get-version.outputs.package-version }} + draft: true + prerelease: false + files: | + ${{ env.output }}/*.nupkg + ${{ env.output }}/*.snupkg \ No newline at end of file diff --git a/src/Serilog.Sinks.Autodesk.Revit/Serilog.Sinks.Autodesk.Revit.csproj b/src/Serilog.Sinks.Autodesk.Revit/Serilog.Sinks.Autodesk.Revit.csproj index 8c8025c..c0792d1 100644 --- a/src/Serilog.Sinks.Autodesk.Revit/Serilog.Sinks.Autodesk.Revit.csproj +++ b/src/Serilog.Sinks.Autodesk.Revit/Serilog.Sinks.Autodesk.Revit.csproj @@ -71,5 +71,7 @@ \ assets\README.md + + From 163fa73311ac46726d2131d1179b239297b4c3d3 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 09:59:42 +0300 Subject: [PATCH 04/13] update sln --- ...nks.Autodesk.Revit.sln => Serilog.Sinks.Autodesk.Revit.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/Serilog.Sinks.Autodesk.Revit.sln => Serilog.Sinks.Autodesk.Revit.sln (83%) diff --git a/src/Serilog.Sinks.Autodesk.Revit.sln b/Serilog.Sinks.Autodesk.Revit.sln similarity index 83% rename from src/Serilog.Sinks.Autodesk.Revit.sln rename to Serilog.Sinks.Autodesk.Revit.sln index 963f6b1..b32b47e 100644 --- a/src/Serilog.Sinks.Autodesk.Revit.sln +++ b/Serilog.Sinks.Autodesk.Revit.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit", "Serilog.Sinks.Autodesk.Revit\Serilog.Sinks.Autodesk.Revit.csproj", "{B7745F16-A858-493D-A548-E02DAEA0359B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit", "src/Serilog.Sinks.Autodesk.Revit\Serilog.Sinks.Autodesk.Revit.csproj", "{B7745F16-A858-493D-A548-E02DAEA0359B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{295B355A-0CB2-4965-8603-765D04882D69}" ProjectSection(SolutionItems) = preProject @@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\README.md = ..\README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit.Tests", "Serilog.Sinks.Autodesk.Revit.Tests\Serilog.Sinks.Autodesk.Revit.Tests.csproj", "{508A5950-2DBA-475D-A083-8E5161D5E5B9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit.Tests", "src/Serilog.Sinks.Autodesk.Revit.Tests\Serilog.Sinks.Autodesk.Revit.Tests.csproj", "{508A5950-2DBA-475D-A083-8E5161D5E5B9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 4bdb09a94114518034d3a9e153d9fa73cc686fc9 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:04:59 +0300 Subject: [PATCH 05/13] update sln --- Serilog.Sinks.Autodesk.Revit.sln | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Serilog.Sinks.Autodesk.Revit.sln b/Serilog.Sinks.Autodesk.Revit.sln index b32b47e..1c75476 100644 --- a/Serilog.Sinks.Autodesk.Revit.sln +++ b/Serilog.Sinks.Autodesk.Revit.sln @@ -4,11 +4,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revi EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{295B355A-0CB2-4965-8603-765D04882D69}" ProjectSection(SolutionItems) = preProject - ..\.editorconfig = ..\.editorconfig - ..\CONTRIBUTING.md = ..\CONTRIBUTING.md - ..\CREDITS.md = ..\CREDITS.md - ..\LICENSE.md = ..\LICENSE.md - ..\README.md = ..\README.md + .editorconfig = .editorconfig + CONTRIBUTING.md = CONTRIBUTING.md + CREDITS.md = CREDITS.md + LICENSE.md = LICENSE.md + README.md = README.md EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit.Tests", "src/Serilog.Sinks.Autodesk.Revit.Tests\Serilog.Sinks.Autodesk.Revit.Tests.csproj", "{508A5950-2DBA-475D-A083-8E5161D5E5B9}" From 308e1c0cc938fc7f1422ba0454202cac2b4eb6aa Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:05:10 +0300 Subject: [PATCH 06/13] update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69d6e6a..b022a3f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![JetBrains Rider](https://img.shields.io/badge/JetBrains-Rider-blue.svg)](https://www.jetbrains.com/rider) [![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md) [![Revit 2017-2025](https://img.shields.io/badge/Revit-2017--2025-blue.svg)](https://www.autodesk.com/products/revit/overview) +[![main](https://github.com/dosymep/Serilog.Sinks.Autodesk.Revit/actions/workflows/main.yml/badge.svg)](https://github.com/dosymep/Serilog.Sinks.Autodesk.Revit/actions/workflows/main.yml) Writes [Serilog](https://serilog.net) events to Autodesk Revit [Journal](https://www.revitapidocs.com/2022/97ec1eca-ab92-1cee-fdda-7bf3ce91c504.htm). From 6802c5be1a3fc67b1c52ac39074e980f2199dcff Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:06:35 +0300 Subject: [PATCH 07/13] remove .idea folder --- .gitignore | 4 +++- src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/.name | 1 - .../.idea/encodings.xml | 4 ---- .../.idea/indexLayout.xml | 8 -------- .../.idea/projectSettingsUpdater.xml | 6 ------ .../.idea.Serilog.Sinks.Autodesk.Revit/.idea/vcs.xml | 6 ------ 6 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/.name delete mode 100644 src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/encodings.xml delete mode 100644 src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/indexLayout.xml delete mode 100644 src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/projectSettingsUpdater.xml delete mode 100644 src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/vcs.xml diff --git a/.gitignore b/.gitignore index 7094a04..cd01e5f 100644 --- a/.gitignore +++ b/.gitignore @@ -395,4 +395,6 @@ FodyWeavers.xsd # Rider auto-generates .iml files, and contentModel.xml **/.idea/**/*.iml **/.idea/**/contentModel.xml -**/.idea/**/modules.xml \ No newline at end of file +**/.idea/**/modules.xml + +/.idea \ No newline at end of file diff --git a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/.name b/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/.name deleted file mode 100644 index a55e81e..0000000 --- a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Serilog.Sinks.Autodesk.Revit \ No newline at end of file diff --git a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/encodings.xml b/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/encodings.xml deleted file mode 100644 index df87cf9..0000000 --- a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/indexLayout.xml b/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/indexLayout.xml deleted file mode 100644 index 7b08163..0000000 --- a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/indexLayout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/projectSettingsUpdater.xml b/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/projectSettingsUpdater.xml deleted file mode 100644 index 4bb9f4d..0000000 --- a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/projectSettingsUpdater.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/vcs.xml b/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/src/.idea/.idea.Serilog.Sinks.Autodesk.Revit/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 359c0c1e987adaf9dd7aec5d45bb84af30aa20fd Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:06:43 +0300 Subject: [PATCH 08/13] add badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b022a3f..a39ecec 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To configure the sink in C# code, call `WriteTo.RevitJournal()` during logger co public Result Execute(ExternalCommandData commandData, out string message, ElementSet elements) { - UIApplication uiApplication = commandData.Application; + UIApplic[.gitignore](.gitignore)ation uiApplication = commandData.Application; var log = new LoggerConfiguration() .WriteTo.RevitJournal(uiApplication) .CreateLogger(); From 513e679b924d165dc332b70c7e59125484c86649 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:09:57 +0300 Subject: [PATCH 09/13] update build machine --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea596b5..bbc7523 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 From 1ea66c9907b10325349ea46c4a859af331acbcb0 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:14:15 +0300 Subject: [PATCH 10/13] update upload artifacts --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbc7523..0a53519 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: # Upload the nuget package: https://github.com/marketplace/actions/upload-a-build-artifact - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nuget path: | From a78c6e4b081de64aa68f0db7078baeae47d5b297 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:19:07 +0300 Subject: [PATCH 11/13] update ci --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a53519..828949f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,12 +40,12 @@ jobs: run: dotnet test -c ${{ env.configuration }} --logger trx --results-directory "TestResults" - name: Upload test results - uses: actions/upload-artifact@v4 + uses: bibipkins/dotnet-test-reporter@v1.4.0 with: - name: TestResults - path: TestResults - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-title: 'Unit Test Results' + results-path: ./TestResults/*.trx + coverage-threshold: 80 - name: Pack run: dotnet pack -c ${{ env.configuration }} -o ${{ env.output }} From 4fefe2ce2761950c5f3b109566de01e2edf32f1f Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:23:21 +0300 Subject: [PATCH 12/13] update ci --- .github/workflows/main.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 828949f..f93ca43 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,8 @@ name: main permissions: packages: write contents: write + actions: read + checks: write on: # on pull_request to master @@ -39,14 +41,15 @@ jobs: - name: Test run: dotnet test -c ${{ env.configuration }} --logger trx --results-directory "TestResults" - - name: Upload test results - uses: bibipkins/dotnet-test-reporter@v1.4.0 + # Upload tests results: https://github.com/dorny/test-reporter + - name: Upload tests results + uses: dorny/test-reporter@v1 + if: success() || failure() with: - github-token: ${{ secrets.GITHUB_TOKEN }} - comment-title: 'Unit Test Results' - results-path: ./TestResults/*.trx - coverage-threshold: 80 - + name: dotnet tests + path: ./TestResults/*.trx + reporter: dotnet-trx + - name: Pack run: dotnet pack -c ${{ env.configuration }} -o ${{ env.output }} From c92b7258843219a1711cbb16a3aac06ffab17096 Mon Sep 17 00:00:00 2001 From: dosymep Date: Tue, 14 May 2024 10:29:41 +0300 Subject: [PATCH 13/13] add CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ Serilog.Sinks.Autodesk.Revit.sln | 1 + 2 files changed, 14 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a7c4f01 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.0.0] - 2024-05-14 +### Add + +- net8.0 target framework +- ci workflow +- CHANGELOG.md \ No newline at end of file diff --git a/Serilog.Sinks.Autodesk.Revit.sln b/Serilog.Sinks.Autodesk.Revit.sln index 1c75476..b56ce40 100644 --- a/Serilog.Sinks.Autodesk.Revit.sln +++ b/Serilog.Sinks.Autodesk.Revit.sln @@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution CREDITS.md = CREDITS.md LICENSE.md = LICENSE.md README.md = README.md + CHANGELOG.md = CHANGELOG.md EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Autodesk.Revit.Tests", "src/Serilog.Sinks.Autodesk.Revit.Tests\Serilog.Sinks.Autodesk.Revit.Tests.csproj", "{508A5950-2DBA-475D-A083-8E5161D5E5B9}"