Skip to content

Commit

Permalink
Merge branch 'release/0.37.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Feb 1, 2020
2 parents 7a3bc25 + d6a29a9 commit 0497c47
Show file tree
Hide file tree
Showing 49 changed files with 1,781 additions and 238 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Get the sources
uses: actions/checkout@v1

- name: Install .NET Core SDK 3.1.100
- name: Install .NET Core SDK 3.1.101
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.100'
dotnet-version: '3.1.101'

- name: Run Cake script
uses: ecampidoglio/cake-action@v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,7 @@ mono:
- 5.12.0
- 5.20.1

dotnet: 3.1.100
dotnet: 3.1.101

before_install:
- git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags
Expand Down
19 changes: 18 additions & 1 deletion GitReleaseManager.yaml
Expand Up @@ -9,4 +9,21 @@ issue-labels-exclude:
issue-labels-alias:
- name: Documentation
header: Documentation
plural: Documentation
plural: Documentation
create:
include-sha-section: true
sha-section-heading: "SHA256 Hashes of the release artifacts"
sha-section-line-format: "- `{1}\t{0}`"
close:
use-issue-comments: true
issue-comment: |-
:tada: This issue has been resolved in version {milestone} :tada:
The release is available on:
- [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
- [NuGet Package](https://www.nuget.org/packages/Cake/{milestone})
- [Chocolatey Package](https://chocolatey.org/packages/cake.portable/{milestone})
- [.Net Global Tool](https://www.nuget.org/packages/Cake.Tool/{milestone})
Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -19,14 +19,13 @@ Cake (C# Make) is a build automation system with a C# DSL to do things like comp
| Azure Pipelines | Centos | [![Azure Pipelines Cake Centos status](https://dev.azure.com/cake-build/Cake/_apis/build/status/Azure%20Pipelines%20-%20Build%20Cake%20Centos%207?&branchName=develop)](https://dev.azure.com/cake-build/Cake/_build/latest?definitionId=5) | |
| Azure Pipelines | Ubuntu | [![Azure Pipelines Ubuntu Build status](https://dev.azure.com/cake-build/Cake/_apis/build/status/Azure%20Pipelines%20-%20Build%20Cake%20Ubuntu?&branchName=develop)](https://dev.azure.com/cake-build/Cake/_build/latest?definitionId=3) | |
| AppVeyor | Windows | [![AppVeyor branch](https://img.shields.io/appveyor/ci/cakebuild/cake/develop.svg)](https://ci.appveyor.com/project/cakebuild/cake/branch/develop) | [![AppVeyor branch](https://img.shields.io/appveyor/ci/cakebuild/cake-eijwj/develop.svg)](https://ci.appveyor.com/project/cakebuild/cake-eijwj) |
| Travis | Linux / MacOS | [![Travis build status](https://travis-ci.org/cake-build/cake.svg?branch=develop)](https://travis-ci.org/cake-build/cake) | |
| Travis | Ubuntu / MacOS | [![Travis build status](https://travis-ci.org/cake-build/cake.svg?branch=develop)](https://travis-ci.org/cake-build/cake) | |
| TeamCity | Windows | [![TeamCity Build Status](http://img.shields.io/teamcity/codebetter/Cake_CakeMaster.svg)](http://teamcity.codebetter.com/viewType.html?buildTypeId=Cake_CakeMaster) | |
| Bitrise | MacOS | [![Build Status](https://app.bitrise.io/app/42eaef77e8db4a5c/status.svg?token=EDjHGK5njNJ-MrhSbvKM1w&branch=develop)](https://app.bitrise.io/app/42eaef77e8db4a5c) | ![Build Status](https://app.bitrise.io/app/804b431c1f27e0a0/status.svg?token=qKosHEaJAJEqzZcq4s5WRg&branch=develop) |
| Bitrise | Linux | [![Build Status](https://app.bitrise.io/app/ea0c6b3c61eb1e79/status.svg?token=KJqOWXllYXz3WYqcB861Uw&branch=develop)](https://app.bitrise.io/app/ea0c6b3c61eb1e79) | ![Build Status](https://app.bitrise.io/app/5a406f34f22113c6/status.svg?token=TQPbsmA9yP-iJOhzunIP4w&branch=develop) |
| MyGet Build Services | Windows | [![MyGet Build Status](https://www.myget.org/BuildSource/Badge/cake-myget-build-service?identifier=53513546-050e-45de-9500-f161c99df6e2)](https://www.myget.org/) |   |
| Bitbucket Pipelines | Linux | [![Build Status](https://cakebitbucketpipelinesshield.azurewebsites.net/status/cakebuild/cake-integration-tests/develop)](https://cakebitbucketpipelinesshield.azurewebsites.net/url/cakebuild/cake-integration-tests/develop) | |
| GitLab | Linux | [![build status](https://gitlab.com/cake-build/cake/badges/develop/build.svg)](https://gitlab.com/cake-build/cake/builds) |   |
| GitHub Actions | N/A | [![Build Status](https://github.com/cake-build/cake/workflows/Build/badge.svg?branch=develop)](https://github.com/cake-build/cake/actions) |   |
| Bitrise | Debian | [![Build Status](https://app.bitrise.io/app/ea0c6b3c61eb1e79/status.svg?token=KJqOWXllYXz3WYqcB861Uw&branch=develop)](https://app.bitrise.io/app/ea0c6b3c61eb1e79) | ![Build Status](https://app.bitrise.io/app/5a406f34f22113c6/status.svg?token=TQPbsmA9yP-iJOhzunIP4w&branch=develop) |
| Bitbucket Pipelines | Debian | [![Build Status](https://cakebitbucketpipelinesshield.azurewebsites.net/status/cakebuild/cake-integration-tests/develop)](https://cakebitbucketpipelinesshield.azurewebsites.net/url/cakebuild/cake-integration-tests/develop) | |
| GitLab | Debian | [![pipeline status](https://gitlab.com/cake-build/cake/badges/develop/pipeline.svg)](https://gitlab.com/cake-build/cake/commits/develop) |   |
| GitHub Actions | Windows / Ubuntu/ macOS | [![Build Status](https://github.com/cake-build/cake/workflows/Build/badge.svg?branch=develop)](https://github.com/cake-build/cake/actions) |   |

## Code Coverage

Expand Down
10 changes: 10 additions & 0 deletions ReleaseNotes.md
@@ -1,3 +1,13 @@
### New in 0.37.0 (Released 2020/02/01)

* 2708 Emitting debug information should be done regardless of --debug switch.
* 2701 Api keys should be secret.
* 2697 Update to latest release of GitReleaseManager.
* 2696 Upgrade Cake Alias support for GitReleaseManager.
* 2691 Missing GitHubActions Alias.
* 2695 Cake fails to build on travis-ci with latest mono (6.8).
* 2693 Update .NET Core SDK to 3.1.101.

### New in 0.36.0 (Released 2020/01/11)

* 2677 Add GitHub Actions build provider.
Expand Down
10 changes: 5 additions & 5 deletions build.cake
Expand Up @@ -15,7 +15,7 @@
// Install .NET Core Global tools.
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.1.2"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=SignClient&version=1.0.82"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.9.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.10.2"

// Load other scripts.
#load "./build/parameters.cake"
Expand Down Expand Up @@ -579,9 +579,9 @@ Task("Publish-GitHub-Release")
.WithCriteria<BuildParameters>((context, parameters) => parameters.ShouldPublish)
.Does<BuildParameters>((context, parameters) =>
{
GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake", parameters.Version.Milestone, parameters.Paths.Files.ZipArtifactPathDesktop.ToString());
GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake", parameters.Version.Milestone, parameters.Paths.Files.ZipArtifactPathCoreClr.ToString());
GitReleaseManagerClose(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake", parameters.Version.Milestone);
GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake", parameters.Version.Milestone, parameters.Paths.Files.ZipArtifactPathDesktop.ToString());
GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake", parameters.Version.Milestone, parameters.Paths.Files.ZipArtifactPathCoreClr.ToString());
GitReleaseManagerClose(parameters.GitHub.Token, "cake-build", "cake", parameters.Version.Milestone);
})
.OnError<BuildParameters>((exception, parameters) =>
{
Expand All @@ -592,7 +592,7 @@ Task("Publish-GitHub-Release")
Task("Create-Release-Notes")
.Does<BuildParameters>((context, parameters) =>
{
GitReleaseManagerCreate(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake", new GitReleaseManagerCreateSettings {
GitReleaseManagerCreate(parameters.GitHub.Token, "cake-build", "cake", new GitReleaseManagerCreateSettings {
Milestone = parameters.Version.Milestone,
Name = parameters.Version.Milestone,
Prerelease = true,
Expand Down
4 changes: 2 additions & 2 deletions build.config
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
CAKE_VERSION=0.35.0
DOTNET_VERSION=3.1.100
CAKE_VERSION=0.36.0
DOTNET_VERSION=3.1.101
11 changes: 4 additions & 7 deletions build/credentials.cake
@@ -1,19 +1,16 @@
public class BuildCredentials
{
public string UserName { get; private set; }
public string Password { get; private set; }
public string Token { get; private set; }

public BuildCredentials(string userName, string password)
public BuildCredentials(string token)
{
UserName = userName;
Password = password;
Token = token;
}

public static BuildCredentials GetGitHubCredentials(ICakeContext context)
{
return new BuildCredentials(
context.EnvironmentVariable("CAKE_GITHUB_USERNAME"),
context.EnvironmentVariable("CAKE_GITHUB_PASSWORD"));
context.EnvironmentVariable("CAKE_GITHUB_TOKEN"));
}
}

Expand Down
2 changes: 1 addition & 1 deletion global.json
Expand Up @@ -3,6 +3,6 @@
"src"
],
"sdk": {
"version": "3.1.100"
"version": "3.1.101"
}
}
@@ -0,0 +1,32 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tools.GitReleaseManager.Discard;

namespace Cake.Common.Tests.Fixtures.Tools.GitReleaseManager
{
internal sealed class GitReleaseManagerDiscarderFixture : GitReleaseManagerFixture<GitReleaseManagerDiscardSettings>
{
public string Token { get; set; }
public string Owner { get; set; }
public string Repository { get; set; }

public string Milestone { get; set; }

public GitReleaseManagerDiscarderFixture()
{
Token = "token";
Owner = "repoOwner";
Repository = "repo";
Milestone = "0.1.0";
}

protected override void RunTool()
{
var tool = new GitReleaseManagerDiscarder(FileSystem, Environment, ProcessRunner, Tools);

tool.Discard(Token, Owner, Repository, Milestone, Settings);
}
}
}
@@ -0,0 +1,31 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tools.GitReleaseManager.Open;

namespace Cake.Common.Tests.Fixtures.Tools.GitReleaseManager
{
internal sealed class GitReleaseManagerMilestoneOpenerFixture : GitReleaseManagerFixture<GitReleaseManagerOpenMilestoneSettings>
{
public string Token { get; set; }
public string Owner { get; set; }
public string Repository { get; set; }
public string Milestone { get; set; }

public GitReleaseManagerMilestoneOpenerFixture()
{
Token = "token";
Owner = "repoOwner";
Repository = "repo";
Milestone = "0.1.0";
}

protected override void RunTool()
{
var tool = new GitReleaseManagerMilestoneOpener(FileSystem, Environment, ProcessRunner, Tools);

tool.Open(Token, Owner, Repository, Milestone, Settings);
}
}
}
13 changes: 13 additions & 0 deletions src/Cake.Common.Tests/Unit/Build/BuildSystemAliasesTests.cs
Expand Up @@ -135,5 +135,18 @@ public void Should_Throw_If_Context_Is_Null()
AssertEx.IsArgumentNullException(result, "context");
}
}

public sealed class TheGitHubActionsMethod
{
[Fact]
public void Should_Throw_If_Context_Is_Null()
{
// Given, When
var result = Record.Exception(() => BuildSystemAliases.GitHubActions(null));

// Then
AssertEx.IsArgumentNullException(result, "context");
}
}
}
}
Expand Up @@ -119,7 +119,7 @@ public void Should_Add_Additional_Arguments()
var result = fixture.Run();

// Then
Assert.Equal(string.Format("nuget push {0} --source {1} --api-key {2} --symbol-source {3} --symbol-api-key {4} --timeout {5} --disable-buffering --no-symbols --force-english-output", packageName, source, apiKey, symbolSource, symbolApiKey, timeout), result.Args);
Assert.Equal(string.Format("nuget push {0} --source {1} --api-key \"{2}\" --symbol-source {3} --symbol-api-key \"{4}\" --timeout {5} --disable-buffering --no-symbols --force-english-output", packageName, source, apiKey, symbolSource, symbolApiKey, timeout), result.Args);
}

[Fact]
Expand Down
Expand Up @@ -481,6 +481,111 @@ public void Should_Add_LogFilePath_To_Arguments_If_Set_When_Using_Token()
"-a \"/temp/asset1.txt\" " +
"-l \"/temp/log.txt\"", result.Args);
}

[Fact]
public void Should_Add_Debug_To_Arguments_If_Set()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.Settings.Debug = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset -u \"bob\" -p \"password\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--debug", result.Args);
}

[Fact]
public void Should_All_Debug_To_Arguments_If_Set_When_Using_Token()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.UseToken();
fixture.Settings.Debug = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset --token \"token\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--debug", result.Args);
}

[Fact]
public void Should_Add_Verbose_To_Arguments_If_Set()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.Settings.Verbose = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset -u \"bob\" -p \"password\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--verbose", result.Args);
}

[Fact]
public void Should_All_Verbose_To_Arguments_If_Set_When_Using_Token()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.UseToken();
fixture.Settings.Verbose = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset --token \"token\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--verbose", result.Args);
}

[Fact]
public void Should_Add_NoLogo_To_Arguments_If_Set()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.Settings.NoLogo = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset -u \"bob\" -p \"password\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--no-logo", result.Args);
}

[Fact]
public void Should_All_NoLogo_To_Arguments_If_Set_When_Using_Token()
{
// Given
var fixture = new GitReleaseManagerAssetsAdderFixture();
fixture.UseToken();
fixture.Settings.NoLogo = true;

// When
var result = fixture.Run();

// Then
Assert.Equal("addasset --token \"token\" " +
"-o \"repoOwner\" -r \"repo\" -t \"0.1.0\" " +
"-a \"/temp/asset1.txt\" " +
"--no-logo", result.Args);
}
}
}
}

0 comments on commit 0497c47

Please sign in to comment.