diff --git a/Directory.Packages.props b/Directory.Packages.props index b6e30df..6d8394d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -50,7 +50,7 @@ - + diff --git a/iac/Deploy/Program.cs b/iac/Deploy/Program.cs index 89f9596..fbe1597 100644 --- a/iac/Deploy/Program.cs +++ b/iac/Deploy/Program.cs @@ -24,6 +24,8 @@ builder.Services.AddParallelPipelines( builder.Services .AddStep() .AddStep() + .AddStep() + .AddStep() .AddStep() ; diff --git a/iac/Deploy/Steps/CreateGithubRelease.cs b/iac/Deploy/Steps/CreateGithubRelease.cs index 7133495..1e47641 100644 --- a/iac/Deploy/Steps/CreateGithubRelease.cs +++ b/iac/Deploy/Steps/CreateGithubRelease.cs @@ -9,6 +9,8 @@ using ParallelPipelines.Host.Helpers; namespace Deploy.Steps; [DependsOnStep] +[DependsOnStep] +[DependsOnStep] public class CreateGithubRelease(IPipelineContext pipelineContext) : IStep { public async Task RunStep(CancellationToken cancellationToken) @@ -47,6 +49,26 @@ public class CreateGithubRelease(IPipelineContext pipelineContext) : IStep RawData = stream }; var asset = await github.Repository.Release.UploadAsset(release, upload, cancellationToken); + + var linuxReleaseTarball = await PipelineFileHelper.GitRootDirectory.GetFile("./artifacts/publish-godot/sharpide-linux-x64.tar.gz"); + await using var linuxStream = linuxReleaseTarball.OpenRead(); + var linuxUpload = new ReleaseAssetUpload + { + FileName = $"sharpide-linux-x64-{versionString}.tar.gz", + ContentType = "application/gzip", + RawData = linuxStream + }; + var linuxAsset = await github.Repository.Release.UploadAsset(release, linuxUpload, cancellationToken); + + var macosReleaseDmg = await PipelineFileHelper.GitRootDirectory.GetFile("./artifacts/publish-godot/sharpide-osx-universal.dmg"); + await using var macosStream = macosReleaseDmg.OpenRead(); + var macosUpload = new ReleaseAssetUpload + { + FileName = $"sharpide-osx-universal-{versionString}.dmg", + ContentType = "application/octet-stream", + RawData = macosStream + }; + var macosAsset = await github.Repository.Release.UploadAsset(release, macosUpload, cancellationToken); return null; } } diff --git a/iac/Deploy/Steps/CreateLinuxRelease.cs b/iac/Deploy/Steps/CreateLinuxRelease.cs new file mode 100644 index 0000000..385c4a1 --- /dev/null +++ b/iac/Deploy/Steps/CreateLinuxRelease.cs @@ -0,0 +1,30 @@ +using CliWrap.Buffered; +using ParallelPipelines.Application.Attributes; +using ParallelPipelines.Domain.Entities; +using ParallelPipelines.Host.Helpers; + +namespace Deploy.Steps; + +[DependsOnStep] +public class CreateLinuxRelease : IStep +{ + public async Task RunStep(CancellationToken cancellationToken) + { + var godotPublishDirectory = await PipelineFileHelper.GitRootDirectory.GetDirectory("./artifacts/publish-godot"); + godotPublishDirectory.Create(); + var linuxPublishDirectory = await godotPublishDirectory.GetDirectory("./linux"); + linuxPublishDirectory.Create(); + + var godotProjectFile = await PipelineFileHelper.GitRootDirectory.GetFile("./src/SharpIDE.Godot/project.godot"); + + var godotExportResult = await PipelineCliHelper.RunCliCommandAsync( + "godot", + $"--headless --verbose --export-release Windows --project {godotProjectFile.GetFullNameUnix()}", + cancellationToken + ); + + var linuxTarballFile = await linuxPublishDirectory.TarballDirectoryToFile($"{PipelineFileHelper.GitRootDirectory.FullName}/artifacts/publish-godot/sharpide-linux-x64.tar.gz"); + + return [godotExportResult]; + } +} diff --git a/iac/Deploy/Steps/CreateMacosRelease.cs b/iac/Deploy/Steps/CreateMacosRelease.cs new file mode 100644 index 0000000..1e79fd6 --- /dev/null +++ b/iac/Deploy/Steps/CreateMacosRelease.cs @@ -0,0 +1,31 @@ +using CliWrap.Buffered; +using ParallelPipelines.Application.Attributes; +using ParallelPipelines.Domain.Entities; +using ParallelPipelines.Host.Helpers; + +namespace Deploy.Steps; + +[DependsOnStep] +public class CreateMacosRelease : IStep +{ + public async Task RunStep(CancellationToken cancellationToken) + { + var godotPublishDirectory = await PipelineFileHelper.GitRootDirectory.GetDirectory("./artifacts/publish-godot"); + godotPublishDirectory.Create(); + var macosPublishDirectory = await godotPublishDirectory.GetDirectory("./osx"); + macosPublishDirectory.Create(); + + var godotProjectFile = await PipelineFileHelper.GitRootDirectory.GetFile("./src/SharpIDE.Godot/project.godot"); + + var godotExportResult = await PipelineCliHelper.RunCliCommandAsync( + "godot", + $"--headless --verbose --export-release macOS --project {godotProjectFile.GetFullNameUnix()}", + cancellationToken + ); + + var macosDmgFile = await macosPublishDirectory.GetFile("SharpIDE.dmg"); + macosDmgFile.MoveTo($"{PipelineFileHelper.GitRootDirectory.FullName}/artifacts/publish-godot/sharpide-osx-universal.dmg"); + + return [godotExportResult]; + } +}