Fallback method for missing BYOND linux zips

This commit is contained in:
Jordan Dominion
2023-08-12 19:45:24 -04:00
parent d69c2c7e01
commit 0b9f4c5cf3
2 changed files with 26 additions and 1 deletions
+8
View File
@@ -111,6 +111,14 @@ jobs:
VERSIONS=$(curl https://www.byond.com/download/version.txt)
FULL_VERSION=$(echo "$VERSIONS" | tail -n1)
echo "EDGE version evaluated to $FULL_VERSION"
# Also needs updating in ByondTest.cs
declare -A missing_linux_releases=([515.1612]="515.1611")
if [[ -n "${missing_linux_releases[$FULL_VERSION]}" ]] ; then
echo "$FULL_VERSION does not have a linux zip, falling back to ${missing_linux_releases[$FULL_VERSION]}"
FULL_VERSION=${missing_linux_releases[$FULL_VERSION]}
fi
fi
if [[ ! -f $HOME/byond-zips-cache/linux/$FULL_VERSION.zip ]] ; then
BYOND_MAJOR=${FULL_VERSION%.*}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
@@ -58,7 +59,23 @@ namespace Tgstation.Server.Tests.Live.Instance
using var reader = new StreamReader(stream, Encoding.UTF8, false, -1, true);
var text = await reader.ReadToEndAsync();
var splits = text.Split('\n', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
return edgeVersion = Version.Parse(splits.Last());
var targetVersion = splits.Last();
var missingVersionMap = new PlatformIdentifier().IsWindows
? new Dictionary<string, string>()
{
}
// linux map also needs updating in CI
: new Dictionary<string, string>()
{
{ "515.1612", "515.1611" }
};
if (missingVersionMap.TryGetValue(targetVersion, out var remappedVersion))
targetVersion = remappedVersion;
return edgeVersion = Version.Parse(targetVersion);
}
async Task RunPartOne(CancellationToken cancellationToken)