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 @@ -# 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) @@ -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.2](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..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 @@ 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 + + + True + @@ -12,4 +51,19 @@ + + + True + \ + + + True + \ + + + True + \ + + +