From 118ce3bf1b3aecbe0214eff370eee03fa94f8f67 Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 22:06:29 +0100 Subject: [PATCH 01/14] - release v1.0.0 alpha --- GitVersion.yml | 18 +++++++++++ README.md | 3 +- SourceFlow.Net.sln | 1 + src/SourceFlow/SourceFlow.csproj | 52 ++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 GitVersion.yml diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..ba207bb --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,18 @@ +next-version: 1.0.0 +tag-prefix: '[vV]' +mode: ContinuousDeployment +branches: + master: + regex: ^master$ + release: + regex: ^release$ + pre-release: + regex: ^pre-release$ + tag: alpha + develop: + regex: ^develop$|^dev$ + tag: beta + pull-request: + tag: beta +ignore: + sha: [] \ No newline at end of file diff --git a/README.md b/README.md index b822df3..de84dd5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![master-codeql](https://github.com/CodeShayk/SourceFlow.Net/actions/workflows/Master-CodeQL.yml/badge.svg)](https://github.com/CodeShayk/SourceFlow.Net/actions/workflows/Master-CodeQL.yml) [![.Net 9.0](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) [![.Net Standard 2.1](https://img.shields.io/badge/.NetStandard-2.1-blue)](https://github.com/dotnet/standard/blob/v2.1.0/docs/versions/netstandard2.1.md) +[![.Net Standard 2.0](https://img.shields.io/badge/.NetStandard-2.0-blue)](https://github.com/dotnet/standard/blob/v2.0.0/docs/versions/netstandard2.0.md) +[![.Net Framework 4.6.4](https://img.shields.io/badge/.Net-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46)

@@ -17,7 +19,6 @@ ## Overview SourceFlow.Net empowers developers to build scalable, maintainable applications by providing a complete toolkit for event sourcing, domain modeling, and command/query separation. Built from the ground up for .NET 9.0 with **performance** and **developer experience** as core priorities. -## Why SourceFlow.Net? ### Key Features * 🏗️ Domain-Driven Design Support * ⚡ CQRS Implementation with Command/Query Segregation diff --git a/SourceFlow.Net.sln b/SourceFlow.Net.sln index 41500b6..13e9b70 100644 --- a/SourceFlow.Net.sln +++ b/SourceFlow.Net.sln @@ -10,6 +10,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{4F977993-F413-4BA5-809B-6688EC654606}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + GitVersion.yml = GitVersion.yml LICENSE = LICENSE README.md = README.md EndProjectSection diff --git a/src/SourceFlow/SourceFlow.csproj b/src/SourceFlow/SourceFlow.csproj index da04ee0..1ea7831 100644 --- a/src/SourceFlow/SourceFlow.csproj +++ b/src/SourceFlow/SourceFlow.csproj @@ -2,6 +2,43 @@ net462;netstandard2.0;netstandard2.1;net9.0 + 1.0.0-alpha.1 + https://github.com/CodeShayk/SourceFlow.Net + git + https://github.com/CodeShayk/SourceFlow.Net/wiki + Code Shayk + Code Shayk + SourceFlow.Net + SourceFlow.Net + SourceFlow.Net + True + A modern, lightweight, and extensible framework for building event-sourced applications using Domain-Driven Design (DDD) principles and Command Query Responsibility Segregation (CQRS) patterns. + Copyright (c) 2025 Code Shayk + README.md + ninja-icon-16.png + 1.0.0 + 1.0.0 + LICENSE + True + Includes Core Event sourcing & CQRS functionality. + Events;Commands;DDD;CQRS;Event-Sourcing;ViewModel;Aggregates;EventStore;Domain driven design; Event Sourcing; Command Query Responsibility Segregation; Command Pattern; Publisher Subscriber; PuB-Sub + False + + + + True + + + + True + + + + True + + + + True @@ -12,4 +49,19 @@ + + + True + \ + + + True + \ + + + True + \ + + + From 563d3a7fa65aa4b3444c2996970c50cd3908c1d6 Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 22:54:01 +0100 Subject: [PATCH 02/14] - fixed Gitversion.yml --- GitVersion.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/GitVersion.yml b/GitVersion.yml index ba207bb..0f49ef8 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -4,15 +4,21 @@ mode: ContinuousDeployment branches: master: regex: ^master$ + tag: '' release: regex: ^release$ + tag: '' pre-release: - regex: ^pre-release$ + regex: ^pre-release$|^pre-release/.*$ tag: alpha + increment: Minor + prevent-increment-of-merged-branch-version: true develop: regex: ^develop$|^dev$ tag: beta + increment: Minor pull-request: tag: beta + regex: ^(pull|pull\-requests|pr)[/-] ignore: sha: [] \ No newline at end of file From c8d3c6b9259815d8602d20db0bba176d050ff91b Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:03:02 +0100 Subject: [PATCH 03/14] - Fix git version --- .github/workflows/PR-CI.yml | 75 +++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml index 7870275..edd27a9 100644 --- a/.github/workflows/PR-CI.yml +++ b/.github/workflows/PR-CI.yml @@ -3,9 +3,13 @@ on: pull_request: types: [opened, reopened, edited, synchronize] paths-ignore: - - "**/*.md" - "**/*.gitignore" - "**/*.gitattributes" + branches: + - master + - develop/** + - pre-release/** + - release/** jobs: Run-Lint: runs-on: ubuntu-latest @@ -13,7 +17,7 @@ jobs: github-token: '${{ secrets.GH_Packages }}' steps: - name: Step-01 Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Step-02 Lint Code Base @@ -26,15 +30,16 @@ jobs: Build-Test: runs-on: ubuntu-latest outputs: - release_Version: ${{ steps.gitversion.outputs.MajorMinorPatch }} - beta_Version: ${{ steps.gitversion.outputs.nuGetVersion }} - branchName: ${{ steps.gitversion.outputs.branchName }} + nuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }} + majorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }} + fullSemVer: ${{ steps.gitversion.outputs.FullSemVer }} + branchName: ${{ steps.gitversion.outputs.BranchName }} env: - working-directory: /home/runner/work/sourceflow.net/sourceflow.net + working-directory: ${{ github.workspace }} steps: - name: Step-01 Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.7 + uses: gittools/actions/gitversion/setup@v0.9.15 with: versionSpec: 5.x @@ -42,80 +47,86 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - name: Step-03 Calculate Version id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.7 + uses: gittools/actions/gitversion/execute@v0.9.15 with: useConfigFile: true - - name: Step-04 Install .NET + - name: Step-04 Display Version Info + run: | + echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}" + echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}" + echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}" + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}" + + - name: Step-05 Install .NET uses: actions/setup-dotnet@v3 with: dotnet-version: 9.0.x - - name: Step-05 Restore dependencies + - name: Step-06 Restore dependencies run: dotnet restore working-directory: '${{ env.working-directory }}' - - name: Step-06 Build Version (Beta) - if: ${{ !startsWith(github.head_ref, 'release/')}} - run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} + - name: Step-07 Build Version (Beta) + if: ${{ !startsWith(github.head_ref, 'release/') }} + run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} working-directory: '${{ env.working-directory }}' - - name: Step-06 Build Version (Release) - if: ${{ startsWith(github.head_ref, 'release/')}} - run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} + - name: Step-07 Build Version (Release) + if: ${{ startsWith(github.head_ref, 'release/') }} + run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} working-directory: '${{ env.working-directory }}' - - name: Step-07 Test Solution - run: dotnet test --configuration Release --no-build --no-restore --verbosity normal + - name: Step-08 Test Solution + run: dotnet test --configuration Release --no-build --no-restore --verbosity normal working-directory: '${{ env.working-directory }}' - - name: Step-08 Upload Build Artifacts + - name: Step-09 Upload Build Artifacts uses: actions/upload-artifact@v4 with: name: build-artifact - path: ${{env.working-directory}} + path: ${{ env.working-directory }} retention-days: 1 Package: needs: [Build-Test] runs-on: ubuntu-latest - outputs: - semVersion: ${{ needs.Build-Release.outputs.semVersion }} env: github-token: '${{ secrets.GH_Packages }}' nuget-token: '${{ secrets.NUGET_API_KEY }}' - working-directory: /home/runner/work/sourceflow.net/sourceflow.net + working-directory: ${{ github.workspace }} steps: - name: Step-01 Retrieve Build Artifacts uses: actions/download-artifact@v4 with: name: build-artifact - path: ${{env.working-directory}} + path: ${{ env.working-directory }} - name: Step-02 Install Github Packages run: dotnet tool install gpr --global - name: Step-03 Publish to Github Packages - run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \; + run: find . -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \; Release: name: Release to Nuget needs: [Package] - if: ${{ startsWith(github.head_ref, 'release/')}} + if: ${{ startsWith(github.head_ref, 'release/') }} runs-on: ubuntu-latest env: nuget-token: '${{ secrets.NUGET_API_KEY }}' - working-directory: /home/runner/work/sourceflow.net/sourceflow.net + working-directory: ${{ github.workspace }} steps: - name: Step-01 Retrieve Build Artifacts uses: actions/download-artifact@v4 with: name: build-artifact - path: ${{env.working-directory}} - - name: Step-03 Release to Nuget Org - if: ${{ startsWith(github.head_ref, 'release/')}} - run: dotnet nuget push ${{env.working-directory}}/src/parsley/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json - + path: ${{ env.working-directory }} + + - name: Step-02 Release to Nuget Org + run: | + find ${{ env.working-directory }}/src -name "*.nupkg" -path "*/Release/*.nupkg" -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \; \ No newline at end of file From f5bb44043f90a038ea43beb39b824b53a2945cc2 Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:06:19 +0100 Subject: [PATCH 04/14] - Fix Gitversion.yaml --- GitVersion.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GitVersion.yml b/GitVersion.yml index 0f49ef8..8767977 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -5,20 +5,25 @@ branches: master: regex: ^master$ tag: '' + source-branches: ['develop'] release: regex: ^release$ tag: '' + source-branches: ['develop', 'master'] pre-release: regex: ^pre-release$|^pre-release/.*$ tag: alpha increment: Minor prevent-increment-of-merged-branch-version: true + source-branches: ['develop', 'master'] develop: regex: ^develop$|^dev$ tag: beta increment: Minor + source-branches: ['master'] pull-request: tag: beta regex: ^(pull|pull\-requests|pr)[/-] + source-branches: ['develop', 'master', 'release', 'pre-release'] ignore: sha: [] \ No newline at end of file From 899f15a5ca7df0e32be730af3e1ee5134dd18f55 Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:23:55 +0100 Subject: [PATCH 05/14] - Fix Githib Action --- .github/workflows/PR-CI.yml | 23 ++++++++++++++++++----- GitVersion.yml | 19 +++++++++++++------ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml index edd27a9..9802574 100644 --- a/.github/workflows/PR-CI.yml +++ b/.github/workflows/PR-CI.yml @@ -10,6 +10,13 @@ on: - develop/** - pre-release/** - release/** + push: + branches: + - pre-release/** + - pre-release + - release/** + - release + jobs: Run-Lint: runs-on: ubuntu-latest @@ -27,6 +34,7 @@ jobs: FILTER_REGEX_INCLUDE: .*src/.* DEFAULT_BRANCH: master GITHUB_TOKEN: '${{ env.github-token }}' + Build-Test: runs-on: ubuntu-latest outputs: @@ -47,7 +55,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Step-03 Calculate Version id: gitversion @@ -71,16 +79,21 @@ jobs: run: dotnet restore working-directory: '${{ env.working-directory }}' - - name: Step-07 Build Version (Beta) - if: ${{ !startsWith(github.head_ref, 'release/') }} + - name: Step-07 Build Version (Pre-release Alpha) + if: ${{ startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') }} run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} working-directory: '${{ env.working-directory }}' - name: Step-07 Build Version (Release) - if: ${{ startsWith(github.head_ref, 'release/') }} + if: ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }} run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} working-directory: '${{ env.working-directory }}' + - name: Step-07 Build Version (Beta/Other) + if: ${{ !(startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') || startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/')) }} + run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} + working-directory: '${{ env.working-directory }}' + - name: Step-08 Test Solution run: dotnet test --configuration Release --no-build --no-restore --verbosity normal working-directory: '${{ env.working-directory }}' @@ -115,7 +128,7 @@ jobs: Release: name: Release to Nuget needs: [Package] - if: ${{ startsWith(github.head_ref, 'release/') }} + if: ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }} runs-on: ubuntu-latest env: nuget-token: '${{ secrets.NUGET_API_KEY }}' diff --git a/GitVersion.yml b/GitVersion.yml index 8767977..87a53ce 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -3,19 +3,21 @@ tag-prefix: '[vV]' mode: ContinuousDeployment branches: master: - regex: ^master$ + regex: ^master$|^main$ tag: '' source-branches: ['develop'] + is-main-branch: true release: - regex: ^release$ + regex: ^releases?[\/-] tag: '' - source-branches: ['develop', 'master'] + source-branches: ['master', 'develop'] + is-release-branch: true pre-release: - regex: ^pre-release$|^pre-release/.*$ + regex: ^pre-release$|^pre-release/.* tag: alpha increment: Minor prevent-increment-of-merged-branch-version: true - source-branches: ['develop', 'master'] + source-branches: ['master', 'develop'] develop: regex: ^develop$|^dev$ tag: beta @@ -24,6 +26,11 @@ branches: pull-request: tag: beta regex: ^(pull|pull\-requests|pr)[/-] - source-branches: ['develop', 'master', 'release', 'pre-release'] + source-branches: ['master', 'develop', 'release', 'pre-release'] + feature: + regex: ^features?[\/-] + tag: '{BranchName}' + increment: Inherit + source-branches: ['master', 'develop', 'release'] ignore: sha: [] \ No newline at end of file From 62b2a736c2fb3ddeed57d4d3f4060e84747efcac Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:27:57 +0100 Subject: [PATCH 06/14] - Fixed GitVersion.yml --- GitVersion.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 87a53ce..c0822fa 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -6,12 +6,13 @@ branches: regex: ^master$|^main$ tag: '' source-branches: ['develop'] - is-main-branch: true release: + mode: ManualDeployment regex: ^releases?[\/-] - tag: '' + tag: beta + increment: Minor + prevent-increment-of-merged-branch-version: true source-branches: ['master', 'develop'] - is-release-branch: true pre-release: regex: ^pre-release$|^pre-release/.* tag: alpha From a7a0b432d57182c9bff087e398efe3194840bac9 Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:30:24 +0100 Subject: [PATCH 07/14] - Fix GitVersion.yml --- GitVersion.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index c0822fa..d4f856d 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -7,8 +7,7 @@ branches: tag: '' source-branches: ['develop'] release: - mode: ManualDeployment - regex: ^releases?[\/-] + mode: ContinuousDelivery tag: beta increment: Minor prevent-increment-of-merged-branch-version: true @@ -29,7 +28,6 @@ branches: regex: ^(pull|pull\-requests|pr)[/-] source-branches: ['master', 'develop', 'release', 'pre-release'] feature: - regex: ^features?[\/-] tag: '{BranchName}' increment: Inherit source-branches: ['master', 'develop', 'release'] From f530c8dd75b081972ac99075ee732cdfaab3f30b Mon Sep 17 00:00:00 2001 From: Ninja Date: Sun, 17 Aug 2025 23:39:55 +0100 Subject: [PATCH 08/14] - Fix Github Actions --- .github/workflows/PR-CI.yml | 69 ++------------------------- .github/workflows/Pre-release-CI.yml | 70 +++++++++++++++++++++++++++ .github/workflows/Release-CI.yml | 71 ++++++++++++++++++++++++++++ SourceFlow.Net.sln | 2 + 4 files changed, 147 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/Pre-release-CI.yml create mode 100644 .github/workflows/Release-CI.yml diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml index 9802574..2c7ddc9 100644 --- a/.github/workflows/PR-CI.yml +++ b/.github/workflows/PR-CI.yml @@ -3,19 +3,9 @@ on: pull_request: types: [opened, reopened, edited, synchronize] paths-ignore: + - "**/*.md" - "**/*.gitignore" - "**/*.gitattributes" - branches: - - master - - develop/** - - pre-release/** - - release/** - push: - branches: - - pre-release/** - - pre-release - - release/** - - release jobs: Run-Lint: @@ -55,7 +45,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha || github.ref }} + ref: ${{ github.event.pull_request.head.sha }} - name: Step-03 Calculate Version id: gitversion @@ -68,7 +58,6 @@ jobs: echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}" echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}" echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}" - echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}" - name: Step-05 Install .NET uses: actions/setup-dotnet@v3 @@ -79,18 +68,7 @@ jobs: run: dotnet restore working-directory: '${{ env.working-directory }}' - - name: Step-07 Build Version (Pre-release Alpha) - if: ${{ startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') }} - run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} - working-directory: '${{ env.working-directory }}' - - - name: Step-07 Build Version (Release) - if: ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }} - run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} - working-directory: '${{ env.working-directory }}' - - - name: Step-07 Build Version (Beta/Other) - if: ${{ !(startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') || startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/')) }} + - name: Step-07 Build Version (Beta) run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} working-directory: '${{ env.working-directory }}' @@ -103,43 +81,4 @@ jobs: with: name: build-artifact path: ${{ env.working-directory }} - retention-days: 1 - - Package: - needs: [Build-Test] - runs-on: ubuntu-latest - env: - github-token: '${{ secrets.GH_Packages }}' - nuget-token: '${{ secrets.NUGET_API_KEY }}' - working-directory: ${{ github.workspace }} - steps: - - name: Step-01 Retrieve Build Artifacts - uses: actions/download-artifact@v4 - with: - name: build-artifact - path: ${{ env.working-directory }} - - - name: Step-02 Install Github Packages - run: dotnet tool install gpr --global - - - name: Step-03 Publish to Github Packages - run: find . -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \; - - Release: - name: Release to Nuget - needs: [Package] - if: ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }} - runs-on: ubuntu-latest - env: - nuget-token: '${{ secrets.NUGET_API_KEY }}' - working-directory: ${{ github.workspace }} - steps: - - name: Step-01 Retrieve Build Artifacts - uses: actions/download-artifact@v4 - with: - name: build-artifact - path: ${{ env.working-directory }} - - - name: Step-02 Release to Nuget Org - run: | - find ${{ env.working-directory }}/src -name "*.nupkg" -path "*/Release/*.nupkg" -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \; \ No newline at end of file + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/Pre-release-CI.yml b/.github/workflows/Pre-release-CI.yml new file mode 100644 index 0000000..9de9257 --- /dev/null +++ b/.github/workflows/Pre-release-CI.yml @@ -0,0 +1,70 @@ +name: pre-release-ci +on: + push: + branches: + - pre-release/** + - pre-release + +jobs: + Build-Test-Publish: + runs-on: ubuntu-latest + env: + working-directory: ${{ github.workspace }} + github-token: '${{ secrets.GH_Packages }}' + nuget-token: '${{ secrets.NUGET_API_KEY }}' + + steps: + - name: Step-01 Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: 5.x + + - name: Step-02 Check out Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Step-03 Calculate Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + + - name: Step-04 Display Version Info + run: | + echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}" + echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}" + echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}" + + - name: Step-05 Install .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 9.0.x + + - name: Step-06 Restore dependencies + run: dotnet restore + working-directory: '${{ env.working-directory }}' + + - name: Step-07 Build Version (Alpha) + run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} + working-directory: '${{ env.working-directory }}' + + - name: Step-08 Test Solution + run: dotnet test --configuration Release --no-build --no-restore --verbosity normal + working-directory: '${{ env.working-directory }}' + + - name: Step-09 Create NuGet Package + run: dotnet pack --configuration Release --no-build --output ./packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} + working-directory: '${{ env.working-directory }}' + + - name: Step-10 Publish to Github Packages + run: | + dotnet tool install gpr --global + find ./packages -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \; + working-directory: '${{ env.working-directory }}' + + - name: Step-11 Publish to NuGet.org (for release pre-releases) + if: ${{ env.nuget-token != '' && contains(github.ref, 'pre-release/v') }} + run: | + find ./packages -name "*.nupkg" -print -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \; + working-directory: '${{ env.working-directory }}' \ No newline at end of file diff --git a/.github/workflows/Release-CI.yml b/.github/workflows/Release-CI.yml new file mode 100644 index 0000000..59e39ab --- /dev/null +++ b/.github/workflows/Release-CI.yml @@ -0,0 +1,71 @@ +name: release-ci +on: + push: + branches: + - release/** + - release + +jobs: + Build-Test-Publish: + runs-on: ubuntu-latest + env: + working-directory: ${{ github.workspace }} + github-token: '${{ secrets.GH_Packages }}' + nuget-token: '${{ secrets.NUGET_API_KEY }}' + + steps: + - name: Step-01 Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: 5.x + + - name: Step-02 Check out Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Step-03 Calculate Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + + - name: Step-04 Display Version Info + run: | + echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}" + echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}" + echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}" + echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}" + + - name: Step-05 Install .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 9.0.x + + - name: Step-06 Restore dependencies + run: dotnet restore + working-directory: '${{ env.working-directory }}' + + - name: Step-07 Build Version (Stable) + run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} + working-directory: '${{ env.working-directory }}' + + - name: Step-08 Test Solution + run: dotnet test --configuration Release --no-build --no-restore --verbosity normal + working-directory: '${{ env.working-directory }}' + + - name: Step-09 Create NuGet Package + run: dotnet pack --configuration Release --no-build --output ./packages -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }} + working-directory: '${{ env.working-directory }}' + + - name: Step-10 Publish to Github Packages + run: | + dotnet tool install gpr --global + find ./packages -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \; + working-directory: '${{ env.working-directory }}' + + - name: Step-11 Publish to NuGet.org + if: ${{ env.nuget-token != '' }} + run: | + find ./packages -name "*.nupkg" -print -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \; + working-directory: '${{ env.working-directory }}' \ No newline at end of file diff --git a/SourceFlow.Net.sln b/SourceFlow.Net.sln index 13e9b70..bdf7b2a 100644 --- a/SourceFlow.Net.sln +++ b/SourceFlow.Net.sln @@ -27,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{F81A2C .github\workflows\Master-CodeQL.yml = .github\workflows\Master-CodeQL.yml .github\workflows\PR-CI.yml = .github\workflows\PR-CI.yml .github\workflows\PR-CodeQL.yml = .github\workflows\PR-CodeQL.yml + .github\workflows\Pre-release-CI.yml = .github\workflows\Pre-release-CI.yml + .github\workflows\Release-CI.yml = .github\workflows\Release-CI.yml EndProjectSection EndProject Global From 443b6d4bf5d8f6886ed7c4896c6b6cd2f6b2ad1c Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:49:48 +0100 Subject: [PATCH 09/14] Update README.md Signed-off-by: Najaf Shaikh --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de84dd5..6cb639c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ninja SourceFlow.Net +# ninja SourceFlow.Net [![NuGet version](https://badge.fury.io/nu/SourceFlow.Net.svg)](https://badge.fury.io/nu/SourceFlow.Net) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/SourceFlow.Net/blob/master/LICENSE.md) [![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/SourceFlow.Net?logo=github&sort=semver)](https://github.com/CodeShayk/SourceFlow.Net/releases/latest) @@ -7,7 +7,7 @@ [![.Net 9.0](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) [![.Net Standard 2.1](https://img.shields.io/badge/.NetStandard-2.1-blue)](https://github.com/dotnet/standard/blob/v2.1.0/docs/versions/netstandard2.1.md) [![.Net Standard 2.0](https://img.shields.io/badge/.NetStandard-2.0-blue)](https://github.com/dotnet/standard/blob/v2.0.0/docs/versions/netstandard2.0.md) -[![.Net Framework 4.6.4](https://img.shields.io/badge/.Net-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46) +[![.Net Framework 4.6.2](https://img.shields.io/badge/.Net-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46)

From ee6a273845fc82af6920a3af59fb71c3dbe231e6 Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:51:42 +0100 Subject: [PATCH 10/14] Update src/SourceFlow/SourceFlow.csproj updated readme documentation to net462 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Najaf Shaikh --- src/SourceFlow/SourceFlow.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SourceFlow/SourceFlow.csproj b/src/SourceFlow/SourceFlow.csproj index 1ea7831..d063df0 100644 --- a/src/SourceFlow/SourceFlow.csproj +++ b/src/SourceFlow/SourceFlow.csproj @@ -1,7 +1,7 @@  - net462;netstandard2.0;netstandard2.1;net9.0 + net464;netstandard2.0;netstandard2.1;net9.0 1.0.0-alpha.1 https://github.com/CodeShayk/SourceFlow.Net git From 46c0afa76fbd7b0c4321802025439b7d24460ad5 Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:52:20 +0100 Subject: [PATCH 11/14] Update src/SourceFlow/SourceFlow.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Najaf Shaikh --- src/SourceFlow/SourceFlow.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SourceFlow/SourceFlow.csproj b/src/SourceFlow/SourceFlow.csproj index d063df0..8b22bc2 100644 --- a/src/SourceFlow/SourceFlow.csproj +++ b/src/SourceFlow/SourceFlow.csproj @@ -40,7 +40,9 @@ True - + + True + From 7a80bfac6afa51de04675989d001eab2d73cc706 Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:53:11 +0100 Subject: [PATCH 12/14] Potential fix for code scanning alert no. 17: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Najaf Shaikh --- .github/workflows/Pre-release-CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Pre-release-CI.yml b/.github/workflows/Pre-release-CI.yml index 9de9257..9231e72 100644 --- a/.github/workflows/Pre-release-CI.yml +++ b/.github/workflows/Pre-release-CI.yml @@ -1,3 +1,5 @@ +permissions: + contents: read name: pre-release-ci on: push: From c48fa7a9fd82dfa8d2008259e220852ad78273d7 Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:53:26 +0100 Subject: [PATCH 13/14] Potential fix for code scanning alert no. 18: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Najaf Shaikh --- .github/workflows/Release-CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Release-CI.yml b/.github/workflows/Release-CI.yml index 59e39ab..11959d3 100644 --- a/.github/workflows/Release-CI.yml +++ b/.github/workflows/Release-CI.yml @@ -5,6 +5,8 @@ on: - release/** - release +permissions: + contents: read jobs: Build-Test-Publish: runs-on: ubuntu-latest From 629d12977776b32ae855dd7275f82dd893925377 Mon Sep 17 00:00:00 2001 From: Najaf Shaikh Date: Sun, 17 Aug 2025 23:58:21 +0100 Subject: [PATCH 14/14] Update SourceFlow.csproj Signed-off-by: Najaf Shaikh --- src/SourceFlow/SourceFlow.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SourceFlow/SourceFlow.csproj b/src/SourceFlow/SourceFlow.csproj index 8b22bc2..f5de4e9 100644 --- a/src/SourceFlow/SourceFlow.csproj +++ b/src/SourceFlow/SourceFlow.csproj @@ -1,7 +1,7 @@  - net464;netstandard2.0;netstandard2.1;net9.0 + net462;netstandard2.0;netstandard2.1;net9.0 1.0.0-alpha.1 https://github.com/CodeShayk/SourceFlow.Net git