From 03523faf4a8ed99c4fd672a3c9674d9cab6ce68f Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 10:45:07 +0200
Subject: [PATCH 01/26] Create publish.yml
---
.github/workflows/publish.yml | 106 ++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100644 .github/workflows/publish.yml
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..0490b05
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,106 @@
+# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
+
+name: publish
+on:
+ workflow_dispatch: # Allow running the workflow manually from the GitHub UI
+ push:
+ branches:
+ - 'main' # Run the workflow when pushing to the main branch
+ pull_request:
+ branches:
+ - '*' # Run the workflow for all pull requests
+ release:
+ types:
+ - published # Run the workflow when a new GitHub release is published
+
+env:
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
+ DOTNET_NOLOGO: true
+ NuGetDirectory: ${{ github.workspace}}/nuget
+
+defaults:
+ run:
+ shell: pwsh
+
+jobs:
+ create_nuget:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
+
+ # Install the .NET SDK indicated in the global.json file
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+
+ # Create the NuGet package in the folder from the environment variable NuGetDirectory
+ - run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
+
+ # Publish the NuGet package as an artifact, so they can be used in the following jobs
+ - uses: actions/upload-artifact@v3
+ with:
+ name: nuget
+ if-no-files-found: error
+ retention-days: 7
+ path: ${{ env.NuGetDirectory }}/*.nupkg
+
+ validate_nuget:
+ runs-on: ubuntu-latest
+ needs: [ create_nuget ]
+ steps:
+ # Install the .NET SDK indicated in the global.json file
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+
+ # Download the NuGet package created in the previous job
+ - uses: actions/download-artifact@v3
+ with:
+ name: nuget
+ path: ${{ env.NuGetDirectory }}
+
+ - name: Install nuget validator
+ run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global
+
+ # Validate metadata and content of the NuGet package
+ # https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab
+ # If some rules are not applicable, you can disable them
+ # using the --excluded-rules or --excluded-rule-ids option
+ - name: Validate package
+ run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
+
+ run_test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ - name: Run tests
+ run: dotnet test --configuration Release
+
+ deploy:
+ # Publish only when creating a GitHub Release
+ # https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
+ # You can update this logic if you want to manage releases differently
+ if: github.event_name == 'release'
+ runs-on: ubuntu-latest
+ needs: [ validate_nuget, run_test ]
+ steps:
+ # Download the NuGet package created in the previous job
+ - uses: actions/download-artifact@v3
+ with:
+ name: nuget
+ path: ${{ env.NuGetDirectory }}
+
+ # Install the .NET SDK indicated in the global.json file
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v4
+
+ # Publish all NuGet packages to NuGet.org
+ # Use --skip-duplicate to prevent errors if a package with the same version already exists.
+ # If you retry a failed workflow, already published packages will be skipped without error.
+ - name: Publish NuGet package
+ run: |
+ foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
+ dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
+ }
From a8ac02fd4b2f6ce120588f98026b988e23b99246 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 10:47:34 +0200
Subject: [PATCH 02/26] Update publish.yml
---
.github/workflows/publish.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 0490b05..d6f7fe5 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -38,7 +38,7 @@ jobs:
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
# Publish the NuGet package as an artifact, so they can be used in the following jobs
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
From a75229da5fa8bf4f48b56f9cd6fe63873e6f2570 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:02:26 +0200
Subject: [PATCH 03/26] Update publish.yml
---
.github/workflows/publish.yml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index d6f7fe5..2d2827c 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -30,9 +30,14 @@ jobs:
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
- # Install the .NET SDK indicated in the global.json file
- - name: Setup .NET
+
+ # Install .NET 9.0 SDK
+ - name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '9.0.x' # Use a specific version or '9.0.x' for the latest 9.0 preview
+ include-prerelease: true # Include pre-release versions (important for .NET 9.0)
+
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
From 93d4752007eb694195bacbe16190bd043424f207 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:05:05 +0200
Subject: [PATCH 04/26] Update publish.yml
---
.github/workflows/publish.yml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 2d2827c..76d6703 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -78,8 +78,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - name: Setup .NET
+ # Install .NET 9.0 SDK
+ - name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '9.0.x' # Use a specific version or '9.0.x' for the latest 9.0 preview
+ include-prerelease: true # Include pre-release versions (important for .NET 9.0)
+
- name: Run tests
run: dotnet test --configuration Release
From e8ab194b9438838e1256ca4510bb4d35a0065a67 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:08:51 +0200
Subject: [PATCH 05/26] Update publish.yml
---
.github/workflows/publish.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 76d6703..fd85eb8 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -39,6 +39,8 @@ jobs:
include-prerelease: true # Include pre-release versions (important for .NET 9.0)
+ - name: Build
+ run: dotnet build --configuration Release
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
From 90804e1bb7f6c90b46faf2dbd4f066cf11cefba6 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:10:41 +0200
Subject: [PATCH 06/26] Update publish.yml
---
.github/workflows/publish.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index fd85eb8..693a83f 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -61,7 +61,7 @@ jobs:
uses: actions/setup-dotnet@v4
# Download the NuGet package created in the previous job
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
@@ -99,7 +99,7 @@ jobs:
needs: [ validate_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
From 20b212d9c8951df09a15756b8c7172820b1c54fa Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:18:51 +0200
Subject: [PATCH 07/26] Update publish.yml
---
.github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 693a83f..4f17d34 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -80,15 +80,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- # Install .NET 9.0 SDK
+
+ # Install .NET 9.0 SDK
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x' # Use a specific version or '9.0.x' for the latest 9.0 preview
- include-prerelease: true # Include pre-release versions (important for .NET 9.0)
+
+ - name: Install Coverlet Collector
+ run: dotnet add package coverlet.collector
- - name: Run tests
- run: dotnet test --configuration Release
+ - name: Run Tests
+ run: dotnet test --configuration Release --logger "trx;LogFileName=testresults.trx" --collect:"XPlat Code Coverage"
+
+ - name: Publish Test Results
+ uses: dorny/test-reporter@v1
+ with:
+ name: .NET Tests
+ path: '*.trx'
+ reporter: dotnet-trx
+ fail-on-error: true
+
+ - name: Generate Coverage Report
+ run: |
+ dotnet tool install -g dotnet-reportgenerator-globaltool
+ reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"coverageReport" -reporttypes:HtmlInline_AzurePipelines
+
+ - name: Upload Coverage Report
+ uses: actions/upload-artifact@v3
+ with:
+ name: Coverage Report
+ path: coverageReport
+
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ files: './**/coverage.cobertura.xml'
+ fail_ci_if_error: true
deploy:
# Publish only when creating a GitHub Release
From a1518d08a6d862a6b1fdc91e3705572a429b9bf5 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:19:49 +0200
Subject: [PATCH 08/26] Update publish.yml
---
.github/workflows/publish.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 4f17d34..f9ee88e 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -107,7 +107,7 @@ jobs:
reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"coverageReport" -reporttypes:HtmlInline_AzurePipelines
- name: Upload Coverage Report
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: Coverage Report
path: coverageReport
From b3f701e0090601f65346ad43f3ad8723d29d6022 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:22:16 +0200
Subject: [PATCH 09/26] Update publish.yml
---
.github/workflows/publish.yml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index f9ee88e..36c540c 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -87,8 +87,10 @@ jobs:
with:
dotnet-version: '9.0.x' # Use a specific version or '9.0.x' for the latest 9.0 preview
- - name: Install Coverlet Collector
- run: dotnet add package coverlet.collector
+ - name: Change Directory and Install Coverlet Collector
+ run: |
+ cd FeatureMasterX # Navigate to the project directory
+ dotnet add package coverlet.collector
- name: Run Tests
run: dotnet test --configuration Release --logger "trx;LogFileName=testresults.trx" --collect:"XPlat Code Coverage"
From 2d6b9a51b125537701fbf6cdd0fab63423ff0cd8 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:26:12 +0200
Subject: [PATCH 10/26] Update publish.yml
---
.github/workflows/publish.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 36c540c..27d25ff 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -99,7 +99,7 @@ jobs:
uses: dorny/test-reporter@v1
with:
name: .NET Tests
- path: '*.trx'
+ path: '**/TestResults/*.trx' # Corrected path
reporter: dotnet-trx
fail-on-error: true
From 1e76bb412c387e3495b317e237e5d507ae4c0026 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:30:18 +0200
Subject: [PATCH 11/26] Update publish.yml
---
.github/workflows/publish.yml | 32 ++------------------------------
1 file changed, 2 insertions(+), 30 deletions(-)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 27d25ff..fb69028 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -76,6 +76,7 @@ jobs:
- name: Validate package
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
+
run_test:
runs-on: ubuntu-latest
steps:
@@ -87,38 +88,9 @@ jobs:
with:
dotnet-version: '9.0.x' # Use a specific version or '9.0.x' for the latest 9.0 preview
- - name: Change Directory and Install Coverlet Collector
- run: |
- cd FeatureMasterX # Navigate to the project directory
- dotnet add package coverlet.collector
-
- name: Run Tests
- run: dotnet test --configuration Release --logger "trx;LogFileName=testresults.trx" --collect:"XPlat Code Coverage"
+ run: dotnet test --configuration Release
- - name: Publish Test Results
- uses: dorny/test-reporter@v1
- with:
- name: .NET Tests
- path: '**/TestResults/*.trx' # Corrected path
- reporter: dotnet-trx
- fail-on-error: true
-
- - name: Generate Coverage Report
- run: |
- dotnet tool install -g dotnet-reportgenerator-globaltool
- reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"coverageReport" -reporttypes:HtmlInline_AzurePipelines
-
- - name: Upload Coverage Report
- uses: actions/upload-artifact@v4
- with:
- name: Coverage Report
- path: coverageReport
-
- - name: Upload coverage to Codecov
- uses: codecov/codecov-action@v3
- with:
- files: './**/coverage.cobertura.xml'
- fail_ci_if_error: true
deploy:
# Publish only when creating a GitHub Release
From 9913ee88ef1d2aa9391cc4f71f2b77791f870175 Mon Sep 17 00:00:00 2001
From: Antonis Kotis <39365838+SkJonko@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:36:29 +0200
Subject: [PATCH 12/26] Update FeatureMasterX.csproj
---
FeatureMasterX/FeatureMasterX.csproj | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/FeatureMasterX/FeatureMasterX.csproj b/FeatureMasterX/FeatureMasterX.csproj
index 1c1b781..5349ffd 100644
--- a/FeatureMasterX/FeatureMasterX.csproj
+++ b/FeatureMasterX/FeatureMasterX.csproj
@@ -7,16 +7,20 @@