From a338ac5b36ab181e77edb4d8f61c21de13b96b7b Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 01:16:26 +0100 Subject: [PATCH 01/10] :memo: updated DocFX --- .docfx/includes/availability-all.md | 2 +- .docfx/includes/availability-default.md | 2 +- .docfx/includes/availability-hybrid.md | 2 +- .docfx/includes/availability-modern.md | 2 +- .docfx/toc.yml | 8 -------- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.docfx/includes/availability-all.md b/.docfx/includes/availability-all.md index 40f1101c8..3cc6f5cac 100644 --- a/.docfx/includes/availability-all.md +++ b/.docfx/includes/availability-all.md @@ -1 +1 @@ -Availability: .NET 8, .NET 6, .NET Standard 2.1 and .NET Standard 2.0 \ No newline at end of file +Availability: .NET 9, .NET 8, .NET Standard 2.1 and .NET Standard 2.0 \ No newline at end of file diff --git a/.docfx/includes/availability-default.md b/.docfx/includes/availability-default.md index f49ad3ff1..89f4c0606 100644 --- a/.docfx/includes/availability-default.md +++ b/.docfx/includes/availability-default.md @@ -1 +1 @@ -Availability: .NET 8, .NET 6 and .NET Standard 2.0 \ No newline at end of file +Availability: .NET 9, .NET 8 and .NET Standard 2.0 \ No newline at end of file diff --git a/.docfx/includes/availability-hybrid.md b/.docfx/includes/availability-hybrid.md index a08c5e979..e31207f8c 100644 --- a/.docfx/includes/availability-hybrid.md +++ b/.docfx/includes/availability-hybrid.md @@ -1 +1 @@ -Availability: .NET 8, .NET 6 and .NET Standard 2.0 (when applicable) or .NET Standard 2.1 (when applicable) \ No newline at end of file +Availability: .NET 9, .NET 8 and .NET Standard 2.0 (when applicable) or .NET Standard 2.1 (when applicable) \ No newline at end of file diff --git a/.docfx/includes/availability-modern.md b/.docfx/includes/availability-modern.md index c3c49daea..abf53694b 100644 --- a/.docfx/includes/availability-modern.md +++ b/.docfx/includes/availability-modern.md @@ -1 +1 @@ -Availability: .NET 8 and .NET 6 \ No newline at end of file +Availability: .NET 9 and .NET 8 \ No newline at end of file diff --git a/.docfx/toc.yml b/.docfx/toc.yml index 5192c820e..08bf7441a 100644 --- a/.docfx/toc.yml +++ b/.docfx/toc.yml @@ -18,13 +18,5 @@ href: api/extensions/aspnet/Cuemon.Extensions.AspNetCore.Configuration.html - name: Other Projects href: api/extensions - expanded: true - items: - - name: Json.NET API - href: api/extensions/jsonnet/Cuemon.Extensions.Newtonsoft.Json.html - - name: Swashbuckle.AspNetCore API - href: api/extensions/swagger/Cuemon.Extensions.Swashbuckle.AspNetCore.html - - name: AWS Signature API - href: api/extensions/awssignature4/Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4.html - name: NuGet href: packages From d2caa86faa6996578271dfb19d832621758c21fd Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 01:16:55 +0100 Subject: [PATCH 02/10] :arrow_up: bump dependencies --- Directory.Packages.props | 37 +++++++++++++++---------------------- testenvironments.json | 2 +- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 24b619633..343ec93a1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,23 +1,21 @@ - true - - - - - - + + + + + - + @@ -25,14 +23,12 @@ - - - + @@ -41,10 +37,9 @@ - + - @@ -53,14 +48,12 @@ - - - - - - - + + + + + + - - + \ No newline at end of file diff --git a/testenvironments.json b/testenvironments.json index d39afbf25..151487cf6 100644 --- a/testenvironments.json +++ b/testenvironments.json @@ -9,7 +9,7 @@ { "name": "Docker-Ubuntu", "type": "docker", - "dockerImage": "gimlichael/ubuntu-testrunner:net6.0.427-net8.0.403-9.0.100-rc.2.24474.11" + "dockerImage": "gimlichael/ubuntu-testrunner:net8.0.404-9.0.100" } ] } From 1cddd3ac29ba10b87af8ef0aad036ebde2999773 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 01:17:24 +0100 Subject: [PATCH 03/10] :construction_worker: updated CI/CD pipeline due to external circular references --- .github/workflows/delayed-pipelines.yml | 307 ++++++++++++++++++++++++ .github/workflows/pipelines.yml | 46 +++- 2 files changed, 351 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/delayed-pipelines.yml diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml new file mode 100644 index 000000000..b1f998771 --- /dev/null +++ b/.github/workflows/delayed-pipelines.yml @@ -0,0 +1,307 @@ +name: Cuemon CI/CD Pipeline (Delayed) +on: + pull_request: + paths-ignore: + - .codecov/** + - .docfx/** + - .github/** + - .nuget/** + - '**.md' + workflow_dispatch: + inputs: + configuration: + type: choice + description: The build configuration to use in the deploy stage. + required: true + default: Release + options: + - Debug + - Release + +jobs: + prepare_linux: + name: ๐Ÿง Prepare Linux + runs-on: ubuntu-22.04 + timeout-minutes: 15 + outputs: + restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - id: dotnet-restore + name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + + prepare_windows: + name: ๐ŸชŸ Prepare Windows + runs-on: windows-2022 + timeout-minutes: 15 + outputs: + restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - id: dotnet-restore + name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + + build: + name: ๐Ÿ› ๏ธ Build + runs-on: ubuntu-22.04 + timeout-minutes: 15 + strategy: + matrix: + configuration: [Debug, Release] + framework: [net9.0, net8.0, netstandard2.1, netstandard2.0] + needs: [prepare_linux] + outputs: + version: ${{ steps.minver-calculate.outputs.version }} + testProjects: ${{ steps.test-projects.outputs.result }} + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - name: Install MinVer + uses: codebeltnet/dotnet-tool-install-minver@v1 + + - id: minver-calculate + name: Calculate Version + uses: codebeltnet/minver-calculate@v2 + + - name: Download cuemon.snk file + uses: codebeltnet/gcp-download-file@v1 + with: + serviceAccountKey: ${{ secrets.GCP_TOKEN }} + bucketName: ${{ secrets.GCP_BUCKETNAME }} + objectName: cuemon.snk + + - name: Set environment variable for projects + run: | + if [ "${{ matrix.framework }}" == "netstandard2.1" ]; then + echo "PROJECTS=src/**/Cuemon.Extensions.IO.csproj src/**/Cuemon.IO.csproj" >> $GITHUB_ENV + elif [ "${{ matrix.framework }}" == "netstandard2.0" ]; then + projects=( + "src/**/Cuemon.Extensions.Globalization.csproj" + ) + echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + else + projects=( + "src/**/Cuemon.Core.App.csproj" + "src/**/Cuemon.Extensions.Globalization.csproj" + ) + echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + fi + shell: bash + + - id: dotnet-build + name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) + uses: codebeltnet/dotnet-build@v2 + with: + projects: ${{ env.PROJECTS }} + configuration: ${{ matrix.configuration }} + framework: ${{ matrix.framework }} + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} + + - id: test-projects + name: Generate matrix for test projects + uses: codebeltnet/shell-globbing@v1 + with: + pattern: test/**/*.csproj + + pack: + name: ๐Ÿ“ฆ Pack + runs-on: ubuntu-22.04 + timeout-minutes: 15 + strategy: + matrix: + configuration: [Debug, Release] + needs: [prepare_linux, build] + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - name: Pack for ${{ matrix.configuration }} + uses: codebeltnet/dotnet-pack@v2 + with: + configuration: ${{ matrix.configuration }} + uploadPackedArtifact: true + version: ${{ needs.build.outputs.version }} + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} + + test: + name: ๐Ÿงช Test + needs: [build, prepare_linux, prepare_windows] + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-2022] + configuration: [Debug, Release] + project: ${{ fromJson(needs.build.outputs.testProjects) }} + runs-on: ${{ matrix.os }} + timeout-minutes: 15 + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - name: Install .NET Tool - Report Generator + uses: codebeltnet/dotnet-tool-install-reportgenerator@v1 + + - name: Spin up SQL Server test dependency for ${{ matrix.configuration }} build + if: ${{ (runner.os == 'Linux' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} + uses: codebeltnet/docker-compose@v1 + with: + command: up + options: --wait + env: + SA_PASSWORD: ${{ secrets.SA_PASSWORD }} + + - name: Test with ${{ matrix.configuration }} build + if: ${{ !(runner.os == 'Windows' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} + uses: codebeltnet/dotnet-test@v3 + with: + projects: ${{ matrix.project }} + configuration: ${{ matrix.configuration }} + restoreCacheKey: ${{ runner.os == 'Linux' && needs.prepare_linux.outputs.restoreCacheKey || needs.prepare_windows.outputs.restoreCacheKey }} + buildSwitches: -p:SkipSignAssembly=true + testArguments: -- RunConfiguration.DisableAppDomain=true + env: + CONNECTIONSTRINGS__ADVENTUREWORKS: ${{ secrets.DB_ADVENTUREWORKS }} + + - name: Take down SQL Server test dependency for ${{ matrix.configuration }} build + if: ${{ (runner.os == 'Linux' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} + uses: codebeltnet/docker-compose@v1 + with: + command: down + + sonarcloud: + name: ๐Ÿ”ฌ Code Quality Analysis + needs: [prepare_linux, build, test] + runs-on: ubuntu-22.04 + timeout-minutes: 25 + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - name: Install .NET Tool - Sonar Scanner + uses: codebeltnet/dotnet-tool-install-sonarscanner@v1 + + - name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} + + - name: Run SonarCloud Analysis + uses: codebeltnet/sonarcloud-scan@v1 + with: + token: ${{ secrets.SONAR_TOKEN }} + organization: geekle + projectKey: Cuemon + version: ${{ needs.build.outputs.version }} + + - name: Build + uses: codebeltnet/dotnet-build@v2 + with: + uploadBuildArtifact: false + buildSwitches: -p:SkipSignAssembly=true + + - name: Finalize SonarCloud Analysis + uses: codebeltnet/sonarcloud-scan-finalize@v1 + with: + token: ${{ secrets.SONAR_TOKEN }} + + codecov: + name: ๐Ÿ“Š Code Coverage Analysis + needs: [build, test] + runs-on: ubuntu-22.04 + timeout-minutes: 15 + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Run CodeCov Analysis + uses: codebeltnet/codecov-scan@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + repository: gimlichael/Cuemon + + codeql: + name: ๐Ÿ›ก๏ธ Security Analysis + needs: [prepare_linux, build, test] + runs-on: ubuntu-22.04 + timeout-minutes: 15 + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} + + - name: Prepare CodeQL SAST Analysis + uses: codebeltnet/codeql-scan@v1 + + - name: Build + uses: codebeltnet/dotnet-build@v2 + with: + uploadBuildArtifact: false + buildSwitches: -p:SkipSignAssembly=true + + - name: Finalize CodeQL SAST Analysis + uses: codebeltnet/codeql-scan-finalize@v1 + + deploy: + if: github.event_name != 'pull_request' + name: ๐Ÿš€ Deploy v${{ needs.build.outputs.version }} + runs-on: ubuntu-22.04 + timeout-minutes: 15 + needs: [build, pack, test, sonarcloud, codecov, codeql] + environment: Production + steps: + - uses: codebeltnet/nuget-push@v1 + with: + token: ${{ secrets.NUGET_TOKEN }} + configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index 5199acc44..57d1316cf 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -114,7 +114,6 @@ jobs: "src/**/Cuemon.Extensions.Data.Integrity.csproj" "src/**/Cuemon.Extensions.DependencyInjection.csproj" "src/**/Cuemon.Extensions.Diagnostics.csproj" - "src/**/Cuemon.Extensions.Globalization.csproj" "src/**/Cuemon.Extensions.Hosting.csproj" "src/**/Cuemon.Extensions.IO.csproj" "src/**/Cuemon.Extensions.Net.csproj" @@ -134,7 +133,50 @@ jobs: ) echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV else - echo "PROJECTS=src/**/*.csproj" >> $GITHUB_ENV + projects=( + "src/**/Cuemon.AspNetCore.csproj" + "src/**/Cuemon.AspNetCore.App.csproj" + "src/**/Cuemon.AspNetCore.Authentication.csproj" + "src/**/Cuemon.AspNetCore.Mvc.csproj" + "src/**/Cuemon.AspNetCore.Razor.TagHelpers.csproj" + "src/**/Cuemon.Core.csproj" + "src/**/Cuemon.Data.csproj" + "src/**/Cuemon.Data.Integrity.csproj" + "src/**/Cuemon.Data.SqlClient.csproj" + "src/**/Cuemon.Diagnostics.csproj" + "src/**/Cuemon.Extensions.AspNetCore.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Authentication.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Mvc.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Text.Json.csproj" + "src/**/Cuemon.Extensions.AspNetCore.Xml.csproj" + "src/**/Cuemon.Extensions.Collections.Generic.csproj" + "src/**/Cuemon.Extensions.Collections.Specialized.csproj" + "src/**/Cuemon.Extensions.Core.csproj" + "src/**/Cuemon.Extensions.Data.csproj" + "src/**/Cuemon.Extensions.Data.Integrity.csproj" + "src/**/Cuemon.Extensions.DependencyInjection.csproj" + "src/**/Cuemon.Extensions.Diagnostics.csproj" + "src/**/Cuemon.Extensions.Hosting.csproj" + "src/**/Cuemon.Extensions.IO.csproj" + "src/**/Cuemon.Extensions.Net.csproj" + "src/**/Cuemon.Extensions.Reflection.csproj" + "src/**/Cuemon.Extensions.Runtime.Caching.csproj" + "src/**/Cuemon.Extensions.Text.csproj" + "src/**/Cuemon.Extensions.Text.Json.csproj" + "src/**/Cuemon.Extensions.Threading.csproj" + "src/**/Cuemon.Extensions.Xml.csproj" + "src/**/Cuemon.IO.csproj" + "src/**/Cuemon.Net.csproj" + "src/**/Cuemon.Resilience.csproj" + "src/**/Cuemon.Runtime.Caching.csproj" + "src/**/Cuemon.Security.Cryptography.csproj" + "src/**/Cuemon.Threading.csproj" + "src/**/Cuemon.Xml.csproj" + ) + echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV fi shell: bash From 0c23630ad17c6acbe8a47a5b745b2a6df45f167e Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 02:15:17 +0100 Subject: [PATCH 04/10] :construction_worker: tweaked to be unique so no collision with primary pipeline --- .github/workflows/delayed-pipelines.yml | 157 ++---------------------- 1 file changed, 7 insertions(+), 150 deletions(-) diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml index b1f998771..74b0dac91 100644 --- a/.github/workflows/delayed-pipelines.yml +++ b/.github/workflows/delayed-pipelines.yml @@ -68,7 +68,7 @@ jobs: strategy: matrix: configuration: [Debug, Release] - framework: [net9.0, net8.0, netstandard2.1, netstandard2.0] + framework: [net9.0, net8.0, netstandard2.0] needs: [prepare_linux] outputs: version: ${{ steps.minver-calculate.outputs.version }} @@ -98,9 +98,7 @@ jobs: - name: Set environment variable for projects run: | - if [ "${{ matrix.framework }}" == "netstandard2.1" ]; then - echo "PROJECTS=src/**/Cuemon.Extensions.IO.csproj src/**/Cuemon.IO.csproj" >> $GITHUB_ENV - elif [ "${{ matrix.framework }}" == "netstandard2.0" ]; then + if [ "${{ matrix.framework }}" == "netstandard2.0" ]; then projects=( "src/**/Cuemon.Extensions.Globalization.csproj" ) @@ -122,12 +120,7 @@ jobs: configuration: ${{ matrix.configuration }} framework: ${{ matrix.framework }} restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} - - - id: test-projects - name: Generate matrix for test projects - uses: codebeltnet/shell-globbing@v1 - with: - pattern: test/**/*.csproj + uploadBuildArtifactName: 'DelayedBuild.${{ matrix.framework }}.${{ matrix.configuration }}' pack: name: ๐Ÿ“ฆ Pack @@ -153,155 +146,19 @@ jobs: uploadPackedArtifact: true version: ${{ needs.build.outputs.version }} restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} - - test: - name: ๐Ÿงช Test - needs: [build, prepare_linux, prepare_windows] - strategy: - fail-fast: false - matrix: - os: [ubuntu-22.04, windows-2022] - configuration: [Debug, Release] - project: ${{ fromJson(needs.build.outputs.testProjects) }} - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Install .NET Tool - Report Generator - uses: codebeltnet/dotnet-tool-install-reportgenerator@v1 - - - name: Spin up SQL Server test dependency for ${{ matrix.configuration }} build - if: ${{ (runner.os == 'Linux' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} - uses: codebeltnet/docker-compose@v1 - with: - command: up - options: --wait - env: - SA_PASSWORD: ${{ secrets.SA_PASSWORD }} - - - name: Test with ${{ matrix.configuration }} build - if: ${{ !(runner.os == 'Windows' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} - uses: codebeltnet/dotnet-test@v3 - with: - projects: ${{ matrix.project }} - configuration: ${{ matrix.configuration }} - restoreCacheKey: ${{ runner.os == 'Linux' && needs.prepare_linux.outputs.restoreCacheKey || needs.prepare_windows.outputs.restoreCacheKey }} - buildSwitches: -p:SkipSignAssembly=true - testArguments: -- RunConfiguration.DisableAppDomain=true - env: - CONNECTIONSTRINGS__ADVENTUREWORKS: ${{ secrets.DB_ADVENTUREWORKS }} - - - name: Take down SQL Server test dependency for ${{ matrix.configuration }} build - if: ${{ (runner.os == 'Linux' && contains(matrix.project, 'Cuemon.Data.SqlClient.Tests')) }} - uses: codebeltnet/docker-compose@v1 - with: - command: down - - sonarcloud: - name: ๐Ÿ”ฌ Code Quality Analysis - needs: [prepare_linux, build, test] - runs-on: ubuntu-22.04 - timeout-minutes: 25 - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Install .NET Tool - Sonar Scanner - uses: codebeltnet/dotnet-tool-install-sonarscanner@v1 - - - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - with: - useRestoreCache: true - restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} - - - name: Run SonarCloud Analysis - uses: codebeltnet/sonarcloud-scan@v1 - with: - token: ${{ secrets.SONAR_TOKEN }} - organization: geekle - projectKey: Cuemon - version: ${{ needs.build.outputs.version }} - - - name: Build - uses: codebeltnet/dotnet-build@v2 - with: - uploadBuildArtifact: false - buildSwitches: -p:SkipSignAssembly=true - - - name: Finalize SonarCloud Analysis - uses: codebeltnet/sonarcloud-scan-finalize@v1 - with: - token: ${{ secrets.SONAR_TOKEN }} - - codecov: - name: ๐Ÿ“Š Code Coverage Analysis - needs: [build, test] - runs-on: ubuntu-22.04 - timeout-minutes: 15 - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Run CodeCov Analysis - uses: codebeltnet/codecov-scan@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - repository: gimlichael/Cuemon - - codeql: - name: ๐Ÿ›ก๏ธ Security Analysis - needs: [prepare_linux, build, test] - runs-on: ubuntu-22.04 - timeout-minutes: 15 - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - with: - useRestoreCache: true - restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} - - - name: Prepare CodeQL SAST Analysis - uses: codebeltnet/codeql-scan@v1 - - - name: Build - uses: codebeltnet/dotnet-build@v2 - with: - uploadBuildArtifact: false - buildSwitches: -p:SkipSignAssembly=true - - - name: Finalize CodeQL SAST Analysis - uses: codebeltnet/codeql-scan-finalize@v1 + downloadBuildArtifactPattern: 'DelayedBuild.*.${{ matrix.configuration }}' + uploadPackedArtifactName: 'NuGet-Delayed-${{ matrix.configuration }}' deploy: if: github.event_name != 'pull_request' name: ๐Ÿš€ Deploy v${{ needs.build.outputs.version }} runs-on: ubuntu-22.04 timeout-minutes: 15 - needs: [build, pack, test, sonarcloud, codecov, codeql] + needs: [build, pack] environment: Production steps: - uses: codebeltnet/nuget-push@v1 with: token: ${{ secrets.NUGET_TOKEN }} configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} + downloadBuildArtifactName: NuGet-Delayed-${{ inputs.configuration == '' && 'Release' || inputs.configuration }} From 5be13ce023191566a6ae587f0c8e3ef423611501 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:00:46 +0100 Subject: [PATCH 05/10] :construction_worker: tweaked further --- .github/workflows/delayed-pipelines.yml | 53 +++---------------------- 1 file changed, 6 insertions(+), 47 deletions(-) diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml index 74b0dac91..8dbb58a88 100644 --- a/.github/workflows/delayed-pipelines.yml +++ b/.github/workflows/delayed-pipelines.yml @@ -19,48 +19,6 @@ on: - Release jobs: - prepare_linux: - name: ๐Ÿง Prepare Linux - runs-on: ubuntu-22.04 - timeout-minutes: 15 - outputs: - restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - id: dotnet-restore - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - with: - useRestoreCache: true - - prepare_windows: - name: ๐ŸชŸ Prepare Windows - runs-on: windows-2022 - timeout-minutes: 15 - outputs: - restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} - steps: - - name: Checkout - uses: codebeltnet/git-checkout@v1 - - - name: Install .NET - uses: codebeltnet/install-dotnet@v1 - with: - includePreview: true - - - id: dotnet-restore - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - with: - useRestoreCache: true - build: name: ๐Ÿ› ๏ธ Build runs-on: ubuntu-22.04 @@ -69,10 +27,8 @@ jobs: matrix: configuration: [Debug, Release] framework: [net9.0, net8.0, netstandard2.0] - needs: [prepare_linux] outputs: version: ${{ steps.minver-calculate.outputs.version }} - testProjects: ${{ steps.test-projects.outputs.result }} steps: - name: Checkout uses: codebeltnet/git-checkout@v1 @@ -112,14 +68,17 @@ jobs: fi shell: bash - - id: dotnet-build - name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) + - name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + projects: ${{ env.PROJECTS }} + + - name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) uses: codebeltnet/dotnet-build@v2 with: projects: ${{ env.PROJECTS }} configuration: ${{ matrix.configuration }} framework: ${{ matrix.framework }} - restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} uploadBuildArtifactName: 'DelayedBuild.${{ matrix.framework }}.${{ matrix.configuration }}' pack: From 0431541d3c7ee9dea46eb8479c25c535267e571e Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:03:39 +0100 Subject: [PATCH 06/10] tweaked --- .github/workflows/delayed-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml index 8dbb58a88..e5bea0945 100644 --- a/.github/workflows/delayed-pipelines.yml +++ b/.github/workflows/delayed-pipelines.yml @@ -88,7 +88,7 @@ jobs: strategy: matrix: configuration: [Debug, Release] - needs: [prepare_linux, build] + needs: [build] steps: - name: Checkout uses: codebeltnet/git-checkout@v1 @@ -104,7 +104,6 @@ jobs: configuration: ${{ matrix.configuration }} uploadPackedArtifact: true version: ${{ needs.build.outputs.version }} - restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} downloadBuildArtifactPattern: 'DelayedBuild.*.${{ matrix.configuration }}' uploadPackedArtifactName: 'NuGet-Delayed-${{ matrix.configuration }}' From 932fc1d64c620530fce018aa4b054a8219e46de6 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:23:16 +0100 Subject: [PATCH 07/10] :construction_worker: use projects with pack --- .github/workflows/delayed-pipelines.yml | 66 ++++++++++++++++++++----- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml index e5bea0945..476fdfbdf 100644 --- a/.github/workflows/delayed-pipelines.yml +++ b/.github/workflows/delayed-pipelines.yml @@ -19,6 +19,48 @@ on: - Release jobs: + prepare_linux: + name: ๐Ÿง Prepare Linux + runs-on: ubuntu-22.04 + timeout-minutes: 15 + outputs: + restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - id: dotnet-restore + name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + + prepare_windows: + name: ๐ŸชŸ Prepare Windows + runs-on: windows-2022 + timeout-minutes: 15 + outputs: + restoreCacheKey: ${{ steps.dotnet-restore.outputs.restoreCacheKey }} + steps: + - name: Checkout + uses: codebeltnet/git-checkout@v1 + + - name: Install .NET + uses: codebeltnet/install-dotnet@v1 + with: + includePreview: true + + - id: dotnet-restore + name: Restore Dependencies + uses: codebeltnet/dotnet-restore@v2 + with: + useRestoreCache: true + build: name: ๐Ÿ› ๏ธ Build runs-on: ubuntu-22.04 @@ -27,8 +69,10 @@ jobs: matrix: configuration: [Debug, Release] framework: [net9.0, net8.0, netstandard2.0] + needs: [prepare_linux] outputs: version: ${{ steps.minver-calculate.outputs.version }} + projects: ${{ steps.projects.outputs.result }} steps: - name: Checkout uses: codebeltnet/git-checkout@v1 @@ -52,33 +96,31 @@ jobs: bucketName: ${{ secrets.GCP_BUCKETNAME }} objectName: cuemon.snk - - name: Set environment variable for projects + - id: projects + name: Set environment variable for projects run: | if [ "${{ matrix.framework }}" == "netstandard2.0" ]; then projects=( "src/**/Cuemon.Extensions.Globalization.csproj" ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + echo "result=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_OUTPUT else projects=( "src/**/Cuemon.Core.App.csproj" "src/**/Cuemon.Extensions.Globalization.csproj" ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + echo "result=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_OUTPUT fi shell: bash - - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - with: - projects: ${{ env.PROJECTS }} - - - name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) + - id: dotnet-build + name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) uses: codebeltnet/dotnet-build@v2 with: - projects: ${{ env.PROJECTS }} + projects: ${{ steps.projects.outputs.result }} configuration: ${{ matrix.configuration }} framework: ${{ matrix.framework }} + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} uploadBuildArtifactName: 'DelayedBuild.${{ matrix.framework }}.${{ matrix.configuration }}' pack: @@ -88,7 +130,7 @@ jobs: strategy: matrix: configuration: [Debug, Release] - needs: [build] + needs: [prepare_linux, build] steps: - name: Checkout uses: codebeltnet/git-checkout@v1 @@ -104,8 +146,10 @@ jobs: configuration: ${{ matrix.configuration }} uploadPackedArtifact: true version: ${{ needs.build.outputs.version }} + restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} downloadBuildArtifactPattern: 'DelayedBuild.*.${{ matrix.configuration }}' uploadPackedArtifactName: 'NuGet-Delayed-${{ matrix.configuration }}' + projects: ${{ needs.prepare_linux.outputs.projects }} deploy: if: github.event_name != 'pull_request' From a780a1a44344792999bf6fd9b9cf6eeacdfa3823 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:31:01 +0100 Subject: [PATCH 08/10] projects --- .github/workflows/delayed-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/delayed-pipelines.yml b/.github/workflows/delayed-pipelines.yml index 476fdfbdf..486193699 100644 --- a/.github/workflows/delayed-pipelines.yml +++ b/.github/workflows/delayed-pipelines.yml @@ -149,7 +149,7 @@ jobs: restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} downloadBuildArtifactPattern: 'DelayedBuild.*.${{ matrix.configuration }}' uploadPackedArtifactName: 'NuGet-Delayed-${{ matrix.configuration }}' - projects: ${{ needs.prepare_linux.outputs.projects }} + projects: ${{ needs.build.outputs.projects }} deploy: if: github.event_name != 'pull_request' From e2f9ef69bbbb9467a6aafbbbd6ef0b262ee6d94c Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:36:09 +0100 Subject: [PATCH 09/10] aligned both pipelines --- .github/workflows/pipelines.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index 57d1316cf..d0dc097dc 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -72,6 +72,7 @@ jobs: needs: [prepare_linux] outputs: version: ${{ steps.minver-calculate.outputs.version }} + projects: ${{ steps.projects.outputs.result }} testProjects: ${{ steps.test-projects.outputs.result }} steps: - name: Checkout @@ -99,7 +100,7 @@ jobs: - name: Set environment variable for projects run: | if [ "${{ matrix.framework }}" == "netstandard2.1" ]; then - echo "PROJECTS=src/**/Cuemon.Extensions.IO.csproj src/**/Cuemon.IO.csproj" >> $GITHUB_ENV + echo "result=src/**/Cuemon.Extensions.IO.csproj src/**/Cuemon.IO.csproj" >> $GITHUB_OUTPUT elif [ "${{ matrix.framework }}" == "netstandard2.0" ]; then projects=( "src/**/Cuemon.Core.csproj" @@ -131,7 +132,7 @@ jobs: "src/**/Cuemon.Threading.csproj" "src/**/Cuemon.Xml.csproj" ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + echo "result=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_OUTPUT else projects=( "src/**/Cuemon.AspNetCore.csproj" @@ -176,7 +177,7 @@ jobs: "src/**/Cuemon.Threading.csproj" "src/**/Cuemon.Xml.csproj" ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV + echo "result=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_OUTPUT fi shell: bash @@ -184,7 +185,7 @@ jobs: name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) uses: codebeltnet/dotnet-build@v2 with: - projects: ${{ env.PROJECTS }} + projects: ${{ steps.projects.outputs.result }} configuration: ${{ matrix.configuration }} framework: ${{ matrix.framework }} restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} @@ -219,6 +220,7 @@ jobs: uploadPackedArtifact: true version: ${{ needs.build.outputs.version }} restoreCacheKey: ${{ needs.prepare_linux.outputs.restoreCacheKey }} + projects: ${{ needs.build.outputs.projects }} test: name: ๐Ÿงช Test From b1d1fdc3cec4cf8ba541589d08bebd7727e447ab Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Wed, 13 Nov 2024 03:39:29 +0100 Subject: [PATCH 10/10] fix --- .github/workflows/pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index d0dc097dc..6c74ad378 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -97,7 +97,8 @@ jobs: bucketName: ${{ secrets.GCP_BUCKETNAME }} objectName: cuemon.snk - - name: Set environment variable for projects + - id: projects + name: Set environment variable for projects run: | if [ "${{ matrix.framework }}" == "netstandard2.1" ]; then echo "result=src/**/Cuemon.Extensions.IO.csproj src/**/Cuemon.IO.csproj" >> $GITHUB_OUTPUT