From 6d8be650c75a347120d69ea681b6d260ad7c16b7 Mon Sep 17 00:00:00 2001 From: odrling Date: Sat, 31 Aug 2019 11:28:42 +0200 Subject: [PATCH] [ci] let's see if it works --- appveyor.yml | 1 - build/BuildTasks/GitVersion.cs | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d22f073d8..7cc350620 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,6 @@ install: build_script: - cd %APPVEYOR_BUILD_FOLDER% - - bash.exe "build\version.sh" . - MSBuild.exe Aegisub.sln /target:BuildTasks - MSBuild.exe Aegisub.sln /m /p:Configuration=Release /p:Platform=x64 diff --git a/build/BuildTasks/GitVersion.cs b/build/BuildTasks/GitVersion.cs index ee29227b0..89a9a6793 100644 --- a/build/BuildTasks/GitVersion.cs +++ b/build/BuildTasks/GitVersion.cs @@ -28,9 +28,10 @@ namespace BuildTasks { private const string versionHTemplate = @"#define BUILD_GIT_VERSION_NUMBER {0} #define BUILD_GIT_VERSION_STRING ""{1}"" -#define TAGGED_RELEASE {2} -#define INSTALLER_VERSION ""{3}"" -#define RESOURCE_BASE_VERSION {4} +#define RELEASE_VERSION ""{2}"" +#define TAGGED_RELEASE {3} +#define INSTALLER_VERSION ""{4}"" +#define RESOURCE_BASE_VERSION {5} "; private const string versionXmlTemplate = @" @@ -84,11 +85,25 @@ namespace BuildTasks { string installerVersion = "0.0.0"; string resourceVersion = "0, 0, 0"; string versionStr = null; + var releaseVersion = null; bool taggedRelease = false; using (var repo = new Repository(Root + ".git")) { commits += repo.Commits.TakeWhile(c => !c.Id.Equals(LastSVNCommit)).Count(); foreach (var tag in repo.Tags) { + if (releaseVersion == null) { + releaseVersion = tag; + } else { + var filter = = new CommitFilter() + { + IncludeReachableFrom = tag.Target.Sha, + ExcludeReachableFrom = releaseVersion.Target.Sha + }; + + if (repo.Commits.QueryBy(filter).ToList().size() == 0) + releaseVersion = tag; + } + if (!tag.Target.Id.Equals(repo.Head.Tip.Id)) continue; taggedRelease = true;