diff --git a/.all-contributorsrc b/.all-contributorsrc index 409f987b..341d4951 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -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, @@ -31,5 +40,6 @@ "repoType": "github", "repoHost": "https://github.com", "commitConvention": "none", - "skipCi": true + "skipCi": true, + "commitType": "docs" } diff --git a/.github/renovate.json b/.github/renovate.json index 392c3ce5..38c9b666 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -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"] } ] -} \ No newline at end of file +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2a5c4b8..156c8a54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} @@ -44,32 +44,36 @@ 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 @@ -77,7 +81,7 @@ jobs: 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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 42cf7598..4b1a0c19 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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. @@ -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 @@ -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 diff --git a/.github/workflows/publishDocs.yml b/.github/workflows/publishDocs.yml index c3963c43..e967296f 100644 --- a/.github/workflows/publishDocs.yml +++ b/.github/workflows/publishDocs.yml @@ -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 diff --git a/README.md b/README.md index 9b0f1237..e19aa0e9 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,13 @@ Thanks goes to these wonderful people ([emoji key][emoji-key]): - - - - + + + + + + +

Nils Andresen

💻 📖

DiDoHH

📖
Nils Andresen
Nils Andresen

💻 📖
DiDoHH
DiDoHH

📖
Heiko Stehli
Heiko Stehli

💻
diff --git a/demo/cake/.config/dotnet-tools.json b/demo/cake/.config/dotnet-tools.json index da200cda..278f2d71 100644 --- a/demo/cake/.config/dotnet-tools.json +++ b/demo/cake/.config/dotnet-tools.json @@ -3,10 +3,10 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "4.0.0", + "version": "5.0.0", "commands": [ "dotnet-cake" ] } } -} \ No newline at end of file +} diff --git a/demo/cake/build.cake b/demo/cake/build.cake index 051506cf..f6d78fc9 100644 --- a/demo/cake/build.cake +++ b/demo/cake/build.cake @@ -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 @@ -195,4 +195,4 @@ Task("Default") .IsDependentOn("RenameFile") .IsDependentOn("GH78"); -RunTarget(target); \ No newline at end of file +RunTarget(target); diff --git a/demo/frosting/build/Build.csproj b/demo/frosting/build/Build.csproj index 01f3df49..3fa7db6b 100644 --- a/demo/frosting/build/Build.csproj +++ b/demo/frosting/build/Build.csproj @@ -1,18 +1,18 @@ Exe - net6.0 - $(MSBuildProjectDirectory).. + net8.0 + $(MSBuildProjectDirectory)\ - - ..\..\..\src\Cake.7zip\bin\Release\net6.0\Cake.7zip.dll + + $(MSBuildProjectDirectory)\..\..\..\src\Cake.7zip\bin\Release\net8.0\Cake.7zip.dll - + - \ No newline at end of file + diff --git a/demo/frosting/build/Program.cs b/demo/frosting/build/Program.cs index 38cf3532..313a5782 100644 --- a/demo/frosting/build/Program.cs +++ b/demo/frosting/build/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.InteropServices; using Cake.Frosting; namespace Build @@ -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() .UseSetup() .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; + } } } diff --git a/demo/frosting/build/Tasks/ZipItTask.cs b/demo/frosting/build/Tasks/ZipItTask.cs index 511f8c38..eac75574 100644 --- a/demo/frosting/build/Tasks/ZipItTask.cs +++ b/demo/frosting/build/Tasks/ZipItTask.cs @@ -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"))); } } diff --git a/global.json b/global.json index 789c7ae5..b07a98ef 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.101", + "version": "9.0.101", "rollForward": "latestFeature" } } diff --git a/recipe.cake b/recipe.cake index 4afae1e3..2b82cd1c 100644 --- a/recipe.cake +++ b/recipe.cake @@ -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(); diff --git a/src/Cake.7zip.Tests/Cake.7zip.Tests.csproj b/src/Cake.7zip.Tests/Cake.7zip.Tests.csproj index f4f49de8..9201d865 100644 --- a/src/Cake.7zip.Tests/Cake.7zip.Tests.csproj +++ b/src/Cake.7zip.Tests/Cake.7zip.Tests.csproj @@ -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 --> netcoreapp3.1 - net6.0;net7.0;net8.0 + net8.0;net9.0 ..\cake.7zip.ruleset false @@ -15,21 +15,21 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - - + + + runtime; build; native; contentfiles; analyzers all diff --git a/src/Cake.7zip.Tests/SevenZipRunnerTests.cs b/src/Cake.7zip.Tests/SevenZipRunnerTests.cs index ebebc733..8ed2ce36 100644 --- a/src/Cake.7zip.Tests/SevenZipRunnerTests.cs +++ b/src/Cake.7zip.Tests/SevenZipRunnerTests.cs @@ -92,7 +92,7 @@ public void Should_Access_registry() var sevenZipKey = new Mock(); 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(); softwareKey.Setup(k => k.OpenKey("7-Zip")).Returns(sevenZipKey.Object); var hklm = new Mock(); @@ -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(); - 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(); softwareKey.Setup(k => k.OpenKey("7-Zip")).Returns(sevenZipKey.Object); @@ -313,4 +313,4 @@ public void BuildArguments(ref ProcessArgumentBuilder builder) { // no-op } -} \ No newline at end of file +} diff --git a/src/Cake.7zip/Cake.7zip.csproj b/src/Cake.7zip/Cake.7zip.csproj index c5d58c6b..a7c0da15 100644 --- a/src/Cake.7zip/Cake.7zip.csproj +++ b/src/Cake.7zip/Cake.7zip.csproj @@ -1,6 +1,6 @@ - net6.0;net7.0;net8.0 + net8.0;net9.0 true true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb @@ -39,9 +39,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive