Skip to content

Commit 99c3ae7

Browse files
committed
Merge branch 'release/5.0.0'
* release/5.0.0: (GH-25) Update to latest Cake internals (GH-25) Update Cake.AppVeyor to target Cake v1.0.0 (GH-27) Add .NET 5.0 for package output (GH-30) Add workflow for publishing docs (GH-29) Add workflow for Cake dependencies (GH-28) Add workflow for CodeQL analysis (GH-26) Add dependabot config
2 parents 5cb8ed8 + bfbd16f commit 99c3ae7

File tree

8 files changed

+143
-14
lines changed

8 files changed

+143
-14
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
commit-message:
8+
prefix: "(maint)"
9+
target-branch: "develop"
10+
ignore:
11+
- dependency-name: "Cake.Core"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"
16+
commit-message:
17+
prefix: "(maint)"
18+
target-branch: "develop"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
name: "CodeQL"
7+
8+
on:
9+
push:
10+
branches: [develop]
11+
pull_request:
12+
# The branches below must be a subset of the branches above
13+
branches: [develop]
14+
schedule:
15+
- cron: '0 15 * * 6'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
# Override automatic language detection by changing the below list
26+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27+
language: ['csharp']
28+
# Learn more...
29+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2.3.4
34+
with:
35+
fetch-depth: 0
36+
37+
# If this run was triggered by a pull request event, then checkout
38+
# the head of the pull request instead of the merge commit.
39+
- run: git checkout HEAD^2
40+
if: ${{ github.event_name == 'pull_request' }}
41+
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v1
45+
with:
46+
languages: ${{ matrix.language }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
51+
52+
- run: ./build.ps1
53+
shell: pwsh
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Run dependabot for cake
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# run everyday at 6
6+
- cron: '0 6 * * *'
7+
8+
jobs:
9+
dependabot-cake:
10+
runs-on: ubuntu-latest # linux, because this is a docker-action
11+
steps:
12+
- name: check/update cake dependencies
13+
uses: nils-org/dependabot-cake-action@v1

.github/workflows/publishDocs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
WYAM_ACCESS_TOKEN: ${{ secrets.API_TOKEN }}
8+
# secrets.GITHUB_TOKEN has no permissions to push, sadly.
9+
WYAM_DEPLOY_BRANCH: 'gh-pages'
10+
WYAM_DEPLOY_REMOTE: "${{ github.event.repository.html_url }}"
11+
12+
jobs:
13+
cake:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v2.3.4 #https://github.com/actions/checkout
19+
with:
20+
fetch-depth: 0 # GitVersion is somewhat irritated when fetch-depth is "1"....
21+
ref: ${{ github.event.ref }}
22+
23+
- name: Cache Tools
24+
uses: actions/cache@v2
25+
with:
26+
path: tools
27+
key: ${{ runner.os }}-doc-tools-${{ hashFiles('recipe.cake') }}
28+
29+
- name: Publishing documentation
30+
uses: cake-build/cake-action@v1
31+
with:
32+
script-path: recipe.cake
33+
target: Force-Publish-Documentation
34+
verbosity: Diagnostic
35+
cake-version: 0.38.5
36+
cake-bootstrap: true

src/Cake.AppVeyor.Tests/Cake.AppVeyor.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net50;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Cake.Core" Version="0.33.0" />
9-
<PackageReference Include="Cake.Testing" Version="0.33.0" />
8+
<PackageReference Include="Cake.Core" Version="1.0.0" />
9+
<PackageReference Include="Cake.Testing" Version="1.0.0" />
1010
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
1111
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1212
<PrivateAssets>all</PrivateAssets>

src/Cake.AppVeyor.Tests/Fakes/FakeCakeArguments.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
using System;
22
using Cake.Core;
33
using System.Collections.Generic;
4+
using System.Linq;
45

56
namespace Cake.AppVeyor.Fakes
67
{
78
internal sealed class FakeCakeArguments : ICakeArguments
89
{
9-
private readonly Dictionary<string, string> _arguments;
10+
private readonly Dictionary<string, List<string>> _arguments;
1011

1112
/// <summary>
1213
/// Gets the arguments.
1314
/// </summary>
1415
/// <value>The arguments.</value>
15-
public IReadOnlyDictionary<string, string> Arguments
16+
public IReadOnlyDictionary<string, List<string>> Arguments
1617
{
1718
get { return _arguments; }
1819
}
@@ -22,14 +23,14 @@ public IReadOnlyDictionary<string, string> Arguments
2223
/// </summary>
2324
public FakeCakeArguments()
2425
{
25-
_arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
26+
_arguments = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
2627
}
2728

2829
/// <summary>
2930
/// Initializes the argument list.
3031
/// </summary>
3132
/// <param name="arguments">The arguments.</param>
32-
public void SetArguments(IDictionary<string, string> arguments)
33+
public void SetArguments(IDictionary<string, List<string>> arguments)
3334
{
3435
if (arguments == null)
3536
{
@@ -61,8 +62,13 @@ public bool HasArgument(string name)
6162
/// <returns>The argument value.</returns>
6263
public string GetArgument(string name)
6364
{
64-
return _arguments.ContainsKey(name)
65-
? _arguments[name] : null;
65+
return GetArguments(name).LastOrDefault();
66+
}
67+
68+
public ICollection<string> GetArguments(string name)
69+
{
70+
_arguments.TryGetValue(name, out var arguments);
71+
return arguments ?? (ICollection<string>)Array.Empty<string>();
6672
}
6773
}
6874
}

src/Cake.AppVeyor.Tests/Fakes/FakeCakeContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public FakeCakeContext()
2020

2121
log = new FakeLog();
2222
var fileSystem = new FileSystem();
23-
var environment = new CakeEnvironment(new CakePlatform(), new CakeRuntime(), log);
23+
var environment = new CakeEnvironment(new CakePlatform(), new CakeRuntime());
2424
var globber = new Globber(fileSystem, environment);
2525
var args = new FakeCakeArguments();
2626
var registry = new WindowsRegistry();
2727
var toolRepo = new ToolRepository(environment);
2828
var config = new Core.Configuration.CakeConfigurationProvider(fileSystem, environment).CreateConfiguration(testsDir, new Dictionary<string, string>());
29-
var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config);
29+
var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config, log);
3030
var toolLocator = new ToolLocator(environment, toolRepo, toolResolutionStrategy);
3131
var processRunner = new ProcessRunner(fileSystem, environment, log, toolLocator, config);
3232
var data = Substitute.For<ICakeDataService>();

src/Cake.AppVeyor/Cake.AppVeyor.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
4+
<TargetFrameworks>net50;netstandard2.0;net461</TargetFrameworks>
55
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<IncludeSymbols>true</IncludeSymbols>
@@ -25,8 +25,8 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Cake.Common" Version="0.33.0" PrivateAssets="All" />
29-
<PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
28+
<PackageReference Include="Cake.Common" Version="1.0.0" PrivateAssets="All" />
29+
<PackageReference Include="Cake.Core" Version="1.0.0" PrivateAssets="All" />
3030
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
<PrivateAssets>all</PrivateAssets>

0 commit comments

Comments
 (0)