refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,154 @@
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
|
||||
namespace Chronos.Core.Export;
|
||||
|
||||
/// <summary>Values of the export name tokens.</summary>
|
||||
public sealed record ExportNameContext
|
||||
{
|
||||
/// <summary>Shoot date of the sequence (first capture), or the render date when unknown.</summary>
|
||||
public required DateTime Date { get; init; }
|
||||
|
||||
public string? Title { get; init; }
|
||||
|
||||
/// <summary>Display name of the preset in the user's language ("Custom" for custom values).</summary>
|
||||
public required string PresetName { get; init; }
|
||||
|
||||
public int Width { get; init; }
|
||||
public int Height { get; init; }
|
||||
public Rational FrameRate { get; init; } = new(30, 1);
|
||||
public required VideoCodec Codec { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>An expanded export name and any template problems.</summary>
|
||||
public sealed record ExportName(string Name, IReadOnlyList<TemplateError> Errors)
|
||||
{
|
||||
public bool IsValid => Errors.Count == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Output names from <see cref="Project.ExportSettings.NameTemplate"/> (BRIEF §11.5). Tokens: <c>{date}</c> (optionally
|
||||
/// <c>{date:yyyyMMdd}</c>), <c>{title}</c>, <c>{preset}</c>, <c>{width}</c>, <c>{height}</c>, <c>{fps}</c>, <c>{codec}</c>;
|
||||
/// <c>{{</c>/<c>}}</c> are literal braces. The result is sanitised like <see cref="PathTemplate"/>; an existing file or
|
||||
/// folder gets a " (2)", " (3)"… suffix.
|
||||
/// </summary>
|
||||
public static class ExportNaming
|
||||
{
|
||||
public static IReadOnlyList<string> Tokens { get; } = ["date", "title", "preset", "width", "height", "fps", "codec"];
|
||||
|
||||
/// <summary>Name used when a template expands to nothing.</summary>
|
||||
public const string FallbackName = "Render";
|
||||
|
||||
/// <summary>Short, file-name safe codec label ("H.264", "HEVC", "PNG"…).</summary>
|
||||
public static string CodecLabel(VideoCodec codec) => codec switch
|
||||
{
|
||||
VideoCodec.H264 => "H.264",
|
||||
VideoCodec.Hevc => "HEVC",
|
||||
VideoCodec.Av1 => "AV1",
|
||||
VideoCodec.Mjpeg => "MJPEG",
|
||||
VideoCodec.JpegSequence => "JPEG",
|
||||
VideoCodec.PngSequence => "PNG",
|
||||
VideoCodec.Tiff16Sequence => "TIFF",
|
||||
VideoCodec.LinearDngSequence => "DNG",
|
||||
VideoCodec.Gif => "GIF",
|
||||
VideoCodec.Apng => "APNG",
|
||||
_ => codec.ToString(),
|
||||
};
|
||||
|
||||
/// <summary>Expands <paramref name="template"/> into a sanitised name without extension.</summary>
|
||||
public static ExportName Expand(string template, ExportNameContext context)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(template);
|
||||
ArgumentNullException.ThrowIfNull(context);
|
||||
var errors = new List<TemplateError>();
|
||||
var sb = new StringBuilder();
|
||||
for (var i = 0; i < template.Length; i++)
|
||||
{
|
||||
var c = template[i];
|
||||
if ((c == '{' || c == '}') && i + 1 < template.Length && template[i + 1] == c)
|
||||
{
|
||||
sb.Append(c);
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (c == '}')
|
||||
{
|
||||
errors.Add(new TemplateError(i, "UnopenedBrace", null));
|
||||
continue;
|
||||
}
|
||||
if (c != '{')
|
||||
{
|
||||
sb.Append(c);
|
||||
continue;
|
||||
}
|
||||
var close = template.IndexOf('}', i + 1);
|
||||
if (close < 0)
|
||||
{
|
||||
errors.Add(new TemplateError(i, "UnclosedBrace", null));
|
||||
sb.Append(template, i, template.Length - i);
|
||||
break;
|
||||
}
|
||||
var body = template[(i + 1)..close];
|
||||
var colon = body.IndexOf(':', StringComparison.Ordinal);
|
||||
var name = (colon < 0 ? body : body[..colon]).Trim().ToLowerInvariant();
|
||||
var format = colon < 0 ? null : body[(colon + 1)..];
|
||||
if (Value(name, format, context) is { } value) sb.Append(value.Replace('/', '-').Replace('\\', '-'));
|
||||
else errors.Add(new TemplateError(i, name.Length == 0 ? "EmptyToken" : "UnknownToken", name));
|
||||
i = close;
|
||||
}
|
||||
var result = PathTemplate.SanitizeSegment(sb.ToString());
|
||||
return new ExportName(result.Length == 0 ? FallbackName : result, errors);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Full output path inside <paramref name="folder"/>: the expanded name plus the codec's extension, or the bare name
|
||||
/// for image sequences (a folder), made unique against existing files and folders and the paths <paramref name="taken"/>
|
||||
/// says are being written.
|
||||
/// </summary>
|
||||
public static string OutputPath(string folder, string template, ExportNameContext context, Func<string, bool>? taken = null)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(folder);
|
||||
var name = Expand(template, context).Name;
|
||||
var extension = VideoCodecInfo.DefaultContainer(context.Codec) == ContainerFormat.ImageSequence ? string.Empty : VideoCodecInfo.FileExtension(context.Codec);
|
||||
return Unique(folder, name, extension, taken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Output path of a project's export: <see cref="ExportSettings.Folder"/> or, when unset, the sequence's exports folder,
|
||||
/// named by <see cref="ExportSettings.NameTemplate"/>.
|
||||
/// </summary>
|
||||
public static string OutputPath(ExportSettings settings, string sequenceExportsFolder, ExportNameContext context, Func<string, bool>? taken = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(settings);
|
||||
return OutputPath(string.IsNullOrWhiteSpace(settings.Folder) ? sequenceExportsFolder : settings.Folder, settings.NameTemplate, context, taken);
|
||||
}
|
||||
|
||||
/// <summary>"name.ext", or "name (2).ext", "name (3).ext"… when a file or folder of that name exists or is <paramref name="taken"/>.</summary>
|
||||
public static string Unique(string folder, string name, string extension, Func<string, bool>? taken = null)
|
||||
{
|
||||
for (var n = 1; ; n++)
|
||||
{
|
||||
var candidate = Path.Combine(folder, (n == 1 ? name : string.Create(CultureInfo.InvariantCulture, $"{name} ({n})")) + extension);
|
||||
if (!File.Exists(candidate) && !Directory.Exists(candidate) && taken?.Invoke(candidate) != true) return candidate;
|
||||
}
|
||||
}
|
||||
|
||||
private static string? Value(string token, string? format, ExportNameContext c)
|
||||
{
|
||||
var inv = CultureInfo.InvariantCulture;
|
||||
return token switch
|
||||
{
|
||||
"date" => c.Date.ToString(format ?? "yyyy-MM-dd", inv),
|
||||
"title" => c.Title ?? string.Empty,
|
||||
"preset" => c.PresetName,
|
||||
"width" => c.Width.ToString(format, inv),
|
||||
"height" => c.Height.ToString(format, inv),
|
||||
"fps" => c.FrameRate.ToString(),
|
||||
"codec" => CodecLabel(c.Codec),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user