Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/0.31.0'
Browse files Browse the repository at this point in the history
* release/0.31.0:
  (build) Prepare 0.31.0 release * Update GitVersion * Remove unused NuGet sources * Upload artifacts to AppVeyor
  (GH-56) Update to Cake 0.31.0 * fixes #56
  Only update template version on AppVeyor
  • Loading branch information
devlead committed Dec 14, 2018
2 parents 68b0d99 + d94645f commit f1b75c4
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="0.1.0-alpha0078" />
<PackageReference Include="Cake.Frosting" Version="0.30.0" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions build/Context.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Cake.Common.Build;
using Cake.Common.Tools.DotNetCore.MSBuild;
using Cake.Core;
using Cake.Core.IO;
Expand All @@ -24,6 +25,8 @@ public class Context : FrostingContext

public bool AppVeyor { get; set; }

public BuildSystem BuildSystem { get; set; }

public Context(ICakeContext context)
: base(context)
{
Expand Down
3 changes: 2 additions & 1 deletion build/Lifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public override void Setup(Context context)
context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("cake-build/frosting", buildSystem.AppVeyor.Environment.Repository.Name);
context.IsTagged = IsBuildTagged(buildSystem);
context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch);
context.BuildSystem = buildSystem;

// Install tools
context.Information("Installing tools...");
ToolInstaller.Install(context, "GitVersion.CommandLine", "3.6.2");
ToolInstaller.Install(context, "GitVersion.CommandLine", "3.6.5");

// Calculate semantic version.
context.Version = BuildVersion.Calculate(context);
Expand Down
1 change: 1 addition & 0 deletions build/Tasks/AppVeyor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Cake.Frosting;

[Dependency(typeof(AppVeyorArtifacts))]
[Dependency(typeof(PublishMyGet))]
public class AppVeyor : FrostingTask<Context>
{
Expand Down
34 changes: 34 additions & 0 deletions build/Tasks/AppVeyorArtifacts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Cake.Common.Tools.NuGet;
using Cake.Common.Tools.NuGet.Push;
using Cake.Core;
using Cake.Core.IO;
using Cake.Frosting;

[Dependency(typeof(Package))]
public class AppVeyorArtifacts : FrostingTask<Context>
{
public override bool ShouldRun(Context context)
{
return context.AppVeyor;
}

public override void Run(Context context)
{
// Get the file paths.
var root = new DirectoryPath("./src/Cake.Frosting");
var files = new[] {
$"./artifacts/Cake.Frosting.Template.{context.Version.SemVersion}.nupkg",
$"./artifacts/Cake.Frosting.{context.Version.SemVersion}.nupkg",
$"./artifacts/Cake.Frosting.{context.Version.SemVersion}.symbols.nupkg"
};


// Push files
foreach(var file in files)
{
context.BuildSystem.AppVeyor.UploadArtifact(
file
);
}
}
}
13 changes: 8 additions & 5 deletions build/Tasks/PackageTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ public class PackageTemplate : FrostingTask<Context>
{
public override void Run(Context context)
{
context.XmlPoke(
"./template/Build.csproj",
"/Project/ItemGroup/PackageReference[@Include = 'Cake.Frosting']/@Version",
context.Version.SemVersion
);
if (context.AppVeyor)
{
context.XmlPoke(
"./template/Build.csproj",
"/Project/ItemGroup/PackageReference[@Include = 'Cake.Frosting']/@Version",
context.Version.SemVersion
);
}

context.NuGetPack("./template/Cake.Frosting.Template.nuspec", new NuGetPackSettings
{
Expand Down
1 change: 1 addition & 0 deletions build/Tasks/PublishMyGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Cake.Frosting;

[Dependency(typeof(Package))]
[Dependency(typeof(AppVeyorArtifacts))]
public class PublishMyGet : FrostingTask<Context>
{
public override bool ShouldRun(Context context)
Expand Down
3 changes: 0 additions & 3 deletions build/Tasks/Restore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public override void Run(Context context)
{
MSBuildSettings = context.MSBuildSettings,
Sources = new [] {
"https://www.myget.org/F/xunit/api/v3/index.json",
"https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
"https://dotnet.myget.org/F/cli-deps/api/v3/index.json",
"https://api.nuget.org/v3/index.json",
"https://www.myget.org/F/cake/api/v3/index.json"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="Cake.Testing" Version="0.30.0" />
<PackageReference Include="Cake.Testing" Version="0.31.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.Frosting/Cake.Frosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.30.0" />
<PackageReference Include="Cake.Common" Version="0.30.0" />
<PackageReference Include="Cake.Core" Version="0.31.0" />
<PackageReference Include="Cake.Common" Version="0.31.0" />
<None Include="../../LICENSE" Pack="true" PackagePath="$(PackageLicenseFile)"/>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
2 changes: 1 addition & 1 deletion template/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="0.30.0-beta0001" />
<PackageReference Include="Cake.Frosting" Version="0.31.0" />
</ItemGroup>

</Project>

0 comments on commit f1b75c4

Please sign in to comment.