Skip to content

Commit

Permalink
Incorporate GitVersion for versioning the releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimian committed Aug 7, 2021
1 parent 2c33025 commit d6b3caf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion TotalMixVC.iss
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
; The version needs to be passed explicitly via /DAppVersion=0.1.0 as GitVersion is used to
; determine the release version. Alternatively, the option below may be uncommented if required.
; #define AppVersion "1.0"

; The build configuration needs to be passed explicitly via /DAppBuildConfiguration=Release or
; the option below may be uncommented if required.
; #define AppBuildConfiguration "Release"

#define AppName "TotalMix Volume Control"
#define AppVersion "1.0"
#define AppPublisher "Fotis Gimian"
#define AppRepoURL "https://github.com/fgimian/totalmix-volume-control"
#define AppRepoIssuesURL AppRepoURL + "/issues"
Expand Down
10 changes: 8 additions & 2 deletions build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Cake.Common.Tools.DotNetCore.Build;
using Cake.Common.Tools.DotNetCore.Publish;
using Cake.Common.Tools.DotNetCore.Test;
using Cake.Common.Tools.GitVersion;
using Cake.Common.Tools.InnoSetup;
using Cake.Common.Tools.ReportGenerator;
using Cake.Core;
Expand All @@ -30,6 +31,7 @@ public static int Main(string[] args)
return new CakeHost()
.UseContext<BuildContext>()
.SetToolPath(new DirectoryPath("../").Combine("tools"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.11"))
.InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.11"))
.InstallTool(new Uri("nuget:?package=Tools.InnoSetup&version=6.2.0"))
.Run(args);
Expand Down Expand Up @@ -188,7 +190,10 @@ public override void Run(BuildContext context)
Configuration = context.BuildConfiguration
});

context.Log.Information("Building the Inno Setup installer");
context.Log.Information("Obtaining the application version using GitVersion");
GitVersion version = context.GitVersion();

context.Log.Information($"Building the Inno Setup installer for v{version.FullSemVer}");
context.Log.Information(context.InnoSetupScriptPath);
context.InnoSetup(
scriptFile: context.InnoSetupScriptPath,
Expand All @@ -197,7 +202,8 @@ public override void Run(BuildContext context)
OutputDirectory = context.ProjectRoot + context.Directory("artifacts"),
Defines = new Dictionary<string, string>
{
{ "AppBuildConfiguration", context.BuildConfiguration }
{ "AppVersion", version.FullSemVer },
{ "AppBuildConfiguration", context.BuildConfiguration },
}
});
}
Expand Down

0 comments on commit d6b3caf

Please sign in to comment.