From 35ecfdf7f12e354b56c0a488d4e7351f8a8f6017 Mon Sep 17 00:00:00 2001 From: Artyom M Date: Fri, 15 Nov 2024 17:58:52 +0200 Subject: [PATCH 1/4] Update build to net9 --- .github/workflows/continuous.yml | 6 +- .github/workflows/release.yml | 6 +- .nuke/build.schema.json | 149 ++++++++++++++++--------------- build/_build.csproj | 6 +- build/_build.csproj.DotSettings | 8 +- 5 files changed, 90 insertions(+), 85 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 02d2161a..a8a02447 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -23,11 +23,11 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp @@ -36,7 +36,7 @@ jobs: - name: 'Run: Compile, Pack' run: ./build.cmd Compile Pack - name: 'Publish: packages' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages path: artifacts/packages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8d78487..3a6e1750 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,11 +26,11 @@ jobs: name: ubuntu-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .nuke/temp @@ -42,7 +42,7 @@ jobs: NugetKey: ${{ secrets.NUGET_KEY }} GithubToken: ${{ secrets.GITHUB_TOKEN }} - name: 'Publish: packages' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages path: artifacts/packages diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 96a6845a..3decf31a 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,63 +1,66 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/build", - "title": "Build Schema", "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Pack", + "Push", + "PushGithubNuget", + "Restore", + "VerifyFormat" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Configuration": { - "type": "string", - "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, - "GithubToken": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", "description": "Disables displaying the NUKE logo" }, - "NugetApiUrl": { - "type": "string" - }, - "NugetKey": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Partition": { "type": "string", "description": "Partition to use on CI" @@ -81,49 +84,53 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Pack", - "Push", - "PushGithubNuget", - "Restore", - "VerifyFormat" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Pack", - "Push", - "PushGithubNuget", - "Restore", - "VerifyFormat" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "allOf": [ + { + "properties": { + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" + "Debug", + "Release" ] + }, + "GithubToken": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "NugetApiUrl": { + "type": "string" + }, + "NugetKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" } } + }, + { + "$ref": "#/definitions/NukeBuild" } - } + ] } diff --git a/build/_build.csproj b/build/_build.csproj index b1965fae..5abc6bdf 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -2,17 +2,19 @@ Exe - net8.0 + net9.0 CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 .. .. 1 false + true - + + diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings index c815d363..a778f33d 100644 --- a/build/_build.csproj.DotSettings +++ b/build/_build.csproj.DotSettings @@ -1,4 +1,4 @@ - + DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW @@ -17,15 +17,11 @@ False <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> - <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> True True True True - True True True True - True - True + True From 0a28a58facb886b275d1d90fb59f2383e5633856 Mon Sep 17 00:00:00 2001 From: Artyom M Date: Fri, 15 Nov 2024 18:12:59 +0200 Subject: [PATCH 2/4] Update --- .github/workflows/continuous.yml | 5 +++++ .github/workflows/release.yml | 6 ++++++ build/_build.csproj.DotSettings | 8 ++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index a8a02447..d5a80dad 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -26,6 +26,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 9.0.0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a6e1750..63859fa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,12 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 9.0.0 - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v4 with: diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings index a778f33d..c815d363 100644 --- a/build/_build.csproj.DotSettings +++ b/build/_build.csproj.DotSettings @@ -1,4 +1,4 @@ - + DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW @@ -17,11 +17,15 @@ False <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> True True True True + True True True True - True + True + True From 7234b0e7ed5b0897787f13d52fcdebefbc05b42f Mon Sep 17 00:00:00 2001 From: Artyom M Date: Fri, 15 Nov 2024 18:15:49 +0200 Subject: [PATCH 3/4] update --- .github/workflows/codeql.yml | 6 ++++++ .github/workflows/continuous.yml | 3 ++- .github/workflows/release.yml | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 000f9d80..d8f4c30f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,6 +44,12 @@ jobs: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. submodules: recursive + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 9.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index d5a80dad..df1d5b20 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -30,7 +30,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 9.0.0 + 8.0.x + 9.0.x - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63859fa5..fd473cd5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,8 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 9.0.0 + 8.0.x + 9.0.x - name: 'Cache: .nuke/temp, ~/.nuget/packages' uses: actions/cache@v4 with: From 5ae99405b26941f8323fcdf7c06418231c199a79 Mon Sep 17 00:00:00 2001 From: Artyom M Date: Fri, 15 Nov 2024 18:17:59 +0200 Subject: [PATCH 4/4] Fix formatting --- build/_build.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/_build.csproj b/build/_build.csproj index 5abc6bdf..ef6b110d 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -9,7 +9,7 @@ .. 1 false - true + true