Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 26 additions & 63 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ on:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"

jobs:
Run-Lint:
runs-on: ubuntu-latest
env:
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
Expand All @@ -23,99 +24,61 @@ 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

- name: Step-02 Check out Code
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
72 changes: 72 additions & 0 deletions .github/workflows/Pre-release-CI.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
73 changes: 73 additions & 0 deletions .github/workflows/Release-CI.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
35 changes: 35 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -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: []
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# <img src="https://github.com/CodeShayk/SourceFlow.Net/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> SourceFlow.Net
# <img src="https://github.com/CodeShayk/SourceFlow.Net/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> 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)
[![master-build](https://github.com/CodeShayk/SourceFlow.Net/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/SourceFlow.Net/actions/workflows/Master-Build.yml)
[![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)

<p align="center"> </p>
<p align="center">
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions SourceFlow.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading
Loading