Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Builders/LinuxBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.IO;
using osu.Desktop.Deploy.Uploaders;

Expand All @@ -15,15 +16,26 @@ public class LinuxBuilder : Builder
private readonly string stagingTarget;
private readonly string publishTarget;

public LinuxBuilder(string version)
public LinuxBuilder(string version, string? arch)
: base(version)
{
if (string.IsNullOrEmpty(arch))
{
Console.Write("Build for which architecture? [x64/arm64]: ");
arch = Console.ReadLine() ?? string.Empty;
}

if (arch != "x64" && arch != "arm64")
Logger.Error($"Invalid Architecture: {arch}");

RuntimeIdentifier = $"{os_name}-{arch}";

stagingTarget = Path.Combine(Program.StagingPath, app_dir);
publishTarget = Path.Combine(stagingTarget, "usr", "bin");
}

protected override string TargetFramework => "net8.0";
protected override string RuntimeIdentifier => $"{os_name}-x64";
protected override string RuntimeIdentifier { get; }

public override Uploader CreateUploader()
{
Expand Down
20 changes: 17 additions & 3 deletions Builders/WindowsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,29 @@ public class WindowsBuilder : Builder
{
private const string app_name = "osu!.exe";
private const string os_name = "win";
private const string channel = "win";
private readonly string channel = "win";

public WindowsBuilder(string version)
public WindowsBuilder(string version, string? arch)
: base(version)
{
if (string.IsNullOrEmpty(arch))
{
Console.Write("Build for which architecture? [x64/arm64]: ");
arch = Console.ReadLine() ?? string.Empty;
}

if (arch != "x64" && arch != "arm64")
Logger.Error($"Invalid Architecture: {arch}");

RuntimeIdentifier = $"{os_name}-{arch}";

// Include architecture in channel while x64 keeps using the old convention without it
if (arch != "x64")
this.channel = RuntimeIdentifier;
}

protected override string TargetFramework => "net8.0";
protected override string RuntimeIdentifier => $"{os_name}-x64";
protected override string RuntimeIdentifier { get; }

public override Uploader CreateUploader()
{
Expand Down
4 changes: 2 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ public static void Main(string[] args)
switch (targetPlatform)
{
case RuntimeInfo.Platform.Windows:
builder = new WindowsBuilder(version);
builder = new WindowsBuilder(version, getArg(3));
break;

case RuntimeInfo.Platform.Linux:
builder = new LinuxBuilder(version);
builder = new LinuxBuilder(version, getArg(3));
break;

case RuntimeInfo.Platform.macOS:
Expand Down
13 changes: 12 additions & 1 deletion Uploaders/LinuxVelopackUploader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;

namespace osu.Desktop.Deploy.Uploaders
{
public class LinuxVelopackUploader : VelopackUploader
Expand All @@ -16,7 +18,16 @@ public LinuxVelopackUploader(string applicationName, string operatingSystemName,
public override void PublishBuild(string version)
{
base.PublishBuild(version);
RenameAsset($"{Program.PackageName}-{channel}.AppImage", "osu.AppImage");

if (channel != "linux-x64" && channel != "linux-arm64")
throw new Exception($"Unrecognised channel: {channel}");

// Include architecture in asset name while x64 keeps using the old convention without it
string arch_suffix = "";
if (channel != "linux-x64")
arch_suffix = channel.Substring(5);

RenameAsset($"{Program.PackageName}-{channel}.AppImage", $"osu{arch_suffix}.AppImage");
}
}
}
11 changes: 10 additions & 1 deletion Uploaders/WindowsVelopackUploader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;

namespace osu.Desktop.Deploy.Uploaders
{
public class WindowsVelopackUploader : VelopackUploader
Expand All @@ -18,7 +20,14 @@ public WindowsVelopackUploader(string applicationName, string operatingSystemNam
public override void PublishBuild(string version)
{
base.PublishBuild(version);
RenameAsset($"{Program.PackageName}-{channel}-Setup.exe", "install.exe");

if (channel != "win"/*-x64*/ && channel != "win-arm64")
throw new Exception($"Unrecognised channel: {channel}");

// Include architecture in asset name while x64 keeps using the old convention without it
string arch_suffix = channel.Substring(3);

RenameAsset($"{Program.PackageName}-{channel}-Setup.exe", $"install{arch_suffix}.exe");
}
}
}