Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9a967345b9 | ||
![]() |
98a4be655f | ||
![]() |
76de8f3d0b |
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c $env:BUILD_CONFIGURATION /p:AssemblyVersion=$env:VERSION /p:Version=$env:VERSION
|
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c $env:BUILD_CONFIGURATION /p:AssemblyVersion=$env:VERSION /p:Version=$env:VERSION
|
||||||
- name: Publish
|
- 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
|
- uses: vimtor/action-zip@v1
|
||||||
name: Zip Release
|
name: Zip Release
|
||||||
with:
|
with:
|
||||||
|
@@ -14,7 +14,7 @@ namespace Torch.API.WebAPI
|
|||||||
public class PluginQuery
|
public class PluginQuery
|
||||||
{
|
{
|
||||||
private const string ALL_QUERY = "https://torchapi.com/api/plugins/";
|
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 readonly HttpClient _client;
|
||||||
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
namespace Torch.Plugins;
|
namespace Torch.Plugins;
|
||||||
|
|
||||||
internal static class AssemblyRewriter
|
internal static class AssemblyRewriter
|
||||||
{
|
{
|
||||||
|
private static readonly ILogger Log = LogManager.GetCurrentClassLogger();
|
||||||
private static readonly ZipResolver _zipResolver;
|
private static readonly ZipResolver _zipResolver;
|
||||||
private static readonly DefaultAssemblyResolver _defaultResolver;
|
private static readonly DefaultAssemblyResolver _defaultResolver;
|
||||||
|
|
||||||
@@ -23,12 +26,25 @@ internal static class AssemblyRewriter
|
|||||||
public static Assembly ProcessWeavers(this Stream stream, ZipArchive archive)
|
public static Assembly ProcessWeavers(this Stream stream, ZipArchive archive)
|
||||||
{
|
{
|
||||||
_zipResolver.Archive = archive;
|
_zipResolver.Archive = archive;
|
||||||
|
|
||||||
using var assStream = new MemoryStream();
|
using var assStream = new MemoryStream();
|
||||||
stream.CopyTo(assStream);
|
stream.CopyTo(assStream);
|
||||||
assStream.Position = 0;
|
assStream.Position = 0;
|
||||||
var ass = ProcessInternal(assStream, _zipResolver);
|
|
||||||
_zipResolver.Archive = null;
|
try
|
||||||
return ass;
|
{
|
||||||
|
var ass = ProcessInternal(assStream, _zipResolver);
|
||||||
|
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)
|
public static Assembly ProcessWeavers(this Stream stream, string path)
|
||||||
|
Reference in New Issue
Block a user