From df10ec22f9360f830271ce94c2b72c1e7433c7f7 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 8 Sep 2024 16:03:03 +0200 Subject: [PATCH 1/6] :construction_worker: switch from AzDO to GHA --- .azure/jobs/build-development.yml | 118 ----------------- .azure/jobs/build-production.yml | 100 -------------- .azure/jobs/deployment-development.yml | 28 ---- .azure/jobs/deployment-production.yml | 31 ----- .azure/jobs/finalization.yml | 14 -- .azure/pipelines.yml | 48 ------- .azure/stages/production.yml | 71 ---------- .azure/steps/build-net.yml | 14 -- .azure/steps/codecov.yml | 4 - .azure/steps/dotnet.yml | 5 - .azure/steps/download-snk.yml | 12 -- .azure/steps/install-minvertool.yml | 7 - .azure/steps/install-reportgenerator.yml | 8 -- .azure/steps/minverversion-override.yml | 14 -- .azure/steps/publish-artifact.yml | 18 --- .azure/steps/publish-nuget.yml | 36 ------ .azure/steps/restore.yml | 9 -- .azure/steps/sonarcloud-finalize.yml | 10 -- .azure/steps/sonarcloud-prepare.yml | 21 --- .azure/steps/unit-test.yml | 30 ----- .azure/steps/update-buildnumber.yml | 5 - .github/workflows/pipelines.yml | 158 +++++++++++++++++++++++ 22 files changed, 158 insertions(+), 603 deletions(-) delete mode 100644 .azure/jobs/build-development.yml delete mode 100644 .azure/jobs/build-production.yml delete mode 100644 .azure/jobs/deployment-development.yml delete mode 100644 .azure/jobs/deployment-production.yml delete mode 100644 .azure/jobs/finalization.yml delete mode 100644 .azure/pipelines.yml delete mode 100644 .azure/stages/production.yml delete mode 100644 .azure/steps/build-net.yml delete mode 100644 .azure/steps/codecov.yml delete mode 100644 .azure/steps/dotnet.yml delete mode 100644 .azure/steps/download-snk.yml delete mode 100644 .azure/steps/install-minvertool.yml delete mode 100644 .azure/steps/install-reportgenerator.yml delete mode 100644 .azure/steps/minverversion-override.yml delete mode 100644 .azure/steps/publish-artifact.yml delete mode 100644 .azure/steps/publish-nuget.yml delete mode 100644 .azure/steps/restore.yml delete mode 100644 .azure/steps/sonarcloud-finalize.yml delete mode 100644 .azure/steps/sonarcloud-prepare.yml delete mode 100644 .azure/steps/unit-test.yml delete mode 100644 .azure/steps/update-buildnumber.yml create mode 100644 .github/workflows/pipelines.yml diff --git a/.azure/jobs/build-development.yml b/.azure/jobs/build-development.yml deleted file mode 100644 index 719e9fa..0000000 --- a/.azure/jobs/build-development.yml +++ /dev/null @@ -1,118 +0,0 @@ -jobs: - - job: BuildDotNet8_0 - displayName: 'Build preview (net8, build)' - timeoutInMinutes: 15 - strategy: - matrix: - Linux_Build_and_Test: - imageName: ${{ parameters.linuxVmImage }} - Windows_Build_Test_and_Package: - imageName: ${{ parameters.windowsVmImage }} - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: $(imageName) - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: $(imageName) - variables: - - name: DotnetBuildName - value: 'net8.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net8.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "previewSrc" - - - job: BuildDotNet7_0 - displayName: 'Build preview (net7, build)' - timeoutInMinutes: 15 - strategy: - matrix: - Linux_Build_and_Test: - imageName: ${{ parameters.linuxVmImage }} - Windows_Build_Test_and_Package: - imageName: ${{ parameters.windowsVmImage }} - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: $(imageName) - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: $(imageName) - variables: - - name: DotnetBuildName - value: 'net7.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net7.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "previewSrc" - - - job: BuildDotNet6_0 - displayName: 'Build preview (net6, build)' - timeoutInMinutes: 15 - strategy: - matrix: - Linux_Build_and_Test: - imageName: ${{ parameters.linuxVmImage }} - Windows_Build_Test_and_Package: - imageName: ${{ parameters.windowsVmImage }} - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: $(imageName) - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: $(imageName) - variables: - - name: DotnetBuildName - value: 'net6.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net6.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "previewSrc" - - - job: PublishBuildArtifacts - condition: succeeded() - dependsOn: - - BuildDotNet8_0 - - BuildDotNet7_0 - - BuildDotNet6_0 - displayName: 'Store NuGet Packages for Preview' - timeoutInMinutes: 30 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.windowsVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.windowsVmImage }} - variables: - - name: ArtifactPackageName - value: 'Preview' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/publish-nuget.yml - parameters: - artifactName: "previewSrc" - artifactPackages: - - "net8.0" - - "net7.0" - - "net6.0" \ No newline at end of file diff --git a/.azure/jobs/build-production.yml b/.azure/jobs/build-production.yml deleted file mode 100644 index d1220a1..0000000 --- a/.azure/jobs/build-production.yml +++ /dev/null @@ -1,100 +0,0 @@ -jobs: - - job: BuildDotNet8_0 - displayName: 'Build final (net8.0, build)' - timeoutInMinutes: 15 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.windowsVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.windowsVmImage }} - variables: - - name: DotnetBuildName - value: 'net8.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net8.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "productionSrc" - - - job: BuildDotNet7_0 - displayName: 'Build final (net7.0, build)' - timeoutInMinutes: 15 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.windowsVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.windowsVmImage }} - variables: - - name: DotnetBuildName - value: 'net7.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net7.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "productionSrc" - - - job: BuildDotNet6_0 - displayName: 'Build final (net6.0, build)' - timeoutInMinutes: 15 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.windowsVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.windowsVmImage }} - variables: - - name: DotnetBuildName - value: 'net6.0' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/download-snk.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/restore.yml - - template: ../steps/build-net.yml - parameters: - targetFramework: "net6.0" - - template: ../steps/publish-artifact.yml - parameters: - artifactName: "productionSrc" - - - job: PublishBuildArtifacts - condition: succeeded() - dependsOn: - - BuildDotNet8_0 - - BuildDotNet7_0 - - BuildDotNet6_0 - displayName: 'Store NuGet Packages for Production' - timeoutInMinutes: 30 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.windowsVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.windowsVmImage }} - variables: - - name: ArtifactPackageName - value: 'Production' - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/publish-nuget.yml - parameters: - artifactName: "productionSrc" - artifactPackages: - - "net8.0" - - "net7.0" - - "net6.0" \ No newline at end of file diff --git a/.azure/jobs/deployment-development.yml b/.azure/jobs/deployment-development.yml deleted file mode 100644 index fd17e8a..0000000 --- a/.azure/jobs/deployment-development.yml +++ /dev/null @@ -1,28 +0,0 @@ -jobs: - - deployment: CD - displayName: 'Preview: release to private NuGet Feed' - environment: 'Development' - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.linuxVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.linuxVmImage }} - strategy: - runOnce: - deploy: - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download the build artifacts' - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'Preview' - downloadPath: '$(System.DefaultWorkingDirectory)' - - - task: NuGetCommand@2 - displayName: 'Publish NuGet Packages to https://nuget.codebelt.net/v3/index.json' - inputs: - command: push - packagesToPush: '$(System.DefaultWorkingDirectory)/**/*.nupkg;$(System.DefaultWorkingDirectory)/**/*.snupkg' - nuGetFeedType: external - publishFeedCredentials: 'Codebelt-Nuget' \ No newline at end of file diff --git a/.azure/jobs/deployment-production.yml b/.azure/jobs/deployment-production.yml deleted file mode 100644 index 664023e..0000000 --- a/.azure/jobs/deployment-production.yml +++ /dev/null @@ -1,31 +0,0 @@ -jobs: - - deployment: CD - displayName: 'Release to public NuGet Feed' - environment: 'Production' - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.linuxVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.linuxVmImage }} - strategy: - runOnce: - deploy: - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download the build artifacts' - inputs: - buildType: 'current' - downloadType: 'single' - artifactName: 'Production' - downloadPath: '$(System.DefaultWorkingDirectory)' - - - task: NuGetToolInstaller@1 - displayName: Install NuGet - inputs: - versionSpec: 6.8.0 - - - task: NuGetCommand@2 - displayName: 'Publish NuGet Packages to https://api.nuget.org/v3/index.json' - inputs: - command: custom - arguments: 'push $(System.DefaultWorkingDirectory)/**/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $(nuget-official-apikey) -SkipDuplicate' \ No newline at end of file diff --git a/.azure/jobs/finalization.yml b/.azure/jobs/finalization.yml deleted file mode 100644 index 238eadf..0000000 --- a/.azure/jobs/finalization.yml +++ /dev/null @@ -1,14 +0,0 @@ -jobs: - - job: Finalizer - displayName: 'Update BUILD_NUMBER (finalizer)' - timeoutInMinutes: 15 - pool: - ${{ if eq(parameters.selfHosted, 'true') }}: - name: ${{ parameters.linuxVmImage }} - ${{ if eq(parameters.selfHosted, 'false') }}: - vmImage: ${{ parameters.linuxVmImage }} - steps: - - template: ../steps/dotnet.yml - - template: ../steps/install-minvertool.yml - - template: ../steps/minverversion-override.yml - - template: ../steps/update-buildnumber.yml \ No newline at end of file diff --git a/.azure/pipelines.yml b/.azure/pipelines.yml deleted file mode 100644 index dd7b857..0000000 --- a/.azure/pipelines.yml +++ /dev/null @@ -1,48 +0,0 @@ -parameters: - - name: selfHosted - displayName: 'Use Self-Hosted Agents' - default: false - type: boolean - - name: linuxVmImage - displayName: 'Linux VM Image' - default: 'ubuntu-22.04' - type: string - values: - - 'ubuntu-20.04' - - 'ubuntu-22.04' - - name: windowsVmImage - displayName: 'Windows VM Image' - default: 'windows-2022' - type: string - values: - - 'windows-2019' - - 'windows-2022' - -name: $(DayOfYear)$(Rev:rr) - -trigger: - branches: - include: - - main - paths: - exclude: - - .azure - - .docfx - - .github - - .nuget - - LICENSE.md - - README.md - -variables: - - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE - value: true - - name: DOTNET_CLI_TELEMETRY_OPTOUT - value: 1 - -stages: - - ${{ if endsWith(variables['build.sourceBranch'], 'main') }}: - - template: stages/production.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} \ No newline at end of file diff --git a/.azure/stages/production.yml b/.azure/stages/production.yml deleted file mode 100644 index 699e981..0000000 --- a/.azure/stages/production.yml +++ /dev/null @@ -1,71 +0,0 @@ -stages: - - stage: BuildDevelopment - displayName: 'Build for preview' - condition: and(succeeded(), endsWith(variables['build.sourceBranch'], 'main')) - variables: - - group: BuildSecrets - - name: BuildSource - value: 'src' - - name: BuildConfiguration - value: 'Debug' - jobs: - - template: ../jobs/build-development.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} - - - stage: BuildMain - displayName: 'Build for production' - condition: and(succeeded(), endsWith(variables['build.sourceBranch'], 'main')) - variables: - - group: BuildSecrets - - name: BuildSource - value: 'src' - - name: BuildConfiguration - value: 'Release' - jobs: - - template: ../jobs/build-production.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} - - - stage: UpdateBuildNumber - displayName: 'Updating BUILD_BUILDNUMBER for main branch' - condition: and(succeeded(), endsWith(variables['build.sourceBranch'], 'main')) - dependsOn: - - BuildDevelopment - - BuildMain - jobs: - - template: ../jobs/finalization.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} - - - stage: DeployDevelopment - displayName: 'Deployment for development branch' - condition: and(succeeded(), endsWith(variables['build.sourceBranch'], 'main')) - dependsOn: UpdateBuildNumber - variables: - - group: BuildSecrets - jobs: - - template: ../jobs/deployment-development.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} - - - stage: DeployMain - displayName: 'Deployment for main branch' - condition: and(succeeded(), endsWith(variables['build.sourceBranch'], 'main')) - dependsOn: UpdateBuildNumber - variables: - - group: BuildSecrets - jobs: - - template: ../jobs/deployment-production.yml - parameters: - selfHosted: ${{ parameters.selfHosted }} - linuxVmImage: ${{ parameters.linuxVmImage }} - windowsVmImage: ${{ parameters.windowsVmImage }} \ No newline at end of file diff --git a/.azure/steps/build-net.yml b/.azure/steps/build-net.yml deleted file mode 100644 index 13d8c6d..0000000 --- a/.azure/steps/build-net.yml +++ /dev/null @@ -1,14 +0,0 @@ -parameters: - - name: targetFramework - type: string - default: net8.0 - -steps: - - task: DotNetCoreCLI@2 - displayName: 'Build ${{ parameters.targetFramework }} compatible Assemblies' - inputs: - command: build - projects: | - src/**/*.csproj - arguments: '--configuration $(BuildConfiguration) --verbosity quiet --no-restore --framework ${{ parameters.targetFramework }}' - workingDirectory: '$(BuildSource)' \ No newline at end of file diff --git a/.azure/steps/codecov.yml b/.azure/steps/codecov.yml deleted file mode 100644 index 411f35a..0000000 --- a/.azure/steps/codecov.yml +++ /dev/null @@ -1,4 +0,0 @@ -steps: - - bash: bash <(curl -s https://codecov.io/bash) - condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - displayName: 'Upload to codecov.io' \ No newline at end of file diff --git a/.azure/steps/dotnet.yml b/.azure/steps/dotnet.yml deleted file mode 100644 index a916cde..0000000 --- a/.azure/steps/dotnet.yml +++ /dev/null @@ -1,5 +0,0 @@ -steps: - - task: UseDotNet@2 - displayName: 'Use .Net SDK 8.0.x' - inputs: - version: 8.0.x \ No newline at end of file diff --git a/.azure/steps/download-snk.yml b/.azure/steps/download-snk.yml deleted file mode 100644 index 75afe2b..0000000 --- a/.azure/steps/download-snk.yml +++ /dev/null @@ -1,12 +0,0 @@ -steps: - - task: DownloadSecureFile@1 - displayName: 'Download bootstrapper.snk' - inputs: - secureFile: 'bootstrapper.snk' - - - task: CopyFiles@2 - displayName: 'Copy bootstrapper.snk to $(System.DefaultWorkingDirectory)' - inputs: - SourceFolder: '$(Agent.TempDirectory)' - Contents: bootstrapper.snk - TargetFolder: '$(System.DefaultWorkingDirectory)' \ No newline at end of file diff --git a/.azure/steps/install-minvertool.yml b/.azure/steps/install-minvertool.yml deleted file mode 100644 index a336bb5..0000000 --- a/.azure/steps/install-minvertool.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: - - task: DotNetCoreCLI@2 - displayName: 'Install MinVer tool' - inputs: - command: custom - custom: tool - arguments: 'update --global minver-cli' \ No newline at end of file diff --git a/.azure/steps/install-reportgenerator.yml b/.azure/steps/install-reportgenerator.yml deleted file mode 100644 index 4ae0386..0000000 --- a/.azure/steps/install-reportgenerator.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: - - task: DotNetCoreCLI@2 - condition: eq(variables['Agent.OS'], 'Linux') - displayName: 'Install ReportGenerator tool' - inputs: - command: custom - custom: tool - arguments: update --global dotnet-reportgenerator-globaltool \ No newline at end of file diff --git a/.azure/steps/minverversion-override.yml b/.azure/steps/minverversion-override.yml deleted file mode 100644 index 6f3ffb1..0000000 --- a/.azure/steps/minverversion-override.yml +++ /dev/null @@ -1,14 +0,0 @@ -steps: - - script: | - export MINVERVERSIONOVERRIDE=$(minver) - echo $MINVERVERSIONOVERRIDE - echo "##vso[task.setvariable variable=MINVERVERSIONOVERRIDE;]$MINVERVERSIONOVERRIDE" - displayName: 'Set MINVERVERSIONOVERRIDE (for MinVer)' - condition: eq(variables['Agent.OS'], 'Linux') - - - script: | - minver > v.txt - set /p MINVERVERSIONOVERRIDE= Date: Sun, 8 Sep 2024 16:08:06 +0200 Subject: [PATCH 2/6] :arrow_up: bump dependencies :heavy_minus_sign: removed support for .net7 --- Directory.Build.props | 30 ++++++++++--------- Directory.Build.targets | 11 +------ .../Codebelt.Bootstrapper.WebApi.App.csproj | 2 +- .../Codebelt.Bootstrapper.WebApp.App.csproj | 8 ++--- .../Codebelt.Bootstrapper.WebMvc.App.csproj | 8 ++--- .../Codebelt.Bootstrapper.Web.csproj | 2 +- .../Codebelt.Bootstrapper.csproj | 4 +-- 7 files changed, 25 insertions(+), 40 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 38cbda2..471c164 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,24 +3,26 @@ $(MSBuildProjectName.EndsWith('Tests')) $(MSBuildProjectName.EndsWith('App')) true + false + latest - + true true - net8.0;net7.0;net6.0 + net8.0;net6.0 Copyright © Geekle 2021-2024. All rights reserved. gimlichael Geekle - Codebelt - Console Bootstrapper + Codebelt Bootstrapper icon.png README.md https://www.codebelt.net/ MIT - https://github.com/codebeltnet/classlib-bootstrapper + https://github.com/codebeltnet/bootstrapper git en-US true @@ -28,23 +30,23 @@ true snupkg true - true + true $(MSBuildThisFileDirectory)bootstrapper.snk - + - + - net8.0;net7.0;net6.0 + net8.0;net6.0 false false false @@ -55,23 +57,23 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 3c3f8ab..b719a7f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,13 +1,4 @@  - - - <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> - - - ..\..\.nuget\$(MSBuildProjectName)\PackageReleaseNotes.txt @@ -27,4 +18,4 @@ $(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_BUILDNUMBER) - \ No newline at end of file + diff --git a/app/Codebelt.Bootstrapper.WebApi.App/Codebelt.Bootstrapper.WebApi.App.csproj b/app/Codebelt.Bootstrapper.WebApi.App/Codebelt.Bootstrapper.WebApi.App.csproj index 7ff39fc..741352e 100644 --- a/app/Codebelt.Bootstrapper.WebApi.App/Codebelt.Bootstrapper.WebApi.App.csproj +++ b/app/Codebelt.Bootstrapper.WebApi.App/Codebelt.Bootstrapper.WebApi.App.csproj @@ -1,7 +1,7 @@ - + diff --git a/app/Codebelt.Bootstrapper.WebApp.App/Codebelt.Bootstrapper.WebApp.App.csproj b/app/Codebelt.Bootstrapper.WebApp.App/Codebelt.Bootstrapper.WebApp.App.csproj index 9a00f7a..01cec98 100644 --- a/app/Codebelt.Bootstrapper.WebApp.App/Codebelt.Bootstrapper.WebApp.App.csproj +++ b/app/Codebelt.Bootstrapper.WebApp.App/Codebelt.Bootstrapper.WebApp.App.csproj @@ -5,15 +5,11 @@ - - - - - + - + diff --git a/app/Codebelt.Bootstrapper.WebMvc.App/Codebelt.Bootstrapper.WebMvc.App.csproj b/app/Codebelt.Bootstrapper.WebMvc.App/Codebelt.Bootstrapper.WebMvc.App.csproj index 9a00f7a..01cec98 100644 --- a/app/Codebelt.Bootstrapper.WebMvc.App/Codebelt.Bootstrapper.WebMvc.App.csproj +++ b/app/Codebelt.Bootstrapper.WebMvc.App/Codebelt.Bootstrapper.WebMvc.App.csproj @@ -5,15 +5,11 @@ - - - - - + - + diff --git a/src/Codebelt.Bootstrapper.Web/Codebelt.Bootstrapper.Web.csproj b/src/Codebelt.Bootstrapper.Web/Codebelt.Bootstrapper.Web.csproj index d7a818b..85eb5da 100644 --- a/src/Codebelt.Bootstrapper.Web/Codebelt.Bootstrapper.Web.csproj +++ b/src/Codebelt.Bootstrapper.Web/Codebelt.Bootstrapper.Web.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Codebelt.Bootstrapper/Codebelt.Bootstrapper.csproj b/src/Codebelt.Bootstrapper/Codebelt.Bootstrapper.csproj index 74a8b2c..aed97bf 100644 --- a/src/Codebelt.Bootstrapper/Codebelt.Bootstrapper.csproj +++ b/src/Codebelt.Bootstrapper/Codebelt.Bootstrapper.csproj @@ -6,9 +6,9 @@ - + - + From 461cf87d223f7ceff3c62766f8e1b8c58f2832b2 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 8 Sep 2024 16:11:08 +0200 Subject: [PATCH 3/6] :recycle: refactored WebProgram and WebStartup to be consistent with newer version of .net --- app/Codebelt.Bootstrapper.Web.App/Startup.cs | 4 +++- app/Codebelt.Bootstrapper.WebApi.App/Startup.cs | 4 +++- app/Codebelt.Bootstrapper.WebApp.App/Startup.cs | 4 +++- app/Codebelt.Bootstrapper.WebMvc.App/Startup.cs | 4 +++- src/Codebelt.Bootstrapper.Web/WebProgram.cs | 10 ---------- src/Codebelt.Bootstrapper.Web/WebStartup.cs | 14 +++++++++----- src/Codebelt.Bootstrapper/StartupFactory.cs | 2 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/app/Codebelt.Bootstrapper.Web.App/Startup.cs b/app/Codebelt.Bootstrapper.Web.App/Startup.cs index 3009fb3..9107cf9 100644 --- a/app/Codebelt.Bootstrapper.Web.App/Startup.cs +++ b/app/Codebelt.Bootstrapper.Web.App/Startup.cs @@ -18,8 +18,10 @@ public override void ConfigureServices(IServiceCollection services) { } - public override void Configure(IApplicationBuilder app, ILogger logger) + public override void ConfigurePipeline(IApplicationBuilder app) { + var logger = app.ApplicationServices.GetRequiredService>(); + if (Environment.IsLocalDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/app/Codebelt.Bootstrapper.WebApi.App/Startup.cs b/app/Codebelt.Bootstrapper.WebApi.App/Startup.cs index ed5152c..43760b7 100644 --- a/app/Codebelt.Bootstrapper.WebApi.App/Startup.cs +++ b/app/Codebelt.Bootstrapper.WebApi.App/Startup.cs @@ -24,8 +24,10 @@ public override void ConfigureServices(IServiceCollection services) }); } - public override void Configure(IApplicationBuilder app, ILogger logger) + public override void ConfigurePipeline(IApplicationBuilder app) { + var logger = app.ApplicationServices.GetRequiredService>(); + if (Environment.IsLocalDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/app/Codebelt.Bootstrapper.WebApp.App/Startup.cs b/app/Codebelt.Bootstrapper.WebApp.App/Startup.cs index ac98a78..f182645 100644 --- a/app/Codebelt.Bootstrapper.WebApp.App/Startup.cs +++ b/app/Codebelt.Bootstrapper.WebApp.App/Startup.cs @@ -19,8 +19,10 @@ public override void ConfigureServices(IServiceCollection services) services.AddRazorPages(); } - public override void Configure(IApplicationBuilder app, ILogger logger) + public override void ConfigurePipeline(IApplicationBuilder app) { + var logger = app.ApplicationServices.GetRequiredService>(); + if (Environment.IsLocalDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/app/Codebelt.Bootstrapper.WebMvc.App/Startup.cs b/app/Codebelt.Bootstrapper.WebMvc.App/Startup.cs index 828e559..f74d2a5 100644 --- a/app/Codebelt.Bootstrapper.WebMvc.App/Startup.cs +++ b/app/Codebelt.Bootstrapper.WebMvc.App/Startup.cs @@ -19,8 +19,10 @@ public override void ConfigureServices(IServiceCollection services) services.AddControllersWithViews(); } - public override void Configure(IApplicationBuilder app, ILogger logger) + public override void ConfigurePipeline(IApplicationBuilder app) { + var logger = app.ApplicationServices.GetRequiredService>(); + if (Environment.IsLocalDevelopment()) { app.UseDeveloperExceptionPage(); diff --git a/src/Codebelt.Bootstrapper.Web/WebProgram.cs b/src/Codebelt.Bootstrapper.Web/WebProgram.cs index c42ee5e..f3286e6 100644 --- a/src/Codebelt.Bootstrapper.Web/WebProgram.cs +++ b/src/Codebelt.Bootstrapper.Web/WebProgram.cs @@ -1,8 +1,6 @@ using System; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace Codebelt.Bootstrapper.Web { @@ -24,14 +22,6 @@ private static Func InitializeCreateHostBuilderCallback( .UseBootstrapperLifetime() .ConfigureWebHostDefaults(webBuilder => { - webBuilder.ConfigureServices(services => - { - var logger = services.BuildServiceProvider().GetService>(); - if (logger != null) - { - services.AddSingleton(logger); // we need a non-generic variant of the logger for WebStartup/Startup - } - }); webBuilder.UseStartup(); }); } diff --git a/src/Codebelt.Bootstrapper.Web/WebStartup.cs b/src/Codebelt.Bootstrapper.Web/WebStartup.cs index 4731cfa..e38ccc7 100644 --- a/src/Codebelt.Bootstrapper.Web/WebStartup.cs +++ b/src/Codebelt.Bootstrapper.Web/WebStartup.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace Codebelt.Bootstrapper.Web { @@ -20,13 +20,17 @@ protected WebStartup(IConfiguration configuration, IHostEnvironment environment) { } - + /// + /// Configures the application pipeline. + /// + /// The for the application to configure. + public abstract void ConfigurePipeline(IApplicationBuilder app); /// - /// Configures the application. + /// Delegates the application pipeline configuration to . /// /// The for the application to configure. - /// The to write to. - public abstract void Configure(IApplicationBuilder app, ILogger logger); + /// This method is necessary as we rely on built-in convention based bootstrapping (>). + public void Configure(IApplicationBuilder app) => ConfigurePipeline(app); } } diff --git a/src/Codebelt.Bootstrapper/StartupFactory.cs b/src/Codebelt.Bootstrapper/StartupFactory.cs index 0748126..c4e4462 100644 --- a/src/Codebelt.Bootstrapper/StartupFactory.cs +++ b/src/Codebelt.Bootstrapper/StartupFactory.cs @@ -38,7 +38,7 @@ public TStartup CreateInstance(out IServiceCollection services) where { var startup = (TStartup) Activator.CreateInstance(typeof(TStartup), _configuration, _environment); startup?.ConfigureServices(_services); - services =_services; + services = _services; return startup; } } From 383df111fdeeeaee1ea0663d56a9c2cc3ba4618d Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 8 Sep 2024 16:12:22 +0200 Subject: [PATCH 4/6] :speech_balloon: added default community health files --- .github/CODE_OF_CONDUCT.md | 135 +++++++++++++++++++++++++++++++++++++ .github/CONTRIBUTING.md | 53 +++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e27edb4 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,135 @@ +# Contributor Covenant Code of Conduct + +This document is adapted from the Contributor Covenant which is used by many open source projects, +including those under the [.NET Foundation](https://dotnetfoundation.org/code-of-conduct). + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..87b0e3d --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to Bootstrapper +When contributing to this repository, please first discuss the change you wish to make via issue, +email, or any other method with the owners of this repository before making a change. + +Please note we have a code of conduct, please follow it in all your interactions with the project. + +## Code of Conduct +Please review our [code of conduct](CODE_OF_CONDUCT.md). + +## Our Development Process +We have opted for the [Trunk Based Development](https://trunkbaseddevelopment.com/) branching model as it is a good fit for DevSecOps practices. +All new features and/or fixes are merged into the `main` branch by creating a Pull Request. + +## Pull Requests +We actively welcome your pull requests. + +1. Fork the repo and create your branch from `main` +2. If you've added code that should be tested, add tests (DO follow [Microsoft Engineering Guidelines](https://github.com/dotnet/aspnetcore/wiki/Engineering-guidelines)) +3. Any changes or additions requires documentation in the form of documenting public members +4. Ensure that all existing as well as new test passes +5. Issue that pull request with a big and heartful thanks for contributing + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +## Coding Guidelines +* Please follow Framework Design Guidelines +* Please follow SOLID principles +* Make sure you have familiarized yourself with [Cuemon for .NET - Concept Reference](https://docs.cuemon.net/api/index.html) +* Consider reading my short take on [Software craftsmanship - a journey with inspirational sources!](https://github.com/gimlichael/Must-Read-Resources) + +## Manifesto +As aspiring Software Craftsmen we are raising the bar of professional software development by practicing it and helping others learn the craft. + +Through this work we have come to value: + +* Not only working software, +but also well-crafted software +* Not only responding to change, +but also steadily adding value +* Not only individuals and interactions, +but also a community of professionals +* Not only customer collaboration, +but also productive partnerships + +That is, in pursuit of the items on the left we have found the items on the right to be indispensable. + +[Manifesto for Software Craftsmanship](https://manifesto.softwarecraftsmanship.org/) is the originator of this text. + +## License +By contributing to Bootstrapper, you agree that your contributions will be licensed +under the MIT license. From 971b2aa3d92310f9640502a64273f1a4fc4f1d77 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 8 Sep 2024 16:21:00 +0200 Subject: [PATCH 5/6] :construction_worker: added condition for skipsignassembly --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 471c164..2cc2084 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -30,7 +30,7 @@ true snupkg true - true + true $(MSBuildThisFileDirectory)bootstrapper.snk From d95e620c69f15f3ea040f99241f4b1f0a9470d3e Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 8 Sep 2024 20:21:58 +0200 Subject: [PATCH 6/6] :speech_balloon: updated release notes --- .../PackageReleaseNotes.txt | 9 ++++++++- .../PackageReleaseNotes.txt | 12 +++++++++++- .../PackageReleaseNotes.txt | 9 ++++++++- .nuget/Codebelt.Bootstrapper/PackageReleaseNotes.txt | 9 ++++++++- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.nuget/Codebelt.Bootstrapper.Console/PackageReleaseNotes.txt b/.nuget/Codebelt.Bootstrapper.Console/PackageReleaseNotes.txt index 15d808b..0309ab7 100644 --- a/.nuget/Codebelt.Bootstrapper.Console/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Bootstrapper.Console/PackageReleaseNotes.txt @@ -1,4 +1,11 @@ -Version: 1.2.0 +Version: 2.0.0 +Availability: .NET 6.0 and .NET 8.0 +  +# ALM +- REMOVED TFM for net7.0 +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +Version: 1.2.0 Availability: .NET 6.0, .NET 7.0, .NET 8.0   # ALM diff --git a/.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt b/.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt index 628f2b3..26cc0ed 100644 --- a/.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt @@ -1,4 +1,14 @@ -Version: 1.2.0 +Version: 2.0.0 +Availability: .NET 6.0 and .NET 8.0 +  +# ALM +- REMOVED TFM for net7.0 +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +# Breaking Changes +- CHANGED WebStartup class in the Codebelt.Bootstrapper.Web namespace to provide a new abstraction; ConfigurePipeline(IApplicationBuilder) and removed ILogger parameter from Configure method +  +Version: 1.2.0 Availability: .NET 6.0, .NET 7.0, .NET 8.0   # ALM diff --git a/.nuget/Codebelt.Bootstrapper.Worker/PackageReleaseNotes.txt b/.nuget/Codebelt.Bootstrapper.Worker/PackageReleaseNotes.txt index 41a93e6..37f507c 100644 --- a/.nuget/Codebelt.Bootstrapper.Worker/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Bootstrapper.Worker/PackageReleaseNotes.txt @@ -1,4 +1,11 @@ -Version: 1.2.0 +Version: 2.0.0 +Availability: .NET 6.0 and .NET 8.0 +  +# ALM +- REMOVED TFM for net7.0 +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +Version: 1.2.0 Availability: .NET 6.0, .NET 7.0, .NET 8.0   # ALM diff --git a/.nuget/Codebelt.Bootstrapper/PackageReleaseNotes.txt b/.nuget/Codebelt.Bootstrapper/PackageReleaseNotes.txt index 8878da2..899fa70 100644 --- a/.nuget/Codebelt.Bootstrapper/PackageReleaseNotes.txt +++ b/.nuget/Codebelt.Bootstrapper/PackageReleaseNotes.txt @@ -1,4 +1,11 @@ -Version: 1.2.0 +Version: 2.0.0 +Availability: .NET 6.0 and .NET 8.0 +  +# ALM +- REMOVED TFM for net7.0 +- CHANGED Dependencies to latest and greatest with respect to TFMs +  +Version: 1.2.0 Availability: .NET 6.0, .NET 7.0, .NET 8.0   # ALM