diff --git a/.github/workflows/Cogito.Components.yml b/.github/workflows/Cogito.Components.yml new file mode 100644 index 0000000..202e8c5 --- /dev/null +++ b/.github/workflows/Cogito.Components.yml @@ -0,0 +1,133 @@ +name: Cogito.Components + +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.Components.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.Components.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 + - name: Package Tests + run: tar czvf tests.tar.gz tests + working-directory: dist + - name: Upload Tests + uses: actions/upload-artifact@v4 + with: + name: tests + path: dist/tests.tar.gz + 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.Components.dist.msbuildproj b/Cogito.Components.dist.msbuildproj new file mode 100644 index 0000000..ce0119a --- /dev/null +++ b/Cogito.Components.dist.msbuildproj @@ -0,0 +1,32 @@ + + + $(DISTDIR) + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'dist')) + $([System.IO.Path]::GetFullPath('$(DistDir)')) + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'Cogito.Components.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.Components.sln b/Cogito.Components.sln index a425bae..33895c1 100644 --- a/Cogito.Components.sln +++ b/Cogito.Components.sln @@ -1,15 +1,30 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29721.120 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 d17.12 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.Components.dist.msbuildproj = Cogito.Components.dist.msbuildproj + .github\workflows\Cogito.Components.yml = .github\workflows\Cogito.Components.yml Directory.Build.props = Directory.Build.props + GitVersion.yml = GitVersion.yml + global.json = global.json + icon.png = icon.png EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cogito.Components", "Cogito.Components\Cogito.Components.csproj", "{ABD359E9-83EF-4EB5-8E6A-CC557D6084DE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cogito.Components", "src\Cogito.Components\Cogito.Components.csproj", "{ABD359E9-83EF-4EB5-8E6A-CC557D6084DE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5D054F56-DDC3-4903-97AF-9219CF5DB90B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dist", "dist", "{89402946-2BFF-4001-9E37-D17FA5145204}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dist-nuget", "src\dist-nuget\dist-nuget.csproj", "{FC7D93CC-8C38-42BB-9086-0D96C9DABE6D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dist-tests", "src\dist-tests\dist-tests.csproj", "{DF0EE9F1-ED13-4C3E-91B8-A97D362AE401}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,10 +36,23 @@ Global {ABD359E9-83EF-4EB5-8E6A-CC557D6084DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {ABD359E9-83EF-4EB5-8E6A-CC557D6084DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {ABD359E9-83EF-4EB5-8E6A-CC557D6084DE}.Release|Any CPU.Build.0 = Release|Any CPU + {FC7D93CC-8C38-42BB-9086-0D96C9DABE6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC7D93CC-8C38-42BB-9086-0D96C9DABE6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC7D93CC-8C38-42BB-9086-0D96C9DABE6D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC7D93CC-8C38-42BB-9086-0D96C9DABE6D}.Release|Any CPU.Build.0 = Release|Any CPU + {DF0EE9F1-ED13-4C3E-91B8-A97D362AE401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF0EE9F1-ED13-4C3E-91B8-A97D362AE401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF0EE9F1-ED13-4C3E-91B8-A97D362AE401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF0EE9F1-ED13-4C3E-91B8-A97D362AE401}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {ABD359E9-83EF-4EB5-8E6A-CC557D6084DE} = {5D054F56-DDC3-4903-97AF-9219CF5DB90B} + {FC7D93CC-8C38-42BB-9086-0D96C9DABE6D} = {89402946-2BFF-4001-9E37-D17FA5145204} + {DF0EE9F1-ED13-4C3E-91B8-A97D362AE401} = {89402946-2BFF-4001-9E37-D17FA5145204} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FF4B3820-4206-4316-82A5-DEA5792C6A71} EndGlobalSection diff --git a/Directory.Build.props b/Directory.Build.props index b58a75b..6d3f49e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,15 +1,39 @@ - Jerome Haltom - Alethic Solutions - https://github.com/alethic/Cogito.Components - git - https://github.com/alethic/Cogito.Components - MIT - icon.png - 8.0 + 12.0 + - + + + + Cogito.Components + @(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.Components.git + git + https://github.com/alethic/Cogito.Components + $(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/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/icon.png b/icon.png index be3b230..9735fda 100644 Binary files a/icon.png and b/icon.png differ diff --git a/Cogito.Components/AssemblyModule.cs b/src/Cogito.Components/AssemblyModule.cs similarity index 100% rename from Cogito.Components/AssemblyModule.cs rename to src/Cogito.Components/AssemblyModule.cs diff --git a/Cogito.Components/Cogito.Components.csproj b/src/Cogito.Components/Cogito.Components.csproj similarity index 91% rename from Cogito.Components/Cogito.Components.csproj rename to src/Cogito.Components/Cogito.Components.csproj index 92ee58b..4bf1d43 100644 --- a/Cogito.Components/Cogito.Components.csproj +++ b/src/Cogito.Components/Cogito.Components.csproj @@ -3,7 +3,6 @@ netstandard2.0 Base of the Alethic Cogito Component Framework. The Cogito Component Framework is a composable set of modular functionality enabled through Autofac assembly module scanning. - true diff --git a/Cogito.Components/IRunnable.cs b/src/Cogito.Components/IRunnable.cs similarity index 100% rename from Cogito.Components/IRunnable.cs rename to src/Cogito.Components/IRunnable.cs diff --git a/Cogito.Components/RunnableHost.cs b/src/Cogito.Components/RunnableHost.cs similarity index 100% rename from Cogito.Components/RunnableHost.cs rename to src/Cogito.Components/RunnableHost.cs diff --git a/Cogito.Components/RunnableHostService.cs b/src/Cogito.Components/RunnableHostService.cs similarity index 100% rename from Cogito.Components/RunnableHostService.cs rename to src/Cogito.Components/RunnableHostService.cs diff --git a/Cogito.Components/SynchronizationService.cs b/src/Cogito.Components/SynchronizationService.cs similarity index 100% rename from Cogito.Components/SynchronizationService.cs rename to src/Cogito.Components/SynchronizationService.cs diff --git a/src/dist-nuget/dist-nuget.csproj b/src/dist-nuget/dist-nuget.csproj new file mode 100644 index 0000000..d32f3b9 --- /dev/null +++ b/src/dist-nuget/dist-nuget.csproj @@ -0,0 +1,14 @@ + + + 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 + + + + +