Skip to content

Commit

Permalink
AppVeyor specifies package version
Browse files Browse the repository at this point in the history
  • Loading branch information
aidmsu committed Mar 20, 2017
1 parent f61c697 commit 5b12e1b
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@ Task("Clean")
StartProcess("dotnet", "clean -c:" + configuration);
});

Task("SpecifyPackageVersion")
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
version = AppVeyor.Environment.Build.Version;

if (AppVeyor.Environment.Repository.Tag.IsTag)
{
var tagName = AppVeyor.Environment.Repository.Tag.Name;
if(tagName.StartsWith("v"))
{
version = tagName.Substring(1);
}

AppVeyor.UpdateBuildVersion(version);
}
});

Task("Build")
.IsDependentOn("SpecifyPackageVersion")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(()=>
Expand Down Expand Up @@ -49,29 +68,10 @@ Task("Pack")
Zip("./src/Cronos/bin/" + configuration, "build/Cronos-" + version +".zip");
});

Task("AppVeyor")
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
.IsDependentOn("Pack")
.Does(() =>
{
version = AppVeyor.Environment.Build.Version;

if (AppVeyor.Environment.Repository.Tag.IsTag)
{
var tagName = AppVeyor.Environment.Repository.Tag.Name;
if(tagName.StartsWith("v"))
{
version = tagName.Substring(1);
}

AppVeyor.UpdateBuildVersion(version);
}
});

Task("Default")
.IsDependentOn("Pack");

Task("CI")
.IsDependentOn("AppVeyor");
.IsDependentOn("Pack");

RunTarget(target);

0 comments on commit 5b12e1b

Please sign in to comment.