From 4b2f9d864a7384a72da6ed991dad29f4c7a53865 Mon Sep 17 00:00:00 2001 From: odrling Date: Sat, 31 Aug 2019 12:09:54 +0200 Subject: [PATCH] get the right release version on windows --- appveyor.yml | 2 +- build/BuildTasks/GitVersion.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7cc350620..de17e59a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,7 +79,7 @@ after_build: - cd ..\.. on_success: - - bash.exe ".ci\upload_win_installer.sh" + - IF DEFINED APPVEYOR_REPO_TAG_NAME bash.exe ".ci\upload_win_installer.sh" artifacts: - path: packages\win_installer\output\Aegisub-Japan7-x64.exe diff --git a/build/BuildTasks/GitVersion.cs b/build/BuildTasks/GitVersion.cs index 33003d9bf..6e5b92d1c 100644 --- a/build/BuildTasks/GitVersion.cs +++ b/build/BuildTasks/GitVersion.cs @@ -85,7 +85,7 @@ namespace BuildTasks { string installerVersion = "0.0.0"; string resourceVersion = "0, 0, 0"; string versionStr = null; - var releaseVersion = null; + Tag releaseVersion = null; bool taggedRelease = false; using (var repo = new Repository(Root + ".git")) { commits += repo.Commits.TakeWhile(c => !c.Id.Equals(LastSVNCommit)).Count(); @@ -96,11 +96,11 @@ namespace BuildTasks { } else { var filter = new CommitFilter() { - IncludeReachableFrom = tag.Target.Sha, - ExcludeReachableFrom = releaseVersion.Target.Sha + Since = tag.Target.Sha, + Until = releaseVersion.Target.Sha }; - if (repo.Commits.QueryBy(filter).ToList().Count == 0) + if (repo.Commits.QueryBy(filter).ToList().Count > 0) releaseVersion = tag; } @@ -123,7 +123,7 @@ namespace BuildTasks { } } - WriteIfChanged(versionHPath, versionHTemplate, releaseVersion.Shorten(), commits, versionStr, taggedRelease ? "1" : "0", installerVersion, resourceVersion); + WriteIfChanged(versionHPath, versionHTemplate, commits, versionStr, releaseVersion.Name.TrimStart('v'), taggedRelease ? "1" : "0", installerVersion, resourceVersion); WriteIfChanged(versionXmlPath, versionXmlTemplate, commits, versionStr); return true;