diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efce7ef1..19960fed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,10 @@ jobs: if: needs.can_document.outputs.value == 'true' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: "14.x" registry-url: 'https://registry.npmjs.org' @@ -48,10 +48,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup dotnet - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x @@ -65,10 +65,10 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup dotnet - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: | 6.0.x diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index c1999a9f..7616e4d5 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Build Schema", "$ref": "#/definitions/build", + "title": "Build Schema", "definitions": { "build": { "type": "object", @@ -131,4 +131,4 @@ } } } -} \ No newline at end of file +} diff --git a/build.cmd b/build.cmd old mode 100644 new mode 100755 diff --git a/build.ps1 b/build.ps1 index 1f264e7f..3cca4ef3 100644 --- a/build.ps1 +++ b/build.ps1 @@ -18,11 +18,10 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp" $DotNetGlobalFile = "$PSScriptRoot\\global.json" $DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" -$DotNetChannel = "Current" +$DotNetChannel = "STS" -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 -$env:DOTNET_MULTILEVEL_LOOKUP = 0 +$env:DOTNET_NOLOGO = 1 ########################################################################### # EXECUTION @@ -61,9 +60,15 @@ else { ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } } $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" } Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh index 75341232..a226b969 100755 --- a/build.sh +++ b/build.sh @@ -14,11 +14,10 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" -DOTNET_CHANNEL="Current" +DOTNET_CHANNEL="STS" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -export DOTNET_MULTILEVEL_LOOKUP=0 +export DOTNET_NOLOGO=1 ########################################################################### # EXECUTION @@ -54,9 +53,15 @@ else "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path fi export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" fi echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi + "$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/nuke/Build.cs b/nuke/Build.cs index a186fdf3..2c707382 100644 --- a/nuke/Build.cs +++ b/nuke/Build.cs @@ -14,8 +14,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Nuke.Common.Tooling; using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.IO.PathConstruction; using static Nuke.Common.Tools.DotNet.DotNetTasks; using static Nuke.Common.Tools.NuGet.NuGetTasks; using Project = Nuke.Common.ProjectModel.Project; @@ -99,7 +99,7 @@ protected override void OnBuildInitialized() Log.Information("Building version: {Version}", Version); - TargetProject = Solution.GetProject(SourceDirectory / TargetProjectName / $"{TargetLibName}.csproj" ); + TargetProject = Solution.GetProject(TargetLibName ); TargetProject.NotNull("TargetProject could not be loaded!"); TargetFrameworks = TargetProject.GetTargetFrameworks(); @@ -112,7 +112,7 @@ protected override void OnBuildInitialized() .Before(Restore) .Executes(() => { - SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory); + SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); }); Target Restore => _ => _ @@ -129,6 +129,7 @@ protected override void OnBuildInitialized() DotNetBuild(s => s .SetProjectFile(Solution) .SetConfiguration(Configuration) + .SetContinuousIntegrationBuild(IsServerBuild) .EnableNoRestore()); }); @@ -140,7 +141,8 @@ protected override void OnBuildInitialized() .SetProjectFile(Solution) .SetConfiguration(Configuration) .EnableNoRestore() - .EnableNoBuild()); + .EnableNoBuild() + .When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions"))); }); Target CopyFiles => _ => _ @@ -172,9 +174,9 @@ protected override void OnBuildInitialized() .SetTargetPath(nuspec) .SetVersion(Version) .SetOutputDirectory(NugetDirectory) - .SetSymbols(true) - .SetSymbolPackageFormat("snupkg") - .AddProperty("Configuration", Configuration) + .EnableSymbols() + .SetSymbolPackageFormat(NuGetSymbolPackageFormat.snupkg) + .SetConfiguration(Configuration) ); }); @@ -185,13 +187,12 @@ protected override void OnBuildInitialized() { var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"); - if (apiKey.IsNullOrEmpty()) { throw new BuildAbortedException("Could not resolve the NuGet API key."); } - foreach (var nupkg in GlobFiles(NugetDirectory, "*.nupkg")) + foreach (var nupkg in NugetDirectory.GlobFiles("*.nupkg")) { NuGetPush(s => s .SetTargetPath(nupkg) diff --git a/nuke/_build.csproj b/nuke/_build.csproj index 7521e1ba..a71fa1bd 100644 --- a/nuke/_build.csproj +++ b/nuke/_build.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 CS0649;CS0169 .. @@ -11,7 +11,7 @@ - + diff --git a/src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj b/src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj index b61b451a..9663b677 100644 --- a/src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj +++ b/src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj @@ -18,9 +18,9 @@ - - - - + + + + \ No newline at end of file diff --git a/src/AngleSharp.Css.sln b/src/AngleSharp.Css.sln index ce2248b2..33bf5d6f 100644 --- a/src/AngleSharp.Css.sln +++ b/src/AngleSharp.Css.sln @@ -16,10 +16,11 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{988B2C40-782B-4128-9551-7AE65B60F903}" ProjectSection(SolutionItems) = preProject AngleSharp.Css.nuspec = AngleSharp.Css.nuspec - ..\build.cake = ..\build.cake Directory.Build.props = Directory.Build.props EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\nuke\_build.csproj", "{A7AF57F0-E932-4276-A7E9-7109843AECA0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/AngleSharp.Css/AngleSharp.Css.csproj b/src/AngleSharp.Css/AngleSharp.Css.csproj index 519ab954..12bcd3e5 100644 --- a/src/AngleSharp.Css/AngleSharp.Css.csproj +++ b/src/AngleSharp.Css/AngleSharp.Css.csproj @@ -17,7 +17,7 @@ - +