Skip to content

Commit

Permalink
Merge pull request #398 from nils-a/release/5.0.0
Browse files Browse the repository at this point in the history
Release/5.0.0
  • Loading branch information
nils-a authored Dec 16, 2024
2 parents 222d609 + f61ea05 commit 5fa3a79
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 61 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
"contributions": [
"doc"
]
},
{
"login": "stehlih",
"name": "Heiko Stehli",
"avatar_url": "https://avatars.githubusercontent.com/u/43820014?v=4",
"profile": "https://github.com/stehlih",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand All @@ -31,5 +40,6 @@
"repoType": "github",
"repoHost": "https://github.com",
"commitConvention": "none",
"skipCi": true
"skipCi": true,
"commitType": "docs"
}
16 changes: 13 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "github>nils-a/renovate-config" ],
"extends": [
"github>cake-contrib/renovate-presets:cake-recipe",
"github>cake-contrib/renovate-presets:github-actions" ],
"packageRules": [
{
"matchPackageNames": ["cake.tool", "Cake.Core"],
"description": "Update Cake references only for major updates.",
"matchPackageNames": ["Cake.Core", "Cake.Common"],
"matchUpdateTypes": ["minor", "patch"],
"enabled": false
},
{
"description": "Updates to Cake.Core references are breaking.",
"matchPackageNames": ["Cake.Core"],
"matchUpdateTypes": ["major"],
"labels": ["Breaking Change"]
}
]
}
}
30 changes: 17 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-2022, ubuntu-22.04, macos-12 ]
os: [ windows-2022, ubuntu-22.04, macos-13 ]

