From 0f052ec81ef82a864ab3f409c2ed0f0eaafc1b34 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 14:43:16 +0200 Subject: [PATCH 1/6] version removed from auth projects, tags moved to project level --- src/Extensions/Directory.Build.props | 1 - .../RestApia.Extensions.Auth.Basic.csproj | 2 +- .../RestApia.Extensions.Auth.OAuth2.csproj | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Extensions/Directory.Build.props b/src/Extensions/Directory.Build.props index 131cc90..e3105dd 100644 --- a/src/Extensions/Directory.Build.props +++ b/src/Extensions/Directory.Build.props @@ -6,7 +6,6 @@ https://github.com/RestApia/RestApia.Shared MIT README.md - RestApia, Extension diff --git a/src/Extensions/RestApia.Extensions.Auth.Basic/RestApia.Extensions.Auth.Basic.csproj b/src/Extensions/RestApia.Extensions.Auth.Basic/RestApia.Extensions.Auth.Basic.csproj index aefd825..7e4696b 100644 --- a/src/Extensions/RestApia.Extensions.Auth.Basic/RestApia.Extensions.Auth.Basic.csproj +++ b/src/Extensions/RestApia.Extensions.Auth.Basic/RestApia.Extensions.Auth.Basic.csproj @@ -3,6 +3,6 @@ Basic Authorization extension Generate Authorization header based on settings for requests. https://github.com/RestApia/RestApia.Shared/tree/main/src/Extensions/RestApia.Extensions.Auth.Basic - 1.0.6 + RestApiaEmbedded, Extension diff --git a/src/Extensions/RestApia.Extensions.Auth.OAuth2/RestApia.Extensions.Auth.OAuth2.csproj b/src/Extensions/RestApia.Extensions.Auth.OAuth2/RestApia.Extensions.Auth.OAuth2.csproj index abacf95..d50d102 100644 --- a/src/Extensions/RestApia.Extensions.Auth.OAuth2/RestApia.Extensions.Auth.OAuth2.csproj +++ b/src/Extensions/RestApia.Extensions.Auth.OAuth2/RestApia.Extensions.Auth.OAuth2.csproj @@ -2,8 +2,8 @@ OAuth2 Authorization extension Extension provides OAuth2 Implicit and AuthCode authorizations - 1.0.6 https://github.com/RestApia/RestApia.Shared/tree/main/src/Extensions/RestApia.Extensions.Auth.OAuth2 + RestApiaEmbedded, Extension From 9a43c27db28e4614d13201c90413943d310618b6 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 14:45:40 +0200 Subject: [PATCH 2/6] yaml re-generated --- .build/Pipelines/GitHubActions.cs | 2 +- .github/workflows/pr-validation.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.build/Pipelines/GitHubActions.cs b/.build/Pipelines/GitHubActions.cs index 3879c7f..ef020f8 100644 --- a/.build/Pipelines/GitHubActions.cs +++ b/.build/Pipelines/GitHubActions.cs @@ -34,7 +34,7 @@ InvokedTargets = [ nameof(Solution_Build), ], - OnPullRequestBranches = ["master"] + OnPullRequestBranches = ["main"] )] [SuppressMessage("ReSharper", "CheckNamespace")] diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index fe0207d..72a5e40 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -19,7 +19,7 @@ name: pr-validation on: pull_request: branches: - - master + - main jobs: ubuntu-latest: From 494751697936f803bb86057c94ec72337c62f111 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 14:50:16 +0200 Subject: [PATCH 3/6] fix for PR validation pipeline --- .build/Pipelines/GitHubActions.cs | 9 +- .github/workflows/cd-publish-extension.yml | 6 +- .github/workflows/cd-publish-shared.yml | 6 +- .github/workflows/pr-validation.yml | 6 +- .gitignore | 2 +- .nuke/build.schema.json | 138 +++++++++++++++++++++ .nuke/parameters.json | 4 + 7 files changed, 156 insertions(+), 15 deletions(-) create mode 100644 .nuke/build.schema.json create mode 100644 .nuke/parameters.json diff --git a/.build/Pipelines/GitHubActions.cs b/.build/Pipelines/GitHubActions.cs index ef020f8..970a1d0 100644 --- a/.build/Pipelines/GitHubActions.cs +++ b/.build/Pipelines/GitHubActions.cs @@ -8,7 +8,7 @@ [GitHubActions( "cd-publish-shared", - GitHubActionsImage.WindowsLatest, + GitHubActionsImage.UbuntuLatest, InvokedTargets = [ nameof(Shared_Push), ], @@ -18,7 +18,7 @@ [GitHubActions( "cd-publish-extension", - GitHubActionsImage.WindowsLatest, + GitHubActionsImage.UbuntuLatest, InvokedTargets = [ nameof(Extension_Push), ], @@ -30,15 +30,14 @@ // Continuous Integration: Validate pull requests [GitHubActions( "pr-validation", - GitHubActionsImage.UbuntuLatest, + GitHubActionsImage.WindowsLatest, InvokedTargets = [ nameof(Solution_Build), ], OnPullRequestBranches = ["main"] )] -[SuppressMessage("ReSharper", "CheckNamespace")] -// CI/CD targets +[SuppressMessage("ReSharper", "CheckNamespace")] partial class Build { Target UpdateYaml => _ => _.Executes(() => Log.Information("Generating YAML...")); diff --git a/.github/workflows/cd-publish-extension.yml b/.github/workflows/cd-publish-extension.yml index 0d44801..9b093e2 100644 --- a/.github/workflows/cd-publish-extension.yml +++ b/.github/workflows/cd-publish-extension.yml @@ -27,9 +27,9 @@ on: required: true jobs: - windows-latest: - name: windows-latest - runs-on: windows-latest + ubuntu-latest: + name: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: 'Cache: .nuke/temp, ~/.nuget/packages' diff --git a/.github/workflows/cd-publish-shared.yml b/.github/workflows/cd-publish-shared.yml index 976aa7a..9ef90af 100644 --- a/.github/workflows/cd-publish-shared.yml +++ b/.github/workflows/cd-publish-shared.yml @@ -24,9 +24,9 @@ on: required: false jobs: - windows-latest: - name: windows-latest - runs-on: windows-latest + ubuntu-latest: + name: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: 'Cache: .nuke/temp, ~/.nuget/packages' diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 72a5e40..884e212 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -22,9 +22,9 @@ on: - main jobs: - ubuntu-latest: - name: ubuntu-latest - runs-on: ubuntu-latest + windows-latest: + name: windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: 'Cache: .nuke/temp, ~/.nuget/packages' diff --git a/.gitignore b/.gitignore index 9f814b4..f82e564 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .vs/ .vscode/ .idea -.nuke/ +.nuke/temp/ [Bb]in/ [Oo]bj/ packages/ diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 0000000..7027367 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,138 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "properties": { + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "ExtensionLibVersion": { + "type": "string", + "description": "Extension library version" + }, + "ExtensionName": { + "type": "string", + "description": "Extension library name" + }, + "PushApiKey": { + "type": "string", + "description": "NuGet push API key" + }, + "SharedLibVersion": { + "type": "string", + "description": "Shared library version" + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + } + }, + "definitions": { + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Extension_Build", + "Extension_FindNextVersion", + "Extension_Push", + "Shared_Build", + "Shared_FindNextVersion", + "Shared_Push", + "Solution_Build", + "Solution_Clean", + "Solution_Restore", + "UpdateYaml" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { + "properties": { + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "description": "Host for execution. Default is 'automatic'", + "$ref": "#/definitions/Host" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "$ref": "#/definitions/ExecutableTarget" + } + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "$ref": "#/definitions/ExecutableTarget" + } + }, + "Verbosity": { + "description": "Logging verbosity during build execution. Default is 'Normal'", + "$ref": "#/definitions/Verbosity" + } + } + } + }, + "$ref": "#/definitions/NukeBuild" +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 0000000..59809cc --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,4 @@ +{ + "$schema": "build.schema.json", + "Solution": "RestApia.Shared.sln" +} From 3b42ee4159b1d43402b0bc28eb4ef027bbb0fdbd Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 15:06:56 +0200 Subject: [PATCH 4/6] make local nuget repo only for Debug config --- nuget.config => nuget.Debug.config | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nuget.config => nuget.Debug.config (100%) diff --git a/nuget.config b/nuget.Debug.config similarity index 100% rename from nuget.config rename to nuget.Debug.config From 416a2196f197f2d167b29500f665f246bb4d4279 Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 15:18:18 +0200 Subject: [PATCH 5/6] fix dependencies --- nuget.Debug.config | 6 ------ src/Directory.Build.props | 1 - src/Extensions/Directory.Build.props | 17 ++++++++--------- src/RestApia.Shared/RestApia.Shared.csproj | 8 -------- 4 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 nuget.Debug.config diff --git a/nuget.Debug.config b/nuget.Debug.config deleted file mode 100644 index 94714a1..0000000 --- a/nuget.Debug.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b956c0a..f4a237b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -40,5 +40,4 @@ - \ No newline at end of file diff --git a/src/Extensions/Directory.Build.props b/src/Extensions/Directory.Build.props index e3105dd..90224b6 100644 --- a/src/Extensions/Directory.Build.props +++ b/src/Extensions/Directory.Build.props @@ -12,16 +12,15 @@ - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/src/RestApia.Shared/RestApia.Shared.csproj b/src/RestApia.Shared/RestApia.Shared.csproj index 9138357..b034137 100644 --- a/src/RestApia.Shared/RestApia.Shared.csproj +++ b/src/RestApia.Shared/RestApia.Shared.csproj @@ -14,12 +14,4 @@ - - - - - - - - From db6e1734a80a8366f0ee521c3d4b24dce33723ad Mon Sep 17 00:00:00 2001 From: Nick Rimmer Date: Thu, 17 Oct 2024 15:21:55 +0200 Subject: [PATCH 6/6] rub actions on windows --- .build/Pipelines/GitHubActions.cs | 4 ++-- .build/Targets/Solution_Targets.cs | 1 + .github/workflows/cd-publish-extension.yml | 6 +++--- .github/workflows/cd-publish-shared.yml | 6 +++--- build.cmd | 0 5 files changed, 9 insertions(+), 8 deletions(-) mode change 100644 => 100755 build.cmd diff --git a/.build/Pipelines/GitHubActions.cs b/.build/Pipelines/GitHubActions.cs index 970a1d0..e25b8c0 100644 --- a/.build/Pipelines/GitHubActions.cs +++ b/.build/Pipelines/GitHubActions.cs @@ -8,7 +8,7 @@ [GitHubActions( "cd-publish-shared", - GitHubActionsImage.UbuntuLatest, + GitHubActionsImage.WindowsLatest, InvokedTargets = [ nameof(Shared_Push), ], @@ -18,7 +18,7 @@ [GitHubActions( "cd-publish-extension", - GitHubActionsImage.UbuntuLatest, + GitHubActionsImage.WindowsLatest, InvokedTargets = [ nameof(Extension_Push), ], diff --git a/.build/Targets/Solution_Targets.cs b/.build/Targets/Solution_Targets.cs index 2a520da..2ef32be 100644 --- a/.build/Targets/Solution_Targets.cs +++ b/.build/Targets/Solution_Targets.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using Nuke.Common; +using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; using static Nuke.Common.Tools.DotNet.DotNetTasks; diff --git a/.github/workflows/cd-publish-extension.yml b/.github/workflows/cd-publish-extension.yml index 9b093e2..0d44801 100644 --- a/.github/workflows/cd-publish-extension.yml +++ b/.github/workflows/cd-publish-extension.yml @@ -27,9 +27,9 @@ on: required: true jobs: - ubuntu-latest: - name: ubuntu-latest - runs-on: ubuntu-latest + windows-latest: + name: windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: 'Cache: .nuke/temp, ~/.nuget/packages' diff --git a/.github/workflows/cd-publish-shared.yml b/.github/workflows/cd-publish-shared.yml index 9ef90af..976aa7a 100644 --- a/.github/workflows/cd-publish-shared.yml +++ b/.github/workflows/cd-publish-shared.yml @@ -24,9 +24,9 @@ on: required: false jobs: - ubuntu-latest: - name: ubuntu-latest - runs-on: ubuntu-latest + windows-latest: + name: windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: 'Cache: .nuke/temp, ~/.nuget/packages' diff --git a/build.cmd b/build.cmd old mode 100644 new mode 100755