diff --git a/.github/workflows/Cogito.Seq.yml b/.github/workflows/Cogito.Seq.yml new file mode 100644 index 0000000..303a2b3 --- /dev/null +++ b/.github/workflows/Cogito.Seq.yml @@ -0,0 +1,125 @@ +name: Cogito.Seq + +on: + workflow_dispatch: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + release: + types: + - created + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v3 + with: + versionSpec: 5.x + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v3 + with: + useConfigFile: true + - name: Add NuGet Source (GitHub) + shell: pwsh + run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name alethic $env:GITHUB_REPOS + env: + GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: NuGet Restore + run: dotnet restore Cogito.Seq.sln + - name: Build + shell: pwsh + run: | + dotnet msbuild /m /bl ` + /p:Configuration="Release" ` + /p:Platform="Any CPU" ` + /p:Version=${env:GitVersion_FullSemVer} ` + /p:AssemblyVersion=${env:GitVersion_AssemblySemVer} ` + /p:InformationalVersion=${env:GitVersion_InformationalVersion} ` + /p:FileVersion=${env:GitVersion_AssemblySemFileVer} ` + /p:PackageVersion=${env:GitVersion_FullSemVer} ` + /p:RepositoryUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}.git" ` + /p:PackageProjectUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}" ` + /p:BuildInParallel=true ` + /p:ContinuousIntegrationBuild=true ` + Cogito.Seq.dist.msbuildproj + - name: Upload MSBuild Log + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: msbuild.binlog + path: msbuild.binlog + - name: Upload NuGet Packages + uses: actions/upload-artifact@v4 + with: + name: nuget + path: dist/nuget + release: + name: Release + if: github.event_name != 'pull_request' + needs: + - build + runs-on: ubuntu-22.04 + steps: + - name: Checkout Source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v3 + with: + versionSpec: 5.x + - name: Execute GitVersion + id: GitVersion + uses: gittools/actions/gitversion/execute@v3 + with: + useConfigFile: true + - name: Download NuGet Packages + uses: actions/download-artifact@v4 + with: + name: nuget + path: dist/nuget + - name: Create Release + if: github.ref_type == 'tag' + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.GitVersion.outputs.semVer }} + allowUpdates: true + omitBodyDuringUpdate: true + artifacts: dist/nuget/*.nupkg,dist/nuget/*.snupkg,dist/doc.zip + makeLatest: true + token: ${{ secrets.GITHUB_TOKEN }} + - name: Push NuGet (GitHub) + if: github.event_name != 'pull_request' + shell: pwsh + run: dotnet nuget push dist/nuget/*.nupkg --source $env:GITHUB_REPOS --api-key $env:GITHUB_TOKEN --skip-duplicate + env: + GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Push NuGet + if: github.ref_type == 'tag' + shell: pwsh + run: dotnet nuget push dist/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate + env: + NUGET_REPOS: https://api.nuget.org/v3/index.json + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} diff --git a/.gitignore b/.gitignore index 3c4efe2..c2b1370 100644 --- a/.gitignore +++ b/.gitignore @@ -258,4 +258,6 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc + +/dist \ No newline at end of file diff --git a/Cogito.Seq.dist.msbuildproj b/Cogito.Seq.dist.msbuildproj new file mode 100644 index 0000000..a8ad412 --- /dev/null +++ b/Cogito.Seq.dist.msbuildproj @@ -0,0 +1,32 @@ + + + $(DISTDIR) + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'dist')) + $([System.IO.Path]::GetFullPath('$(DistDir)')) + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'Cogito.Seq.sln')) + Release + Any CPU + + + + + dist%5Cdist-nuget:Publish + PublishDir=$(DistDir)\nuget + + + dist%5Cdist-tests:Publish + PublishDir=$(DistDir)\tests + + + + + + <_TargetsForPublish Include="@(TargetsForPublish)"> + %(TargetsForPublish.Properties) + + + + + + + diff --git a/Cogito.Seq.sln b/Cogito.Seq.sln index 5e16a27..b7af55c 100644 --- a/Cogito.Seq.sln +++ b/Cogito.Seq.sln @@ -5,17 +5,33 @@ VisualStudioVersion = 17.7.34221.43 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7271F8CF-C4EC-47FE-91F3-FF3331482C4F}" ProjectSection(SolutionItems) = preProject + .gitattributes = .gitattributes + .gitignore = .gitignore appveyor.yml = appveyor.yml + Cogito.Seq.dist.msbuildproj = Cogito.Seq.dist.msbuildproj + .github\workflows\Cogito.Seq.yml = .github\workflows\Cogito.Seq.yml Directory.Build.props = Directory.Build.props + GitVersion.yml = GitVersion.yml + global.json = global.json + icon.png = icon.png + LICENSE = LICENSE EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq", "Cogito.Seq\Cogito.Seq.csproj", "{5277E2FC-4772-4FA6-B463-F64C6BD020C7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq", "src\Cogito.Seq\Cogito.Seq.csproj", "{5277E2FC-4772-4FA6-B463-F64C6BD020C7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Autofac", "Cogito.Seq.Autofac\Cogito.Seq.Autofac.csproj", "{22DAF356-6F10-45EA-A435-26DDEA0C56AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Autofac", "src\Cogito.Seq.Autofac\Cogito.Seq.Autofac.csproj", "{22DAF356-6F10-45EA-A435-26DDEA0C56AB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Serilog", "Cogito.Seq.Serilog\Cogito.Seq.Serilog.csproj", "{B3CEF10D-76ED-40A3-B73E-9C65606EB7C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Serilog", "src\Cogito.Seq.Serilog\Cogito.Seq.Serilog.csproj", "{B3CEF10D-76ED-40A3-B73E-9C65606EB7C0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Serilog.Autofac", "Cogito.Seq.Serilog.Autofac\Cogito.Seq.Serilog.Autofac.csproj", "{CF3DB072-F5A6-4540-A1F5-4C452CFB56D9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cogito.Seq.Serilog.Autofac", "src\Cogito.Seq.Serilog.Autofac\Cogito.Seq.Serilog.Autofac.csproj", "{CF3DB072-F5A6-4540-A1F5-4C452CFB56D9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7E7C8ABF-FE50-468D-811D-7F6E3B013E7D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dist", "dist", "{B964859D-F754-40CE-919A-32C388859D56}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dist-nuget", "src\dist-nuget\dist-nuget.csproj", "{A9227BCD-FC28-4609-A935-492726826A5D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dist-tests", "src\dist-tests\dist-tests.csproj", "{23CF5B37-5073-4AFC-B262-03625FB053FF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,10 +55,26 @@ Global {CF3DB072-F5A6-4540-A1F5-4C452CFB56D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF3DB072-F5A6-4540-A1F5-4C452CFB56D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF3DB072-F5A6-4540-A1F5-4C452CFB56D9}.Release|Any CPU.Build.0 = Release|Any CPU + {A9227BCD-FC28-4609-A935-492726826A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9227BCD-FC28-4609-A935-492726826A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9227BCD-FC28-4609-A935-492726826A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9227BCD-FC28-4609-A935-492726826A5D}.Release|Any CPU.Build.0 = Release|Any CPU + {23CF5B37-5073-4AFC-B262-03625FB053FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23CF5B37-5073-4AFC-B262-03625FB053FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23CF5B37-5073-4AFC-B262-03625FB053FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23CF5B37-5073-4AFC-B262-03625FB053FF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5277E2FC-4772-4FA6-B463-F64C6BD020C7} = {7E7C8ABF-FE50-468D-811D-7F6E3B013E7D} + {22DAF356-6F10-45EA-A435-26DDEA0C56AB} = {7E7C8ABF-FE50-468D-811D-7F6E3B013E7D} + {B3CEF10D-76ED-40A3-B73E-9C65606EB7C0} = {7E7C8ABF-FE50-468D-811D-7F6E3B013E7D} + {CF3DB072-F5A6-4540-A1F5-4C452CFB56D9} = {7E7C8ABF-FE50-468D-811D-7F6E3B013E7D} + {A9227BCD-FC28-4609-A935-492726826A5D} = {B964859D-F754-40CE-919A-32C388859D56} + {23CF5B37-5073-4AFC-B262-03625FB053FF} = {B964859D-F754-40CE-919A-32C388859D56} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FF4B3820-4206-4316-82A5-DEA5792C6A71} EndGlobalSection diff --git a/Directory.Build.props b/Directory.Build.props index e7388c5..373b0f0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,15 +1,39 @@ - Jerome Haltom - Alethic Solutions - https://github.com/alethic/Cogito.Seq - git - https://github.com/alethic/Cogito.Seq - MIT - icon.png - 8.0 + 12.0 + - + + + + Cogito.Seq + @(Authors, ',') + $([System.DateTime]::UtcNow.Year.ToString()) + Copyright © $(CurrentYear) @(Authors, ', ') + + + + 0 + $(DefaultMajorVersion).0.0-dev + $(DefaultMajorVersion).0.0.0 + $(DefaultMajorVersion).0.0.0 + $(DefaultMajorVersion).0.0.0 + + + + https://github.com/alethic/Cogito.Seq.git + git + https://github.com/alethic/Cogito.Seq + $(Version) + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/GitVersion.yml b/GitVersion.yml index 0093d88..cfabef0 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1 +1,15 @@ -mode: Mainline +mode: ContinuousDeployment +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}' +major-version-bump-message: '\+semver:\s?(major)' +minor-version-bump-message: '\+semver:\s?(minor)' +patch-version-bump-message: '\+semver:\s?(patch)' +branches: + main: + regex: ^main$ + tag: pre + increment: Patch + develop: + regex: ^develop$ + tag: dev + increment: Minor + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..af774b9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Alethic Solutions + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/global.json b/global.json new file mode 100644 index 0000000..5b3ef7d --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + "version": "8.0.100", + "rollForward": "latestFeature" + }, + "msbuild-sdks": { + "Microsoft.Build.NoTargets": "3.7.56" + } +} diff --git a/Cogito.Seq.Autofac/AssemblyModule.cs b/src/Cogito.Seq.Autofac/AssemblyModule.cs similarity index 100% rename from Cogito.Seq.Autofac/AssemblyModule.cs rename to src/Cogito.Seq.Autofac/AssemblyModule.cs diff --git a/Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj b/src/Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj similarity index 89% rename from Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj rename to src/Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj index 523f902..3d42fe2 100644 --- a/Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj +++ b/src/Cogito.Seq.Autofac/Cogito.Seq.Autofac.csproj @@ -3,7 +3,6 @@ netstandard2.0 Various utilities for Seq. - true diff --git a/Cogito.Seq.Serilog.Autofac/AssemblyModule.cs b/src/Cogito.Seq.Serilog.Autofac/AssemblyModule.cs similarity index 100% rename from Cogito.Seq.Serilog.Autofac/AssemblyModule.cs rename to src/Cogito.Seq.Serilog.Autofac/AssemblyModule.cs diff --git a/Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj b/src/Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj similarity index 87% rename from Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj rename to src/Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj index d38d5d0..7e0f8d0 100644 --- a/Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj +++ b/src/Cogito.Seq.Serilog.Autofac/Cogito.Seq.Serilog.Autofac.csproj @@ -3,7 +3,6 @@ netstandard2.0 Various utilities for Seq. - true diff --git a/Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj b/src/Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj similarity index 90% rename from Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj rename to src/Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj index f994f88..306e86a 100644 --- a/Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj +++ b/src/Cogito.Seq.Serilog/Cogito.Seq.Serilog.csproj @@ -3,7 +3,6 @@ netstandard2.0 Various utilities for Seq. - true diff --git a/Cogito.Seq.Serilog/SeqLoggerConfigurator.cs b/src/Cogito.Seq.Serilog/SeqLoggerConfigurator.cs similarity index 100% rename from Cogito.Seq.Serilog/SeqLoggerConfigurator.cs rename to src/Cogito.Seq.Serilog/SeqLoggerConfigurator.cs diff --git a/Cogito.Seq/Cogito.Seq.csproj b/src/Cogito.Seq/Cogito.Seq.csproj similarity index 77% rename from Cogito.Seq/Cogito.Seq.csproj rename to src/Cogito.Seq/Cogito.Seq.csproj index bc88ccb..eb65aff 100644 --- a/Cogito.Seq/Cogito.Seq.csproj +++ b/src/Cogito.Seq/Cogito.Seq.csproj @@ -3,7 +3,6 @@ netstandard2.0 Various utilities for Seq. - true diff --git a/Cogito.Seq/SeqOptions.cs b/src/Cogito.Seq/SeqOptions.cs similarity index 100% rename from Cogito.Seq/SeqOptions.cs rename to src/Cogito.Seq/SeqOptions.cs diff --git a/src/dist-nuget/dist-nuget.csproj b/src/dist-nuget/dist-nuget.csproj new file mode 100644 index 0000000..ef6fdf3 --- /dev/null +++ b/src/dist-nuget/dist-nuget.csproj @@ -0,0 +1,23 @@ + + + netstandard2.0 + false + false + + + + + . + + + . + + + . + + + . + + + + diff --git a/src/dist-tests/dist-tests.csproj b/src/dist-tests/dist-tests.csproj new file mode 100644 index 0000000..caddfb3 --- /dev/null +++ b/src/dist-tests/dist-tests.csproj @@ -0,0 +1,34 @@ + + + netstandard2.0 + false + false + + + + + + + + + + + + <_ProjectName>%(TestTarget.ProjectName) + <_ProjectFile>%(TestTarget.ProjectFile) + <_ProjectFile Condition=" '$(_ProjectFile)' == '' And Exists('..\$(_ProjectName)\$(_ProjectName).csproj') ">..\$(_ProjectName)\$(_ProjectName).csproj + <_ProjectFile Condition=" '$(_ProjectFile)' == '' And Exists('..\$(_ProjectName)\$(_ProjectName).msbuildproj') ">..\$(_ProjectName)\$(_ProjectName).msbuildproj + <_TargetFramework>%(TestTarget.TargetFramework) + + + + + + TargetFramework=$(_TargetFramework) + $(_ProjectName)\$(_TargetFramework) + PreserveNewest + + + + +