Skip to content

Commit

Permalink
Appends timestamp to build version (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kralizek committed Jan 22, 2019
1 parent d20998b commit 697ce5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@ Task("Version")
{
var version = GitVersion();
var packageVersion = version.SemVer;
var buildVersion = $"{version.FullSemVer}+{DateTimeOffset.UtcNow:yyyyMMddHHmmss}";
state.Version = new VersionInfo
{
SemVer = version.SemVer,
FullSemVer = version.FullSemVer
PackageVersion = packageVersion,
BuildVersion = buildVersion
};
Information($"Package version: {version.SemVer}");
Information($"Build version: {version.FullSemVer}");
Information($"Package version: {state.Version.PackageVersion}");
Information($"Build version: {state.Version.BuildVersion}");
if (BuildSystem.IsRunningOnAppVeyor)
{
AppVeyor.UpdateBuildVersion(state.Version.FullSemVer);
AppVeyor.UpdateBuildVersion(state.Version.BuildVersion);
}
});

Expand Down Expand Up @@ -178,7 +182,7 @@ Task("Pack")
NoRestore = true,
OutputDirectory = state.Paths.OutputFolder,
IncludeSymbols = true,
ArgumentCustomization = args => args.Append($"-p:SymbolPackageFormat=snupkg -p:Version={state.Version.SemVer}")
ArgumentCustomization = args => args.Append($"-p:SymbolPackageFormat=snupkg -p:Version={state.Version.PackageVersion}")
};
DotNetCorePack(state.Paths.SolutionFile.ToString(), settings);
Expand Down
4 changes: 2 additions & 2 deletions build/types.cake
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class BuildPaths

public class VersionInfo
{
public string SemVer { get; set; }
public string PackageVersion { get; set; }

public string FullSemVer { get; set; }
public string BuildVersion {get; set; }
}

[Flags]
Expand Down

0 comments on commit 697ce5e

Please sign in to comment.