diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml
index 7870275..2c7ddc9 100644
--- a/.github/workflows/PR-CI.yml
+++ b/.github/workflows/PR-CI.yml
@@ -6,6 +6,7 @@ on:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
+
jobs:
Run-Lint:
runs-on: ubuntu-latest
@@ -13,7 +14,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
@@ -23,18 +24,20 @@ jobs:
FILTER_REGEX_INCLUDE: .*src/.*
DEFAULT_BRANCH: master
GITHUB_TOKEN: '${{ env.github-token }}'
+
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 +45,40 @@ 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 }}"
+
+ - 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 }}
- 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 (Beta)
+ run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
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}}
- 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
- 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/')}}
- runs-on: ubuntu-latest
- env:
- nuget-token: '${{ secrets.NUGET_API_KEY }}'
- working-directory: /home/runner/work/sourceflow.net/sourceflow.net
- 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 }}
+ 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..9231e72
--- /dev/null
+++ b/.github/workflows/Pre-release-CI.yml
@@ -0,0 +1,72 @@
+permissions:
+ contents: read
+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..11959d3
--- /dev/null
+++ b/.github/workflows/Release-CI.yml
@@ -0,0 +1,73 @@
+name: release-ci
+on:
+ push:
+ branches:
+ - release/**
+ - release
+
+permissions:
+ contents: read
+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/GitVersion.yml b/GitVersion.yml
new file mode 100644
index 0000000..d4f856d
--- /dev/null
+++ b/GitVersion.yml
@@ -0,0 +1,35 @@
+next-version: 1.0.0
+tag-prefix: '[vV]'
+mode: ContinuousDeployment
+branches:
+ master:
+ regex: ^master$|^main$
+ tag: ''
+ source-branches: ['develop']
+ release:
+ mode: ContinuousDelivery
+ tag: beta
+ increment: Minor
+ prevent-increment-of-merged-branch-version: true
+ source-branches: ['master', 'develop']
+ pre-release:
+ regex: ^pre-release$|^pre-release/.*
+ tag: alpha
+ increment: Minor
+ prevent-increment-of-merged-branch-version: true
+ source-branches: ['master', 'develop']
+ develop:
+ regex: ^develop$|^dev$
+ tag: beta
+ increment: Minor
+ source-branches: ['master']
+ pull-request:
+ tag: beta
+ regex: ^(pull|pull\-requests|pr)[/-]
+ source-branches: ['master', 'develop', 'release', 'pre-release']
+ feature:
+ tag: '{BranchName}'
+ increment: Inherit
+ source-branches: ['master', 'develop', 'release']
+ignore:
+ sha: []
\ No newline at end of file
diff --git a/README.md b/README.md
index b822df3..6cb639c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-#
SourceFlow.Net
+#
SourceFlow.Net
[](https://badge.fury.io/nu/SourceFlow.Net)
[](https://github.com/CodeShayk/SourceFlow.Net/blob/master/LICENSE.md)
[](https://github.com/CodeShayk/SourceFlow.Net/releases/latest)
@@ -6,6 +6,8 @@
[](https://github.com/CodeShayk/SourceFlow.Net/actions/workflows/Master-CodeQL.yml)
[](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
[](https://github.com/dotnet/standard/blob/v2.1.0/docs/versions/netstandard2.1.md)
+[](https://github.com/dotnet/standard/blob/v2.0.0/docs/versions/netstandard2.0.md)
+[](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..bdf7b2a 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
@@ -26,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
diff --git a/src/SourceFlow/SourceFlow.csproj b/src/SourceFlow/SourceFlow.csproj
index da04ee0..f5de4e9 100644
--- a/src/SourceFlow/SourceFlow.csproj
+++ b/src/SourceFlow/SourceFlow.csproj
@@ -2,8 +2,47 @@