mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Fix docker builds wrongly announced as custom
This commit is contained in:
@@ -41,7 +41,7 @@ namespace ArchiSteamFarm {
|
|||||||
private static FileSystemWatcher FileSystemWatcher;
|
private static FileSystemWatcher FileSystemWatcher;
|
||||||
|
|
||||||
internal static async Task<Version> CheckAndUpdateProgram(bool updateOverride = false) {
|
internal static async Task<Version> CheckAndUpdateProgram(bool updateOverride = false) {
|
||||||
if (SharedInfo.IsCustomBuild || (Program.GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.None)) {
|
if (!SharedInfo.BuildInfo.CanUpdate || (Program.GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.None)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string targetFile = SharedInfo.ASF + "-" + SharedInfo.Variant + ".zip";
|
string targetFile = SharedInfo.ASF + "-" + SharedInfo.BuildInfo.Variant + ".zip";
|
||||||
GitHub.ReleaseResponse.Asset binaryAsset = releaseResponse.Assets.FirstOrDefault(asset => asset.Name.Equals(targetFile, StringComparison.OrdinalIgnoreCase));
|
GitHub.ReleaseResponse.Asset binaryAsset = releaseResponse.Assets.FirstOrDefault(asset => asset.Name.Equals(targetFile, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
if (binaryAsset == null) {
|
if (binaryAsset == null) {
|
||||||
@@ -168,7 +168,7 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsUnixVariant(SharedInfo.Variant)) {
|
if (OS.IsUnix) {
|
||||||
string executable = Path.Combine(targetDirectory, SharedInfo.AssemblyName);
|
string executable = Path.Combine(targetDirectory, SharedInfo.AssemblyName);
|
||||||
if (File.Exists(executable)) {
|
if (File.Exists(executable)) {
|
||||||
OS.UnixSetFileAccessExecutable(executable);
|
OS.UnixSetFileAccessExecutable(executable);
|
||||||
@@ -212,22 +212,6 @@ namespace ArchiSteamFarm {
|
|||||||
FileSystemWatcher.EnableRaisingEvents = true;
|
FileSystemWatcher.EnableRaisingEvents = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsUnixVariant(string variant) {
|
|
||||||
if (string.IsNullOrEmpty(variant)) {
|
|
||||||
ArchiLogger.LogNullError(nameof(variant));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (variant) {
|
|
||||||
case "linux-arm":
|
|
||||||
case "linux-x64":
|
|
||||||
case "osx-x64":
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsValidBotName(string botName) {
|
private static bool IsValidBotName(string botName) {
|
||||||
if (string.IsNullOrEmpty(botName)) {
|
if (string.IsNullOrEmpty(botName)) {
|
||||||
ArchiLogger.LogNullError(nameof(botName));
|
ArchiLogger.LogNullError(nameof(botName));
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using ArchiSteamFarm.Localization;
|
|||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class OS {
|
internal static class OS {
|
||||||
|
internal static bool IsUnix => RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||||
|
|
||||||
internal static void Init(bool systemRequired) {
|
internal static void Init(bool systemRequired) {
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||||
DisableQuickEditMode();
|
DisableQuickEditMode();
|
||||||
|
|||||||
@@ -20,24 +20,11 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class SharedInfo {
|
internal static class SharedInfo {
|
||||||
#if ASF_VARIANT_GENERIC
|
|
||||||
internal const string Variant = "generic";
|
|
||||||
#elif ASF_VARIANT_LINUX_ARM
|
|
||||||
internal const string Variant = "linux-arm";
|
|
||||||
#elif ASF_VARIANT_LINUX_X64
|
|
||||||
internal const string Variant = "linux-x64";
|
|
||||||
#elif ASF_VARIANT_OSX_X64
|
|
||||||
internal const string Variant = "osx-x64";
|
|
||||||
#elif ASF_VARIANT_WIN_X64
|
|
||||||
internal const string Variant = "win-x64";
|
|
||||||
#else
|
|
||||||
internal const string Variant = SourceVariant;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
internal const ulong ArchiSteamID = 76561198006963719;
|
internal const ulong ArchiSteamID = 76561198006963719;
|
||||||
internal const string ASF = nameof(ASF);
|
internal const string ASF = nameof(ASF);
|
||||||
internal const ulong ASFGroupSteamID = 103582791440160998;
|
internal const ulong ASFGroupSteamID = 103582791440160998;
|
||||||
@@ -61,11 +48,38 @@ namespace ArchiSteamFarm {
|
|||||||
internal const string UpdateDirectory = "_old";
|
internal const string UpdateDirectory = "_old";
|
||||||
internal const string WebsiteDirectory = "www";
|
internal const string WebsiteDirectory = "www";
|
||||||
|
|
||||||
private const string SourceVariant = "source";
|
|
||||||
|
|
||||||
internal static bool IsCustomBuild => Variant == SourceVariant;
|
|
||||||
internal static Guid ModuleVersion => Assembly.GetEntryAssembly().ManifestModule.ModuleVersionId;
|
internal static Guid ModuleVersion => Assembly.GetEntryAssembly().ManifestModule.ModuleVersionId;
|
||||||
internal static string PublicIdentifier => AssemblyName + (IsCustomBuild ? "-custom" : "");
|
internal static string PublicIdentifier => AssemblyName + (BuildInfo.IsCustomBuild ? "-custom" : "");
|
||||||
internal static Version Version => Assembly.GetEntryAssembly().GetName().Version;
|
internal static Version Version => Assembly.GetEntryAssembly().GetName().Version;
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "ConvertToConstant.Global")]
|
||||||
|
internal static class BuildInfo {
|
||||||
|
#if ASF_VARIANT_DOCKER
|
||||||
|
internal static readonly bool CanUpdate = false;
|
||||||
|
internal static readonly string Variant = "docker";
|
||||||
|
#elif ASF_VARIANT_GENERIC
|
||||||
|
internal static readonly bool CanUpdate = true;
|
||||||
|
internal static readonly string Variant = "generic";
|
||||||
|
#elif ASF_VARIANT_LINUX_ARM
|
||||||
|
internal static readonly bool CanUpdate = true;
|
||||||
|
internal static readonly string Variant = "linux-arm";
|
||||||
|
#elif ASF_VARIANT_LINUX_X64
|
||||||
|
internal static readonly bool CanUpdate = true;
|
||||||
|
internal static readonly string Variant = "linux-x64";
|
||||||
|
#elif ASF_VARIANT_OSX_X64
|
||||||
|
internal static readonly CanUpdate = true;
|
||||||
|
internal static readonly string Variant = "osx-x64";
|
||||||
|
#elif ASF_VARIANT_WIN_X64
|
||||||
|
internal static readonly bool CanUpdate = true;
|
||||||
|
internal static readonly string Variant = "win-x64";
|
||||||
|
#else
|
||||||
|
internal static readonly bool CanUpdate = false;
|
||||||
|
internal static readonly string Variant = SourceVariant;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private const string SourceVariant = "source";
|
||||||
|
|
||||||
|
internal static bool IsCustomBuild => Variant == SourceVariant;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ FROM microsoft/dotnet:2.0-sdk AS build-env
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN dotnet --info && \
|
RUN dotnet --info && \
|
||||||
dotnet publish ArchiSteamFarm -c Release -o out /nologo && \
|
dotnet publish ArchiSteamFarm -c Release -o out /nologo /p:ASFVariant=docker && \
|
||||||
cp "ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh" "ArchiSteamFarm/out/ArchiSteamFarm.sh"
|
cp "ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh" "ArchiSteamFarm/out/ArchiSteamFarm.sh"
|
||||||
|
|
||||||
FROM microsoft/dotnet:2.0-runtime-stretch-arm32v7
|
FROM microsoft/dotnet:2.0-runtime-stretch-arm32v7
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ FROM microsoft/dotnet:2.0-sdk AS build-env
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN dotnet --info && \
|
RUN dotnet --info && \
|
||||||
dotnet publish ArchiSteamFarm -c Release -o out /nologo && \
|
dotnet publish ArchiSteamFarm -c Release -o out /nologo /p:ASFVariant=docker && \
|
||||||
cp "ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh" "ArchiSteamFarm/out/ArchiSteamFarm.sh"
|
cp "ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh" "ArchiSteamFarm/out/ArchiSteamFarm.sh"
|
||||||
|
|
||||||
FROM microsoft/dotnet:2.0-runtime
|
FROM microsoft/dotnet:2.0-runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user