diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d90d6f..9bee678 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,3 +56,13 @@ jobs: with: name: win-x64_framework-dependent.zip path: _output/artifacts/win-x64_framework-dependent.zip + - name: 'Publish: linux-x64_self-contained.zip' + uses: actions/upload-artifact@v3 + with: + name: linux-x64_self-contained.zip + path: _output/artifacts/linux-x64_self-contained.zip + - name: 'Publish: linux-x64_framework-dependent.zip' + uses: actions/upload-artifact@v3 + with: + name: linux-x64_framework-dependent.zip + path: _output/artifacts/linux-x64_framework-dependent.zip diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 496250f..740f7aa 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -81,6 +81,9 @@ "CreateScoopManifest", "CreateWinGetManifest", "PublishDebug", + "PublishLinux64Aot", + "PublishLinux64FrameworkDependent", + "PublishLinux64SelfContained", "PublishRelease", "PublishWin64Aot", "PublishWin64FrameworkDependent", @@ -104,6 +107,9 @@ "CreateScoopManifest", "CreateWinGetManifest", "PublishDebug", + "PublishLinux64Aot", + "PublishLinux64FrameworkDependent", + "PublishLinux64SelfContained", "PublishRelease", "PublishWin64Aot", "PublishWin64FrameworkDependent", diff --git a/src/01-Build/NukeBuild/Build.cs b/src/01-Build/NukeBuild/Build.cs index f580183..386721a 100644 --- a/src/01-Build/NukeBuild/Build.cs +++ b/src/01-Build/NukeBuild/Build.cs @@ -55,6 +55,12 @@ public sealed class Build : NukeBuild [Solution(GenerateProjects = true, SuppressBuildProjectCheck = true)] private readonly Solution Solution; + private AbsolutePath PathToLinux64AotZip => ArtifactsDirectory / $"linux-x64_aot.zip"; + + private AbsolutePath PathToLinux64FrameworkDependentZip => ArtifactsDirectory / $"linux-x64_framework-dependent.zip"; + + private AbsolutePath PathToLinux64SelfContainedZip => ArtifactsDirectory / $"linux-x64_self-contained.zip"; + private AbsolutePath PathToWin64AotZip => ArtifactsDirectory / $"win-x64_aot.zip"; private AbsolutePath PathToWin64FrameworkDependentZip => ArtifactsDirectory / $"win-x64_framework-dependent.zip"; @@ -96,6 +102,87 @@ public sealed class Build : NukeBuild OutputDirectory.CreateOrCleanDirectory(); }); + /// + /// Linux x64 AOT. + /// + private Target PublishLinux64Aot => _ => _ + .DependsOn(Clean) + .Produces(PathToLinux64AotZip) + .Executes(() => + { + var staging = StagingDirectory / "linux-x64_aot"; + + DotNetPublish(_ => _ + .SetAssemblyVersion(AssemblyVersion) + .SetInformationalVersion(InformationalVersion) + .SetConfiguration(Configuration) + .SetProject(Solution._0_Host.Wtq_Host_Linux) + .SetOutput(staging) + .SetProperty("PublishAot", true) + .SetProperty("InvariantGlobalization", true) + .SetRuntime("linux-x64")); + + staging.ZipTo( + PathToLinux64AotZip, + filter: x => x.HasExtension(".exe", ".jsonc"), + compressionLevel: CompressionLevel.SmallestSize, + fileMode: System.IO.FileMode.CreateNew); + }); + + /// + /// Linux x64 framework dependent. + /// + private Target PublishLinux64FrameworkDependent => _ => _ + .DependsOn(Clean) + .Produces(PathToLinux64FrameworkDependentZip) + .Executes(() => + { + var st = StagingDirectory / "linux-x64_framework-dependent"; + + DotNetPublish(_ => _ + .SetAssemblyVersion(AssemblyVersion) + .SetInformationalVersion(InformationalVersion) + .SetConfiguration(Configuration) + .SetProject(Solution._0_Host.Wtq_Host_Linux) + .SetOutput(st) + .SetPublishSingleFile(true) + .SetRuntime("linux-x64") + .SetSelfContained(false)); + + st.ZipTo( + PathToLinux64FrameworkDependentZip, + filter: x => x.HasExtension(".exe", ".jsonc"), + compressionLevel: CompressionLevel.SmallestSize, + fileMode: System.IO.FileMode.CreateNew); + }); + + /// + /// Windows x64 self contained. + /// + private Target PublishLinux64SelfContained => _ => _ + .DependsOn(Clean) + .Produces(PathToLinux64SelfContainedZip) + .Executes(() => + { + var staging = StagingDirectory / "linux-x64_self-contained"; + + DotNetPublish(_ => _ + .SetAssemblyVersion(AssemblyVersion) + .SetInformationalVersion(InformationalVersion) + .SetConfiguration(Configuration) + .SetProject(Solution._0_Host.Wtq_Host_Linux) + .SetOutput(staging) + .SetPublishSingleFile(true) + .SetRuntime("linux-x64") + .SetSelfContained(true)); + + staging.ZipTo( + PathToLinux64SelfContainedZip, + filter: x => x.HasExtension(".exe", ".jsonc"), + compressionLevel: CompressionLevel.SmallestSize, + fileMode: System.IO.FileMode.CreateNew); + }); + /// /// Windows x64 AOT. /// @@ -288,6 +375,8 @@ await GitHubTasks private Target PublishDebug => _ => _ .DependsOn(Clean) + .DependsOn(PublishLinux64FrameworkDependent) + .DependsOn(PublishLinux64SelfContained) .DependsOn(PublishWin64FrameworkDependent) .DependsOn(PublishWin64SelfContained) .Triggers(CreateScoopManifest) @@ -297,6 +386,8 @@ await GitHubTasks [SuppressMessage("Major Code Smell", "S1144:Unused private types or members should be removed", Justification = "MvdO: Invoked manually.")] private Target PublishRelease => _ => _ .DependsOn(Clean) + .DependsOn(PublishLinux64FrameworkDependent) + .DependsOn(PublishLinux64SelfContained) .DependsOn(PublishWin64FrameworkDependent) .DependsOn(PublishWin64SelfContained) .Triggers(CreateScoopManifest) diff --git a/src/20-Services/Wtq.Services.KWin.UnitTest/Wtq.Services.KWin.UnitTest.csproj b/src/20-Services/Wtq.Services.KWin.UnitTest/Wtq.Services.KWin.UnitTest.csproj new file mode 100644 index 0000000..6cbc44f --- /dev/null +++ b/src/20-Services/Wtq.Services.KWin.UnitTest/Wtq.Services.KWin.UnitTest.csproj @@ -0,0 +1,12 @@ + + + Wtq.Services.KWin.UnitTest + Wtq.Services.KWin.UnitTest + + net8.0 + + + + + + \ No newline at end of file diff --git a/src/20-Services/Wtq.Services.KWin/Wtq.Services.KWin.csproj b/src/20-Services/Wtq.Services.KWin/Wtq.Services.KWin.csproj new file mode 100644 index 0000000..cf44b35 --- /dev/null +++ b/src/20-Services/Wtq.Services.KWin/Wtq.Services.KWin.csproj @@ -0,0 +1,12 @@ + + + Wtq.Services.KWin + Wtq.Services.KWin + + net8.0 + + + + + + \ No newline at end of file diff --git a/src/30-Host/Wtq.Host.Linux/GlobalUsings.cs b/src/30-Host/Wtq.Host.Linux/GlobalUsings.cs new file mode 100644 index 0000000..b952dd8 --- /dev/null +++ b/src/30-Host/Wtq.Host.Linux/GlobalUsings.cs @@ -0,0 +1,4 @@ +global using Ardalis.GuardClauses; +global using System; +global using System.IO; +global using System.Threading.Tasks; \ No newline at end of file diff --git a/src/30-Host/Wtq.Host.Linux/Program.cs b/src/30-Host/Wtq.Host.Linux/Program.cs new file mode 100644 index 0000000..2dea21b --- /dev/null +++ b/src/30-Host/Wtq.Host.Linux/Program.cs @@ -0,0 +1,9 @@ +namespace Wtq.Host.Linux; + +public static class Program +{ + public static async Task Main(string[] args) + { + Utils.Log.Configure(); + } +} \ No newline at end of file diff --git a/src/30-Host/Wtq.Host.Linux/Wtq.Host.Linux.csproj b/src/30-Host/Wtq.Host.Linux/Wtq.Host.Linux.csproj new file mode 100644 index 0000000..6685fee --- /dev/null +++ b/src/30-Host/Wtq.Host.Linux/Wtq.Host.Linux.csproj @@ -0,0 +1,28 @@ + + + wtq + Wtq.Host.Linux + + net8.0 + Exe + + true + + + + + Always + + + + + + Always + + + + + + + + diff --git a/src/Wtq.sln b/src/Wtq.sln index 7915690..1c67552 100644 --- a/src/Wtq.sln +++ b/src/Wtq.sln @@ -38,6 +38,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01-Build", "01-Build", "{39 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NukeBuild", "01-Build\NukeBuild\NukeBuild.csproj", "{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Host.Linux", "30-Host\Wtq.Host.Linux\Wtq.Host.Linux.csproj", "{8C172C6A-9D45-4307-9043-9CA89B4501A6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Services.KWin", "20-Services\Wtq.Services.KWin\Wtq.Services.KWin.csproj", "{EA8DF436-748C-4A33-8FED-8546B77F65E2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Services.KWin.UnitTest", "20-Services\Wtq.Services.KWin.UnitTest\Wtq.Services.KWin.UnitTest.csproj", "{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,6 +70,18 @@ Global {F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Release|Any CPU.Build.0 = Release|Any CPU + {8C172C6A-9D45-4307-9043-9CA89B4501A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C172C6A-9D45-4307-9043-9CA89B4501A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C172C6A-9D45-4307-9043-9CA89B4501A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C172C6A-9D45-4307-9043-9CA89B4501A6}.Release|Any CPU.Build.0 = Release|Any CPU + {EA8DF436-748C-4A33-8FED-8546B77F65E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA8DF436-748C-4A33-8FED-8546B77F65E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA8DF436-748C-4A33-8FED-8546B77F65E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA8DF436-748C-4A33-8FED-8546B77F65E2}.Release|Any CPU.Build.0 = Release|Any CPU + {36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -74,6 +92,9 @@ Global {A806FD73-3CF4-43AF-A9EF-C6258465DB17} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D} {565A845F-3999-4BBD-9D7D-85A4165E30DD} = {F414F7B7-3276-46DE-B47E-9DA69D56736F} {F7AFBA04-0770-460B-9FE4-DF120FAAF2EC} = {391579FD-F1D3-4DCB-AC66-AEB9BA845C0D} + {8C172C6A-9D45-4307-9043-9CA89B4501A6} = {F414F7B7-3276-46DE-B47E-9DA69D56736F} + {EA8DF436-748C-4A33-8FED-8546B77F65E2} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D} + {36162B19-1E6F-4DC8-BF04-B0939BC21B8C} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {65349C7B-F6B3-49A8-9935-4ABF9B6D3D70}