mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
versioning
This commit is contained in:
parent
2002ea9d6f
commit
9a3e324265
4 changed files with 19 additions and 6 deletions
|
@ -4,7 +4,7 @@ os: Visual Studio 2015
|
||||||
dotnet_csproj:
|
dotnet_csproj:
|
||||||
patch: true
|
patch: true
|
||||||
file: '**\*.csproj'
|
file: '**\*.csproj'
|
||||||
version: '{version}'
|
version: '{version}-$(APPVEYOR_REPO_BRANCH)'
|
||||||
package_version: '{version}'
|
package_version: '{version}'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
{
|
{
|
||||||
public class ApplicationSettings
|
public class ApplicationSettings
|
||||||
{
|
{
|
||||||
public string Branch { get; set; }
|
|
||||||
public string Version { get; set; }
|
|
||||||
public string OmbiService { get; set; }
|
public string OmbiService { get; set; }
|
||||||
public string FriendlyVersion { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
15
src/Ombi.Helpers/AssemblyHelper.cs
Normal file
15
src/Ombi.Helpers/AssemblyHelper.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Ombi.Helpers
|
||||||
|
{
|
||||||
|
public static class AssemblyHelper
|
||||||
|
{
|
||||||
|
public static string GetRuntimeVersion() =>
|
||||||
|
Assembly.GetEntryAssembly().GetType()
|
||||||
|
.GetTypeInfo()
|
||||||
|
.Assembly
|
||||||
|
.GetCustomAttribute<AssemblyProductAttribute>()
|
||||||
|
.Product;
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,7 +35,8 @@ namespace Ombi.Schedule.Ombi
|
||||||
// IF AutoUpdateEnabled =>
|
// IF AutoUpdateEnabled =>
|
||||||
// ELSE Return;
|
// ELSE Return;
|
||||||
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
var currentBranch = Settings.Branch;
|
//var currentBranch = Settings.Branch;
|
||||||
|
var currentBranch = "BRANCH";
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (currentBranch == "{{BRANCH}}")
|
if (currentBranch == "{{BRANCH}}")
|
||||||
|
@ -45,7 +46,7 @@ namespace Ombi.Schedule.Ombi
|
||||||
#endif
|
#endif
|
||||||
var updates = await OmbiService.GetUpdates(currentBranch);
|
var updates = await OmbiService.GetUpdates(currentBranch);
|
||||||
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
|
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
|
||||||
if (serverVersion != Settings.FriendlyVersion)
|
if (serverVersion != AssemblyHelper.GetRuntimeVersion())
|
||||||
{
|
{
|
||||||
|
|
||||||
// Let's download the correct zip
|
// Let's download the correct zip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue