diff --git a/iac/Deploy/Program.cs b/iac/Deploy/Program.cs index fbe1597..330ec9b 100644 --- a/iac/Deploy/Program.cs +++ b/iac/Deploy/Program.cs @@ -24,6 +24,7 @@ builder.Services.AddParallelPipelines( builder.Services .AddStep() .AddStep() + .AddStep() .AddStep() .AddStep() .AddStep() diff --git a/iac/Deploy/Steps/CreateGithubRelease.cs b/iac/Deploy/Steps/CreateGithubRelease.cs index 7e6c25c..abc6f68 100644 --- a/iac/Deploy/Steps/CreateGithubRelease.cs +++ b/iac/Deploy/Steps/CreateGithubRelease.cs @@ -9,6 +9,7 @@ using ParallelPipelines.Host.Helpers; namespace Deploy.Steps; [DependsOnStep] +[DependsOnStep] [DependsOnStep] [DependsOnStep] public class CreateGithubRelease(IPipelineContext pipelineContext) : IStep @@ -40,35 +41,26 @@ public class CreateGithubRelease(IPipelineContext pipelineContext) : IStep var repo = "SharpIDE"; var release = await github.Repository.Release.Create(owner, repo, newRelease); - var windowsReleaseZip = await PipelineFileHelper.GitRootDirectory.GetFile("./artifacts/publish-godot/sharpide-win-x64.zip"); - await using var stream = windowsReleaseZip.OpenRead(); - var upload = new ReleaseAssetUpload - { - FileName = $"sharpide-win-x64-{versionString}.zip", - ContentType = "application/octet-stream", - RawData = stream - }; - var asset = await github.Repository.Release.UploadAsset(release, upload, cancellationToken); + var win64Release = await UploadAssetToRelease(github, release, "./artifacts/publish-godot/sharpide-win-x64.zip", $"sharpide-win-x64-{versionString}.zip", cancellationToken); + var winArm64Release = await UploadAssetToRelease(github, release, "./artifacts/publish-godot/sharpide-win-arm64.zip", $"sharpide-win-arm64-{versionString}.zip", cancellationToken); + var linuxRelease = await UploadAssetToRelease(github, release, "./artifacts/publish-godot/sharpide-linux-x64.tar.gz", $"sharpide-linux-x64-{versionString}.tar.gz", cancellationToken); + var macosRelease = await UploadAssetToRelease(github, release, "./artifacts/publish-godot/sharpide-osx-universal.zip", $"sharpide-osx-universal-{versionString}.zip", 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 macosReleaseZip = await PipelineFileHelper.GitRootDirectory.GetFile("./artifacts/publish-godot/sharpide-osx-universal.zip"); - await using var macosStream = macosReleaseZip.OpenRead(); - var macosUpload = new ReleaseAssetUpload - { - FileName = $"sharpide-osx-universal-{versionString}.zip", - ContentType = "application/octet-stream", - RawData = macosStream - }; - var macosAsset = await github.Repository.Release.UploadAsset(release, macosUpload, cancellationToken); return null; } + + private static async Task UploadAssetToRelease(GitHubClient github, Release release, string relativeFilePath, string releaseFileName, CancellationToken cancellationToken) + { + var releaseArchive = await PipelineFileHelper.GitRootDirectory.GetFile(relativeFilePath); + await using var releaseZipStream = releaseArchive.OpenRead(); + + var upload = new ReleaseAssetUpload + { + FileName = releaseFileName, + ContentType = "application/octet-stream", + RawData = releaseZipStream + }; + var asset = await github.Repository.Release.UploadAsset(release, upload, cancellationToken); + return asset; + } } diff --git a/iac/Deploy/Steps/CreateMacosRelease.cs b/iac/Deploy/Steps/CreateMacosRelease.cs index 2227933..842afcc 100644 --- a/iac/Deploy/Steps/CreateMacosRelease.cs +++ b/iac/Deploy/Steps/CreateMacosRelease.cs @@ -6,7 +6,7 @@ using ParallelPipelines.Host.Helpers; namespace Deploy.Steps; [DependsOnStep] -[DependsOnStep] +[DependsOnStep] public class CreateMacosRelease : IStep { public async Task RunStep(CancellationToken cancellationToken) diff --git a/iac/Deploy/Steps/CreateWindowsArm64Release.cs b/iac/Deploy/Steps/CreateWindowsArm64Release.cs new file mode 100644 index 0000000..19738a2 --- /dev/null +++ b/iac/Deploy/Steps/CreateWindowsArm64Release.cs @@ -0,0 +1,31 @@ +using CliWrap.Buffered; +using ParallelPipelines.Application.Attributes; +using ParallelPipelines.Domain.Entities; +using ParallelPipelines.Host.Helpers; + +namespace Deploy.Steps; + +[DependsOnStep] +[DependsOnStep] +public class CreateWindowsArm64Release : IStep +{ + public async Task RunStep(CancellationToken cancellationToken) + { + var godotPublishDirectory = await PipelineFileHelper.GitRootDirectory.GetDirectory("./artifacts/publish-godot"); + godotPublishDirectory.Create(); + var windowsPublishDirectory = await godotPublishDirectory.GetDirectory("./win-arm64"); + windowsPublishDirectory.Create(); + + var godotProjectFile = await PipelineFileHelper.GitRootDirectory.GetFile("./src/SharpIDE.Godot/project.godot"); + + var godotExportResult = await PipelineCliHelper.RunCliCommandAsync( + "godot", + $"--headless --verbose --export-release Windows-arm64 --project {godotProjectFile.GetFullNameUnix()}", + cancellationToken + ); + + var windowsZipFile = await windowsPublishDirectory.ZipDirectoryToFile($"{PipelineFileHelper.GitRootDirectory.FullName}/artifacts/publish-godot/sharpide-win-arm64.zip"); + + return [godotExportResult]; + } +} diff --git a/iac/Deploy/Steps/CreateWindowsRelease.cs b/iac/Deploy/Steps/CreateWindowsRelease.cs index 0f6dd40..3168733 100644 --- a/iac/Deploy/Steps/CreateWindowsRelease.cs +++ b/iac/Deploy/Steps/CreateWindowsRelease.cs @@ -19,7 +19,7 @@ public class CreateWindowsRelease : IStep var godotExportResult = await PipelineCliHelper.RunCliCommandAsync( "godot", - $"--headless --verbose --export-release Windows --project {godotProjectFile.GetFullNameUnix()}", + $"--headless --verbose --export-release Windows-x64 --project {godotProjectFile.GetFullNameUnix()}", cancellationToken ); diff --git a/src/SharpIDE.Godot/export_presets.cfg b/src/SharpIDE.Godot/export_presets.cfg index 6004c41..687b124 100644 --- a/src/SharpIDE.Godot/export_presets.cfg +++ b/src/SharpIDE.Godot/export_presets.cfg @@ -258,7 +258,7 @@ dotnet/embed_build_outputs=false [preset.1] -name="Windows" +name="Windows-x64" platform="Windows Desktop" runnable=true advanced_options=false @@ -267,7 +267,7 @@ custom_features="" export_filter="all_resources" include_filter="version.txt" exclude_filter="" -export_path="../../artifacts/publish-godot/win/SharpIDE.exe" +export_path="../../artifacts/publish-godot/win-x64/SharpIDE.exe" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -372,3 +372,74 @@ rm -rf \"{temp_dir}\"" dotnet/include_scripts_content=false dotnet/include_debug_symbols=true dotnet/embed_build_outputs=false + +[preset.3] + +name="Windows-arm64" +platform="Windows Desktop" +runnable=false +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="version.txt" +exclude_filter="" +export_path="../../artifacts/publish-godot/win-arm64/SharpIDE.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.3.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +shader_baker/enabled=false +binary_format/architecture="arm64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false