Add .DirIcon to AppImages and lint AppImage on cross compile

This commit is contained in:
Caelan Sayler
2024-12-01 19:31:21 +00:00
committed by Caelan
parent e1f4c13d5f
commit 155fd9a4e5
2 changed files with 15 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ public class LinuxPackCommandRunner : PackageBuilder<LinuxPackOptions>
var icon = Options.Icon ?? HelperFile.GetDefaultAppIcon(RuntimeOs.Linux);
var iconFilename = Options.PackId + Path.GetExtension(icon);
File.Copy(icon, Path.Combine(dir.FullName, iconFilename), true);
File.Copy(icon, Path.Combine(dir.FullName, ".DirIcon"), true);
var categories = String.IsNullOrWhiteSpace(Options.Categories)
? "Utility"

View File

@@ -44,7 +44,7 @@ public class CrossCompile
[InlineData("from-win-targets-linux")]
[InlineData("from-linux-targets-linux")]
[InlineData("from-osx-targets-linux")]
public void RunCrossAppLinux(string artifactId)
public async Task RunCrossAppLinux(string artifactId)
{
using var logger = _output.BuildLoggerFor<CrossCompile>();
Skip.If(
@@ -61,6 +61,19 @@ public class CrossCompile
var output = Exe.InvokeAndThrowIfNonZero(artifactPath, new[] { "test" }, null);
logger.LogInformation(output);
Assert.EndsWith(artifactId, output.Trim());
var appImageLintPath = PathHelper.GetTestRootPath("appimagelint.AppImage");
if (!File.Exists(appImageLintPath)) {
var downloader = HttpUtil.CreateDefaultDownloader();
await downloader.DownloadFile(
"https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage",
appImageLintPath,
_ => { });
Chmod.ChmodFileAsExecutable(appImageLintPath);
}
var lintOutput = Exe.InvokeAndThrowIfNonZero(appImageLintPath, new[] { artifactPath }, null);
logger.LogInformation(lintOutput);
}
[SkippableTheory]