Renamed build-only to compile-only.

More flexible setup for compile-only runs.
This commit is contained in:
Kenneth Skovhede
2025-04-14 22:14:06 +02:00
parent 6c8a1cb490
commit e30fbf5613
3 changed files with 30 additions and 15 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: Compile releases
working-directory: ./ReleaseBuilder
run: dotnet run -- build debug --build-only=true --git-stash-push=false --disable-docker-push=true --keep-builds=true --disable-authenticode=true --disable-signcode=true --disable-notarize-signing=true --disable-gpg-signing=true --disable-s3-upload=true --disable-github-upload=true --disable-update-server-reload=true --disable-discourse-announce=true --disable-clean-source=true --password=test1234 --version=2.0.0.99
run: dotnet run -- build debug --compile-only=true --git-stash-push=false --disable-docker-push=true --keep-builds=true --disable-authenticode=true --disable-signcode=true --disable-notarize-signing=true --disable-gpg-signing=true --disable-s3-upload=true --disable-github-upload=true --disable-update-server-reload=true --disable-discourse-announce=true --disable-clean-source=true --password=test1234 --version=2.0.0.99
# Disabled, as a new test needs to be written for the new UI
# selenium:
@@ -211,6 +211,14 @@ public static partial class Command
}
}
/// <summary>
/// Disables docker builds
/// </summary>
public void DisableDockerBuilds()
{
_dockerBuild = false;
}
/// <summary>
/// Cache value for checking if notarize is enabled
/// </summary>
+21 -14
View File
@@ -191,8 +191,8 @@ public static partial class Command
getDefaultValue: () => false
);
var buildOnlyOption = new Option<bool>(
name: "--build-only",
var compileOnlyOption = new Option<bool>(
name: "--compile-only",
description: "Only build the binaries, do not create packages",
getDefaultValue: () => false
);
@@ -332,7 +332,7 @@ public static partial class Command
buildTargetOption,
solutionFileOption,
keepBuildsOption,
buildOnlyOption,
compileOnlyOption,
disableAuthenticodeOption,
disableCodeSignOption,
passwordOption,
@@ -369,7 +369,7 @@ public static partial class Command
/// <param name="Channel">The release channel</param>
/// <param name="Version">The version override to use</param>
/// <param name="KeepBuilds">If the builds should be kept</param>
/// <param name="BuildOnly">If only the build should be performed</param>
/// <param name="CompileOnly">If only the build should be performed</param>
/// <param name="DisableAuthenticode">If authenticode signing should be disabled</param>
/// <param name="DisableSignCode">If signcode should be disabled</param>
/// <param name="Password">The password to use for the keyfile</param>
@@ -397,7 +397,7 @@ public static partial class Command
ReleaseChannel Channel,
string? Version,
bool KeepBuilds,
bool BuildOnly,
bool CompileOnly,
bool DisableAuthenticode,
bool DisableSignCode,
string Password,
@@ -433,7 +433,7 @@ public static partial class Command
throw new FileNotFoundException($"Solution file not found: {input.SolutionFile.FullName}");
// This could be fixed, so we will throw an exception if the build is not possible
if (buildTargets.Any(x => x.Package == PackageType.MSI) && !configuration.IsMSIBuildPossible())
if (buildTargets.Any(x => x.Package == PackageType.MSI) && !configuration.IsMSIBuildPossible() && !input.CompileOnly)
throw new Exception("WiX toolset not configured, cannot build MSI files");
// This will be fixed in the future, but requires a new http-interface for Synology DSM
@@ -441,7 +441,7 @@ public static partial class Command
throw new Exception("Synology SPK files are currently not supported");
// This will not work, so to make it easier for non-MacOS developers, we will remove the MacOS packages
if (buildTargets.Any(x => x.Package == PackageType.MacPkg || x.Package == PackageType.DMG) && !configuration.IsMacPkgBuildPossible())
if (buildTargets.Any(x => x.Package == PackageType.MacPkg || x.Package == PackageType.DMG) && !configuration.IsMacPkgBuildPossible() && !input.CompileOnly)
{
Console.WriteLine("MacOS packages requested but not running on MacOS, removing from build targets");
buildTargets = buildTargets.Where(x => x.Package != PackageType.MacPkg && x.Package != PackageType.DMG).ToArray();
@@ -532,13 +532,20 @@ public static partial class Command
rtcfg.ToggleGithubUpload(rtcfg.ReleaseInfo.Channel);
rtcfg.ToogleDiscourseAnnounce(rtcfg.ReleaseInfo.Channel);
rtcfg.ToggleUpdateServerReload();
await rtcfg.ToggleDockerBuild();
if (!rtcfg.UseDockerBuild)
if (input.CompileOnly)
{
var unsupportedBuilds = buildTargets.Where(x => x.Package == PackageType.Docker || x.Package == PackageType.Deb || x.Package == PackageType.RPM).ToList();
if (unsupportedBuilds.Any())
throw new Exception($"The following packages cannot be built without Docker: {string.Join(", ", unsupportedBuilds.Select(x => x.PackageTargetString))}");
rtcfg.DisableDockerBuilds();
}
else
{
await rtcfg.ToggleDockerBuild();
if (!rtcfg.UseDockerBuild)
{
var unsupportedBuilds = buildTargets.Where(x => x.Package == PackageType.Docker || x.Package == PackageType.Deb || x.Package == PackageType.RPM).ToList();
if (unsupportedBuilds.Any())
throw new Exception($"The following packages cannot be built without Docker: {string.Join(", ", unsupportedBuilds.Select(x => x.PackageTargetString))}");
}
}
// Prevent the system from going to sleep during the build
@@ -588,7 +595,7 @@ public static partial class Command
await Compile.BuildProjects(baseDir, input.BuildPath.FullName, sourceBuildMap, windowsOnly, buildTargets, releaseInfo, input.KeepBuilds, rtcfg, input.UseHostedBuilds, input.DisableCleanSource, input.AllowAssemblyMismatch);
if (input.BuildOnly)
if (input.CompileOnly)
{
Console.WriteLine("Build completed, skipping package creation ...");
return;