diff --git a/source/Octopus.Tentacle/Octopus.Tentacle.csproj b/source/Octopus.Tentacle/Octopus.Tentacle.csproj index c5a814c15..4ebac15aa 100644 --- a/source/Octopus.Tentacle/Octopus.Tentacle.csproj +++ b/source/Octopus.Tentacle/Octopus.Tentacle.csproj @@ -57,8 +57,9 @@ - + + diff --git a/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs b/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs index fc5ecabc3..f089cda1f 100644 --- a/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs +++ b/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs @@ -29,10 +29,24 @@ public int Install(string packageFile, string directory, ILog log, bool suppress public int Install(Stream packageStream, string directory, ILog log, bool suppressNestedScriptWarning) { - var extracted = PackageExtractor.ExtractPackage(packageStream, - new SuppliedDirectoryPackagePathResolver(directory), - new PackageExtractionContext(NullLogger.Instance) { PackageSaveMode = PackageSaveMode.Files, XmlDocFileSaveMode = XmlDocFileSaveMode.None, CopySatelliteFiles = false }, - CancellationToken.None); + // The 'source' parameter is used for logging/tracking purposes in NuGet's new API. + // It can be null or any string identifier. We use null here as we don't need tracking. + // Signature verification is bypassed by passing null for ClientPolicyContext (3rd param in PackageExtractionContext). + var extracted = PackageExtractor.ExtractPackageAsync( + null, // source - not needed for our use case and can be null because ClientPolicyContext is null. + packageStream, + new SuppliedDirectoryPackagePathResolver(directory), + new PackageExtractionContext( + PackageSaveMode.Files, + XmlDocFileSaveMode.None, + null, // ClientPolicyContext - null bypasses signature verification + NullLogger.Instance) + { + CopySatelliteFiles = false + }, + CancellationToken.None) + .GetAwaiter() + .GetResult(); return extracted.Count(); } diff --git a/source/Octopus.Tentacle/Properties/OctopusTentacle.cs b/source/Octopus.Tentacle/Properties/OctopusTentacle.cs index 2a3a15d08..dfe0605b4 100644 --- a/source/Octopus.Tentacle/Properties/OctopusTentacle.cs +++ b/source/Octopus.Tentacle/Properties/OctopusTentacle.cs @@ -1,8 +1,7 @@ using System.Reflection; -using Octopus.Client.Model; using Octopus.Tentacle.Util; using Octopus.Tentacle.Versioning; -using AssemblyExtensions = Octopus.Tentacle.Versioning.AssemblyExtensions; +using Octopus.Versioning.Semver; namespace Octopus.Tentacle.Properties { @@ -10,8 +9,8 @@ public static class OctopusTentacle { public static readonly Assembly Assembly = typeof (OctopusTentacle).Assembly; public static readonly string InformationalVersion = Assembly.GetInformationalVersion() ?? "0.0.0"; - public static readonly SemanticVersionInfo SemanticVersionInfo = new SemanticVersionInfo(Assembly); - public static readonly SemanticVersion Version = new SemanticVersion(SemanticVersionInfo.NuGetVersion); + public static readonly SemanticVersionInfo SemanticVersionInfo = new(Assembly); + public static readonly SemanticVersion Version = SemanticVersionInfo.SemanticVersion; public static readonly string[] EnvironmentInformation = EnvironmentHelper.SafelyGetEnvironmentInformation(); } } \ No newline at end of file diff --git a/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs b/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs index e7e7124a6..53ceb37c3 100644 --- a/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs +++ b/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs @@ -1,6 +1,7 @@ using System; using System.Reflection; -using NuGet.Versioning; +using Octopus.Versioning; +using Octopus.Versioning.Semver; namespace Octopus.Tentacle.Versioning { @@ -11,7 +12,7 @@ public class SemanticVersionInfo { public SemanticVersionInfo(Assembly assembly) { - SemanticVersion = SemanticVersion.Parse(assembly.GetInformationalVersion() ?? "0.0.0"); + SemanticVersion = SemVerFactory.Parse(assembly.GetInformationalVersion() ?? "0.0.0"); MajorMinorPatch = SemanticVersion.ToString("V", new VersionFormatter()); BranchName = assembly.GetCustomAttribute()!.BranchName; NuGetVersion = assembly.GetCustomAttribute()!.NuGetVersion;