From 9946c80f3f594dac72803a2fde46e52192223173 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 17 Jan 2020 15:47:35 +0000 Subject: [PATCH] Fixed the versioning --- ci-build.yaml | 11 +++++++++++ src/Ombi.Helpers/AssemblyHelper.cs | 6 ++---- src/Ombi.Helpers/Ombi.Helpers.csproj | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ci-build.yaml b/ci-build.yaml index c48feb923..734b8d4fc 100644 --- a/ci-build.yaml +++ b/ci-build.yaml @@ -34,6 +34,17 @@ steps: $response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)" Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response" +- task: DotNetCoreCLI@2 + inputs: + command: 'custom' + custom: 'tool install' + arguments: '-g dotnet-setversion' + +- task: PowerShell@2 + inputs: + targetType: 'inline' + script: 'setversion -r $(gitTag)' + - task: Yarn@3 displayName: 'Install UI Dependancies' inputs: diff --git a/src/Ombi.Helpers/AssemblyHelper.cs b/src/Ombi.Helpers/AssemblyHelper.cs index 055d19dc1..1c9a90c5a 100644 --- a/src/Ombi.Helpers/AssemblyHelper.cs +++ b/src/Ombi.Helpers/AssemblyHelper.cs @@ -6,10 +6,8 @@ namespace Ombi.Helpers { public static string GetRuntimeVersion() { - var version = Assembly.GetEntryAssembly() - .GetCustomAttribute() - .InformationalVersion; - return version.Equals("1.0.0") ? "4.0.0-develop" : version; + ApplicationEnvironment app = PlatformServices.Default.Application; + return app.ApplicationVersion; } } } \ No newline at end of file diff --git a/src/Ombi.Helpers/Ombi.Helpers.csproj b/src/Ombi.Helpers/Ombi.Helpers.csproj index 4e21d94ef..bade3fd90 100644 --- a/src/Ombi.Helpers/Ombi.Helpers.csproj +++ b/src/Ombi.Helpers/Ombi.Helpers.csproj @@ -16,6 +16,7 @@ + \ No newline at end of file