env:
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
Expand All @@ -44,40 +44,44 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- uses: actions/setup-dotnet@v4.0.0
- uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
# codecov needs 2.1
# unittests needs 3.1
# gitversion needs 5.0
# cake 1.3 needs 6.0
# .NET 9 to build
dotnet-version: |
2.1.818
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
2.1
3.1
5.0
6.0
9.0
- name: Cache Tools
uses: actions/cache@v3
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build project
uses: cake-build/cake-action@v1
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1
with:
script-path: recipe.cake
target: CI
verbosity: Diagnostic
cake-version: tool-manifest
- name: Upload Issues
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
if-no-files-found: warn
name: ${{ matrix.os }} Issues
path: |
BuildArtifacts/report.html
BuildArtifacts/**/coverlet/*.xml
- name: Upload Packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: runner.os == 'Windows'
with:
if-no-files-found: warn
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,28 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4.0.0
- uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
# gitversion needs 5.0
# cake 1.3 needs 6.0
# .NET 9 to build
dotnet-version: |
5.0.x
8.0.x
5.0
6.0
9.0
- name: Cache Tools
uses: actions/cache@v3
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +61,7 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Build project
uses: cake-build/cake-action@v1
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1
with:
script-path: recipe.cake
target: DotNetCore-Build
Expand All @@ -68,10 +72,10 @@ jobs:
COMPlus_DbgMiniDumpName: BuildArtifacts/coredump.dmp

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3

- name: Upload CoreDump
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: failure()
with:
if-no-files-found: warn
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publishDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Fetch all tags and branches
run: git fetch --prune --unshallow

- name: Cache Tools
uses: actions/cache@v3
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: tools
key: ${{ runner.os }}-doc-tools-${{ hashFiles('recipe.cake') }}

- name: Publishing documentaiton
uses: cake-build/cake-action@v1
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1
with:
script-path: recipe.cake
target: Force-Publish-Documentation
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ Thanks goes to these wonderful people ([emoji key][emoji-key]):
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://www.nils-andresen.de/"><img src="https://avatars3.githubusercontent.com/u/349188?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nils Andresen</b></sub></a><br /><a href="https://github.com/cake-contrib/Cake.7zip/commits?author=nils-a" title="Code">💻</a> <a href="https://github.com/cake-contrib/Cake.7zip/commits?author=nils-a" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/DiDoHH"><img src="https://avatars.githubusercontent.com/u/45682415?v=4?s=100" width="100px;" alt=""/><br /><sub><b>DiDoHH</b></sub></a><br /><a href="https://github.com/cake-contrib/Cake.7zip/commits?author=DiDoHH" title="Documentation">📖</a></td>
</tr>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://www.nils-andresen.de/"><img src="https://avatars3.githubusercontent.com/u/349188?v=4?s=100" width="100px;" alt="Nils Andresen"/><br /><sub><b>Nils Andresen</b></sub></a><br /><a href="https://github.com/cake-contrib/Cake.7zip/commits?author=nils-a" title="Code">💻</a> <a href="https://github.com/cake-contrib/Cake.7zip/commits?author=nils-a" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DiDoHH"><img src="https://avatars.githubusercontent.com/u/45682415?v=4?s=100" width="100px;" alt="DiDoHH"/><br /><sub><b>DiDoHH</b></sub></a><br /><a href="https://github.com/cake-contrib/Cake.7zip/commits?author=DiDoHH" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/stehlih"><img src="https://avatars.githubusercontent.com/u/43820014?v=4?s=100" width="100px;" alt="Heiko Stehli"/><br /><sub><b>Heiko Stehli</b></sub></a><br /><a href="https://github.com/cake-contrib/Cake.7zip/commits?author=stehlih" title="Code">💻</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down
4 changes: 2 additions & 2 deletions demo/cake/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "4.0.0",
"version": "5.0.0",
"commands": [
"dotnet-cake"
]
}
}
}
}
4 changes: 2 additions & 2 deletions demo/cake/build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#tool "nuget:?package=7-Zip.CommandLine&version=18.1.0"
#r "..\..\src\Cake.7zip\bin\Release\net6.0\Cake.7zip.dll"
#r "..\..\src\Cake.7zip\bin\Release\net8.0\Cake.7zip.dll"

///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand Down Expand Up @@ -195,4 +195,4 @@ Task("Default")
.IsDependentOn("RenameFile")
.IsDependentOn("GH78");

RunTarget(target);
RunTarget(target);
12 changes: 6 additions & 6 deletions demo/frosting/build/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)..</RunWorkingDirectory>
<TargetFramework>net8.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)\</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cake.7zip, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\src\Cake.7zip\bin\Release\net6.0\Cake.7zip.dll</HintPath>
<Reference Include="Cake.7zip">
<HintPath>$(MSBuildProjectDirectory)\..\..\..\src\Cake.7zip\bin\Release\net8.0\Cake.7zip.dll</HintPath>
</Reference>
<PackageReference Include="Cake.Frosting" Version="4.0.0" />
<PackageReference Include="Cake.Frosting" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Remove="output\**" />
<EmbeddedResource Remove="output\**" />
<None Remove="output\**" />
</ItemGroup>
</Project>
</Project>
18 changes: 17 additions & 1 deletion demo/frosting/build/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Cake.Frosting;

namespace Build
Expand All @@ -8,10 +9,25 @@ public static class Program
public static int Main(string[] args)
{
return new CakeHost()
.InstallTool(new Uri("nuget:?package=7-Zip.CommandLine&version=18.1.0"))
.InstallSevenZip()
.UseContext<BuildContext>()
.UseSetup<BuildSetup>()
.Run(args);
}

private static CakeHost InstallSevenZip(this CakeHost host)
{
// 7-Zip.CommandLine is a windows-only package
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
host.InstallTool(new Uri("nuget:?package=7-Zip.CommandLine&version=18.1.0"));
}
else
{
Console.WriteLine("7-Zip.CommandLine tool not installed. Make sure you hava a version of 7zip installed!");
}

return host;
}
}
}
2 changes: 1 addition & 1 deletion demo/frosting/build/Tasks/ZipItTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override void Run(BuildContext context)
context.SevenZip(m => m
.InAddMode()
.WithArchive(context.Output.CombineWithFilePath("archive.zip"))
.WithFiles(context.Root.CombineWithFilePath("README.MD"))
.WithFiles(context.Root.CombineWithFilePath("README.md"))
.WithFiles(context.Root.CombineWithFilePath("CODE_OF_CONDUCT.md")));
}
}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.101",
"version": "9.0.101",
"rollForward": "latestFeature"
}
}
3 changes: 3 additions & 0 deletions recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ BuildParameters.SetParameters(
repositoryOwner: "cake-contrib",
shouldRunDotNetCorePack: true,
shouldUseDeterministicBuilds: true,
shouldRunCodecov: false,
preferredBuildProviderType: BuildProviderType.GitHubActions,
preferredBuildAgentOperatingSystem: PlatformFamily.Linux);

BuildParameters.PrintParameters(Context);

ToolSettings.SetToolSettings(context: Context);
ToolSettings.SetToolPreprocessorDirectives(
gitReleaseManagerGlobalTool: "#tool dotnet:?package=GitReleaseManager.Tool&version=0.18.0");

Build.RunDotNetCore();
16 changes: 8 additions & 8 deletions src/Cake.7zip.Tests/Cake.7zip.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This is done to make Cake.Recipe avoid using OpenCover. Remove this hack if Cake.Recipe bumps the usage of Cake.Incubator to version 7.0.0
-->
<TargetFrameworks Condition="false">netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<CodeAnalysisRuleSet>..\cake.7zip.ruleset</CodeAnalysisRuleSet>

<IsPackable>false</IsPackable>
Expand All @@ -15,21 +15,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Testing" Version="4.0.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PackageReference Include="Cake.Testing" Version="5.0.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.analyzers" Version="1.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.analyzers" Version="1.18.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions src/Cake.7zip.Tests/SevenZipRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void Should_Access_registry()

var sevenZipKey = new Mock<IRegistryKey>();
sevenZipKey.Setup(k => k.GetValue("Path")).Returns(installLocation.Path.FullPath);
sevenZipKey.Setup(k => k.GetValue("Path64")).Returns(null);
sevenZipKey.Setup(k => k.GetValue("Path64")).Returns(null!);
var softwareKey = new Mock<IRegistryKey>();
softwareKey.Setup(k => k.OpenKey("7-Zip")).Returns(sevenZipKey.Object);
var hklm = new Mock<IRegistryKey>();
Expand Down Expand Up @@ -124,7 +124,7 @@ public void Should_Access_64bit_tool_from_registry()
var file = fixture.FileSystem.CreateFile(installLocation.Path.CombineWithFilePath("7z.exe"));

var sevenZipKey = new Mock<IRegistryKey>();
sevenZipKey.Setup(k => k.GetValue("Path")).Returns(null);
sevenZipKey.Setup(k => k.GetValue("Path")).Returns(null!);
sevenZipKey.Setup(k => k.GetValue("Path64")).Returns(installLocation.Path.FullPath);
var softwareKey = new Mock<IRegistryKey>();
softwareKey.Setup(k => k.OpenKey("7-Zip")).Returns(sevenZipKey.Object);
Expand Down Expand Up @@ -313,4 +313,4 @@ public void BuildArguments(ref ProcessArgumentBuilder builder)
{
// no-op
}
}
}
Loading

0 comments on commit 5fa3a79

Please sign in to comment.