feat(release): add reproducible signed artifacts (#19)
quality-gate / quality (push) Failing after 1m50s
quality-gate / container (push) Has been skipped

This commit is contained in:
KyuubiYoru
2026-07-16 17:48:21 +02:00
parent 07004cd75f
commit cc5793f935
52 changed files with 2568 additions and 73 deletions
@@ -0,0 +1,41 @@
using System.Reflection;
using FinalFactory.Rendezvous.Contracts;
namespace FinalFactory.Rendezvous.Server.Operations;
internal static class ReleaseCompatibility
{
private static readonly Assembly ServerAssembly = typeof(ReleaseCompatibility).Assembly;
internal static string MinimumClientVersion => Metadata("RendezvousMinimumClientVersion");
internal static int MaximumClientMajorVersion => MetadataInteger("RendezvousMaximumClientMajorVersion");
internal static int UdpContractVersion => MetadataInteger("RendezvousUdpContractVersion");
internal static int ConnectionTicketFormatVersion => MetadataInteger("RendezvousConnectionTicketFormatVersion");
internal static int LiteNetLibMajorVersion => MetadataInteger("RendezvousLiteNetLibMajorVersion");
internal static OperatorCompatibilityResponse CreateResponse() => new()
{
ServerVersion = ServerAssembly
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
.InformationalVersion.Split('+', 2)[0]
?? ServerAssembly.GetName().Version?.ToString(3)
?? "unknown",
MinimumClientVersion = MinimumClientVersion,
MaximumClientMajorVersion = MaximumClientMajorVersion,
HttpContractVersions = [ContractLimits.ContractVersion],
UdpContractVersions = [UdpContractVersion],
ConnectionTicketFormatVersions = [ConnectionTicketFormatVersion],
LiteNetLibMajorVersion = LiteNetLibMajorVersion,
GameplayProtocolCompatibility = "exact-per-tenant",
};
private static string Metadata(string key) => ServerAssembly
.GetCustomAttributes<AssemblyMetadataAttribute>()
.Single(attribute => string.Equals(attribute.Key, key, StringComparison.Ordinal))
.Value
?? throw new InvalidOperationException($"Assembly metadata {key} has no value.");
private static int MetadataInteger(string key) => int.Parse(
Metadata(key),
System.Globalization.CultureInfo.InvariantCulture);
}