Publish win-arm64 release (#28)

This commit is contained in:
Matt Parker
2025-12-10 23:59:46 +10:00
committed by GitHub
parent 441bc18776
commit ed4c3c21e6
6 changed files with 127 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ builder.Services.AddParallelPipelines(
builder.Services
.AddStep<RestoreAndBuildStep>()
.AddStep<CreateWindowsRelease>()
.AddStep<CreateWindowsArm64Release>()
.AddStep<CreateLinuxRelease>()
.AddStep<CreateMacosRelease>()
.AddStep<CreateGithubRelease>()

View File

@@ -9,6 +9,7 @@ using ParallelPipelines.Host.Helpers;
namespace Deploy.Steps;
[DependsOnStep<CreateWindowsRelease>]
[DependsOnStep<CreateWindowsArm64Release>]
[DependsOnStep<CreateLinuxRelease>]
[DependsOnStep<CreateMacosRelease>]
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<ReleaseAsset> 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;
}
}

View File

@@ -6,7 +6,7 @@ using ParallelPipelines.Host.Helpers;
namespace Deploy.Steps;
[DependsOnStep<RestoreAndBuildStep>]
[DependsOnStep<CreateWindowsRelease>]
[DependsOnStep<CreateWindowsArm64Release>]
public class CreateMacosRelease : IStep
{
public async Task<BufferedCommandResult?[]?> RunStep(CancellationToken cancellationToken)

View File

@@ -0,0 +1,31 @@
using CliWrap.Buffered;
using ParallelPipelines.Application.Attributes;
using ParallelPipelines.Domain.Entities;
using ParallelPipelines.Host.Helpers;
namespace Deploy.Steps;
[DependsOnStep<RestoreAndBuildStep>]
[DependsOnStep<CreateWindowsRelease>]
public class CreateWindowsArm64Release : IStep
{
public async Task<BufferedCommandResult?[]?> 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];
}
}

View File

@@ -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
);

View File

@@ -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