From 9b650c7ad559d538a9b7416fed235fa790d01c09 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Fri, 23 May 2025 08:00:16 +0200 Subject: [PATCH 1/3] :construction_worker: utilize remainder of reusable workflow --- .github/workflows/pipelines.yml | 125 +++++++------------------------- 1 file changed, 28 insertions(+), 97 deletions(-) diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index fefb5a7..268e74a 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -23,109 +23,41 @@ permissions: jobs: build: - name: ๐Ÿ› ๏ธ Build - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-build strategy: matrix: configuration: [Debug, Release] - framework: [net9.0,net8.0,netstandard2.0] - outputs: - version: ${{ steps.minver-calculate.outputs.version }} - 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 xunit.snk file - uses: codebeltnet/gcp-download-file@v1 - with: - serviceAccountKey: ${{ secrets.GCP_TOKEN }} - bucketName: ${{ secrets.GCP_BUCKETNAME }} - objectName: xunit.snk - - - name: Set environment variable for projects - run: | - if [ "${{ matrix.framework }}" == "netstandard2.0" ]; then - projects=( - "src/**/Codebelt.Extensions.Xunit.csproj" - "src/**/Codebelt.Extensions.Xunit.Hosting.csproj" - ) - echo "PROJECTS=$(IFS=' '; echo "${projects[*]}")" >> $GITHUB_ENV - else - echo "PROJECTS=src/**/*.csproj" >> $GITHUB_ENV - fi - shell: bash - - - name: Restore Dependencies - uses: codebeltnet/dotnet-restore@v2 - - - name: Build for ${{ matrix.framework }} (${{ matrix.configuration }}) - uses: codebeltnet/dotnet-build@v2 - with: - projects: ${{ env.PROJECTS }} - configuration: ${{ matrix.configuration }} - framework: ${{ matrix.framework }} + uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} + strong-name-key-filename: xunit.snk + secrets: + GCP_TOKEN: ${{ secrets.GCP_TOKEN }} + GCP_BUCKETNAME: ${{ secrets.GCP_BUCKETNAME }} pack: - name: ๐Ÿ“ฆ Pack - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-pack + needs: [build] strategy: matrix: configuration: [Debug, Release] - needs: [build] - steps: - - 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 }} + uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} + upload-packed-artifact: true + version: ${{ needs.build.outputs.version }} test: - name: ๐Ÿงช Test + name: call-test needs: [build] strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022] + os: [ubuntu-24.04, windows-2022] configuration: [Debug, Release] - 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: Test with ${{ matrix.configuration }} build - uses: codebeltnet/dotnet-test@v3 - with: - configuration: ${{ matrix.configuration }} - buildSwitches: -p:SkipSignAssembly=true + uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v1 + with: + configuration: ${{ matrix.configuration }} sonarcloud: name: call-sonarcloud @@ -154,16 +86,15 @@ jobs: deploy: if: github.event_name != 'pull_request' - name: ๐Ÿš€ Deploy v${{ needs.build.outputs.version }} - runs-on: ubuntu-22.04 - timeout-minutes: 15 + name: call-nuget needs: [build, pack, test, sonarcloud, codecov, codeql] - environment: Production + uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v1 + with: + version: ${{ needs.build.outputs.version }} + environment: Production + configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} permissions: contents: write packages: write - steps: - - uses: codebeltnet/nuget-push@v1 - with: - token: ${{ secrets.NUGET_TOKEN }} - configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }} + secrets: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} From 2931f2a0ded34c5a7619783d43967499f03e77d9 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Fri, 23 May 2025 19:34:21 +0200 Subject: [PATCH 2/3] added runs-on --- .github/workflows/pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index 268e74a..0e5fd3f 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -58,6 +58,7 @@ jobs: uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v1 with: configuration: ${{ matrix.configuration }} + runs-on: ${{ matrix.os }} sonarcloud: name: call-sonarcloud From df1f0341c09b3025ba88496eb982a35a4b8e237e Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Fri, 23 May 2025 19:42:27 +0200 Subject: [PATCH 3/3] fix --- .github/workflows/pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index 0e5fd3f..94e3e62 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -59,6 +59,7 @@ jobs: with: configuration: ${{ matrix.configuration }} runs-on: ${{ matrix.os }} + build-switches: -p:SkipSignAssembly=true sonarcloud: name: call-sonarcloud