Compare commits

..

3 Commits
1.4.0 ... 1.4.2

Author SHA1 Message Date
zznty
9a967345b9 skip obfuscated assemblies from compatibility fixes 2022-10-10 20:31:59 +07:00
zznty
98a4be655f fix plugins download 2022-10-10 20:31:10 +07:00
zznty
76de8f3d0b fix ci zipping 2022-10-09 20:34:22 +07:00
3 changed files with 22 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ jobs:
- name: Build
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c $env:BUILD_CONFIGURATION /p:AssemblyVersion=$env:VERSION /p:Version=$env:VERSION
- name: Publish
run: dotnet publish Torch.Server/Torch.Server.csproj --no-build -r win-x64 --sc -c $env:BUILD_CONFIGURATION
run: dotnet publish Torch.Server/Torch.Server.csproj --no-build -r win-x64 --sc -c $env:BUILD_CONFIGURATION -o ./publish
- uses: vimtor/action-zip@v1
name: Zip Release
with:

View File

@@ -14,7 +14,7 @@ namespace Torch.API.WebAPI
public class PluginQuery
{
private const string ALL_QUERY = "https://torchapi.com/api/plugins/";
private const string PLUGIN_QUERY = "https://torchapi.com/api/plugins/?guid={0}";
private const string PLUGIN_QUERY = "https://torchapi.com/api/plugins/search/{0}";
private readonly HttpClient _client;
private static readonly Logger Log = LogManager.GetCurrentClassLogger();

View File

@@ -1,14 +1,17 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using Mono.Cecil;
using NLog;
namespace Torch.Plugins;
internal static class AssemblyRewriter
{
private static readonly ILogger Log = LogManager.GetCurrentClassLogger();
private static readonly ZipResolver _zipResolver;
private static readonly DefaultAssemblyResolver _defaultResolver;
@@ -23,13 +26,26 @@ internal static class AssemblyRewriter
public static Assembly ProcessWeavers(this Stream stream, ZipArchive archive)
{
_zipResolver.Archive = archive;
using var assStream = new MemoryStream();
stream.CopyTo(assStream);
assStream.Position = 0;
try
{
var ass = ProcessInternal(assStream, _zipResolver);
_zipResolver.Archive = null;
return ass;
}
catch (Exception e)
{
Log.Error(e, "Unable to process assembly, skipping");
return Assembly.Load(assStream.ToArray());
}
finally
{
_zipResolver.Archive = null;
}
}
public static Assembly ProcessWeavers(this Stream stream, string path)
{