Lith 8 months ago
parent
commit
dd7ab27ff4

+ 36 - 12
.github/workflows/ki_devops3.yml → .github/workflows/ki_devops3_build.yml

@@ -1,14 +1,13 @@
 # This is a basic workflow to help you get started with Actions
 
-name: ki_devops3
+name: ki_devops3_build
 
 # Controls when the action will run. 
 on:
   
-  push:
+  #push:
     # Triggers the workflow on push events for the branches start with release
-    branches:
-      - 'release/**'
+    #branches:: [ 'release/**' ]
 
     # Triggers the workflow on push events but only for the master branch
     #branches: [ master ]
@@ -18,24 +17,49 @@ on:
     
   # Allows you to run this workflow manually from the Actions tab
   workflow_dispatch:
+  merge_group:
 
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
-  # This workflow contains a single job called "build"
-  build:
+
+  # This workflow contains a single job called "devops3_test"
+  devops3_test:
     # The type of runner that the job will run on
     runs-on: ubuntu-latest
 
     # Steps represent a sequence of tasks that will be executed as part of the job
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
 
       # Runs a set of commands using the runners shell
-      - name: Run startup.bash
+      - name: Run test
         run: |
            set -e
-           echo start build
+           echo call ./Publish/DevOps3/build-bash/10.Test.bash to test
+
+           cd ./Publish/DevOps3/build-bash
+           bash 10.Test.bash;
+           echo run test succeed!
+
+  # This workflow contains a single job called "devops3_build"
+  devops3_build:
+    # Requiring successful dependent jobs
+    needs: devops3_test
+
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v4
+
+      # Runs a set of commands using the runners shell
+      - name: Run build
+        run: |
+           set -e
+           echo call ./Publish/DevOps3/github-bash/startup.bash to build
 
            export DOCKER_ImagePrefix="serset/"
            export DOCKER_USERNAME="${{ secrets.DOCKER_USERNAME  }}"
@@ -47,10 +71,10 @@ jobs:
            cd ./Publish/DevOps3/github-bash
            bash startup.bash
            echo build succeed!
-           
+
            # echo "appName=${APPNAME}" >> $GITHUB_ENV
-           
-           
+
+
       - name: release_create
         id: release_create
         uses: actions/create-release@v1

+ 45 - 0
.github/workflows/ki_devops3_test.yml

@@ -0,0 +1,45 @@
+# This is a basic workflow to help you get started with Actions
+
+name: ki_devops3_test
+
+# Controls when the action will run. 
+on:
+  
+  #push:
+    # Triggers the workflow on push events for the branches start with release
+    #branches:: [ 'release/**' ]
+
+    # Triggers the workflow on push events but only for the master branch
+    #branches: [ master ]
+
+    # Triggers the workflow on push tag
+    #tags: ['*']
+    
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+  pull_request:
+    types: [opened, synchronize, reopened]
+  merge_group:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+  # This workflow contains a single job called "devops3_test"
+  devops3_test:
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v4
+
+      # Runs a set of commands using the runners shell
+      - name: Run test
+        run: |
+           set -e
+           echo call ./Publish/DevOps3/build-bash/10.Test.bash to test
+
+           cd ./Publish/DevOps3/build-bash
+           bash 10.Test.bash;
+           echo run test succeed!

+ 2 - 1
Publish/DevOps3/build-bash/19.get-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/20.change-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/21.change-to-next-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/22.add-suffix-to-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 0 - 57
Publish/DevOps3/build-cmd/40.Station-publish.bat

@@ -1,57 +0,0 @@
-@echo off
-
-::enable delayed arguments
-setlocal EnableDelayedExpansion
-
-
-:: #1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ../../..
-set basePath=%cd%
-
-
-:: #2 get netVersion
-set netVersion=net6.0
-for /f "tokens=3 delims=><" %%a in ('type %basePath%\dotnet\ServiceCenter\App.ServiceCenter\App.ServiceCenter.csproj^|findstr "<TargetFramework>.*TargetFramework"') do set netVersion=%%a
-
-
-set publishPath=%basePath%/Publish/release/release/Station(%netVersion%)
-echo publish Station
-echo dotnet version: %netVersion%
-
-
-
-:: #3 find projects and publish
-for /f "delims=" %%f in ('findstr /M /s /i "<publish>" *.csproj') do (
-	::get name
-	for /f "tokens=3 delims=><" %%a in ('type "%basePath%\%%f"^|findstr "<publish>.*publish"') do set name=%%a
-	echo publish !name!
-
-	::publish
-	cd /d "%basePath%\%%f\.."
-	dotnet build --configuration Release
-	dotnet publish --configuration Release --output "%publishPath%\!name!"
-	@if errorlevel 1 (echo . & echo .  & echo error & pause) 
-
-	::copy xml
-	xcopy  "bin\Release\%netVersion%\*.xml" "%publishPath%\!name!" /i /r /y
-)
-
-
-
-:: #4 copy dir
-xcopy "%basePath%\Publish\ReleaseFile\Station" "%publishPath%" /e /i /r /y
-
-
-
-:: #5 copy ServiceCenter
-xcopy "%publishPath%\ServiceCenter" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)\ServiceCenter" /e /i /r /y
-xcopy "%publishPath%\01.ServiceCenter.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
-xcopy "%publishPath%\01.Start-4580.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 36
Publish/DevOps3/build-cmd/50.docker-image-create.bat

@@ -1,36 +0,0 @@
-@echo off
-
-
-echo %~n0.bat start...
-
-
-:: #1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ../../..
-set basePath=%cd%
-
-:: #2
-set publishPath=%basePath%/Publish/release/release/Station(net6.0)
-set dockerPath=%basePath%/Publish/release/release/docker-image
-rd /s /q "%dockerPath%"
-
-
-:: #3 copy dir
-xcopy "%basePath%/Publish/ReleaseFile/docker-image" "%dockerPath%" /e /i /r /y
-
-
-:: #4 copy station 
-xcopy  "%publishPath%/ServiceCenter" "%dockerPath%/sers/app" /e /i /r /y
-xcopy  "%publishPath%/Gateway" "%dockerPath%/sers-gateway/app" /e /i /r /y
-xcopy  "%publishPath%/Gover" "%dockerPath%/sers-gover/app" /e /i /r /y
-xcopy  "%publishPath%/Demo" "%dockerPath%/sers-demo/app" /e /i /r /y
-xcopy  "%publishPath%/Robot" "%dockerPath%/sers-demo-robot/app" /e /i /r /y
-xcopy  "%basePath%/Publish/release/release/压测/单体压测net6.0/ServiceCenter" "%dockerPath%/sers-demo-sersall/app" /e /i /r /y
- 
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 36
Publish/DevOps3/build-cmd/51.docker-deploy-copy.bat

@@ -1,36 +0,0 @@
-@echo off
-
-
-echo %~n0.bat start...
-
-
-::#1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ..\..\..
-set basePath=%cd%
-
-
-:: #2
-set publishPath=%basePath%\Publish\release\release\Station(net6.0)
-set dockerPath=%basePath%\Publish\release\release\docker-deploy
-rd /s /q "%dockerPath%"
-
-
-:: #3 copy dir
-xcopy "%basePath%\Publish\ReleaseFile\docker-deploy" "%dockerPath%" /e /i /r /y
-
-
-:: #4 copy station 
-xcopy "%publishPath%\ServiceCenter\appsettings.json" "%dockerPath%\sers"
-xcopy "%publishPath%\Gateway\appsettings.json" "%dockerPath%\sers-gateway"
-xcopy "%publishPath%\Gover\appsettings.json" "%dockerPath%\sers-gover"
-xcopy "%publishPath%\Demo\appsettings.json" "%dockerPath%\sers-demo"
-xcopy "%publishPath%\Robot\appsettings.json" "%dockerPath%\sers-demo-robot"
-xcopy "%basePath%\Publish\release\release\压测\单体压测net6.0\ServiceCenter\appsettings.json" "%dockerPath%\sers-demo-sersall"
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 21
Publish/DevOps3/build-cmd/OneKey Release.bat

@@ -1,21 +0,0 @@
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "30.nuget-pack.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "40.Station-publish.bat"
-call "40.Station-publish(netcoreapp2.1).bat"
-call "40.Station-publish(net6.0).bat"
-
-call "41.StressTest-publish.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "50.docker-image-create.bat"
-call "51.docker-deploy-copy.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-
-
-echo %~n0.bat success
-
-pause

+ 0 - 46
Publish/DevOps3/build-cmd/Version-To-NextTemp.bat

@@ -1,46 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%-temp
-:: echo %newVersion%
-
-
- 
-:: #5 replace version in csproj
-echo replace verion [%version%]-^>[%newVersion%]
-echo.
-
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 46
Publish/DevOps3/build-cmd/Version-To-Preview.bat

@@ -1,46 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-:: set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%-preview
-:: echo %newVersion%
-
-
- 
-:: #5 replace version in csproj
-echo ×Ô¶¯Ð޸İ汾ºÅ [%version%]-^>[%newVersion%]
-echo.
-
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 43
Publish/DevOps3/build-cmd/Version-To-Release.bat

@@ -1,43 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-:: set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%
-:: echo %newVersion%
-echo [%version%]-^>[%newVersion%]
-
- 
-:: #5 replace version in csproj
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 32
Publish/DevOps3/build-cmd/Version-getVersion.bat

@@ -1,32 +0,0 @@
-@echo off
-
-:: get current version
-
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-::set /a v3=1+%v3%
-set  newVersion=%v1%.%v2%.%v3%-preview
-echo [%version%]-^>[%newVersion%]
-
-
-pause

+ 9 - 1
Publish/DevOps3/environment/README.md

@@ -1,5 +1,5 @@
 
-# DevOps 3.5
+# DevOps 3.6
 
 
 # build-bash
@@ -13,6 +13,14 @@ if this file exists, will not need approval for jenkins build.
 ----------------------------------------------
 # ReleaseLog
 
+-----------------------
+# 3.6
+> 2024-08-30
+
+- able to get release version from .props file
+- [github actions] auto trigger test workflow for PR in checks
+- [github actions] auto trigger test workflow for PR in checks
+
 -----------------------
 # 3.5
 > 2024-08-24

+ 0 - 3
Publish/DevOps3/github-bash/startup.bash

@@ -36,9 +36,6 @@ if [ ! $APPNAME ]; then
 	echo "APPNAME: [${APPNAME}]" 
 fi
 
-#---------------------------------------------- 
-echo '#0 run test'
-cd "$devOpsPath/build-bash"; bash 10.Test.bash;
 
 #---------------------------------------------- 
 echo '#1 build'

+ 3 - 29
README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm.ClickHouse/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.ClickHouse.svg)](https://www.nuget.org/packages/Vitorm.ClickHouse) ![](https://img.shields.io/nuget/dt/Vitorm.ClickHouse.svg) |
+|![](https://github.com/Vit-Orm/Vitorm.ClickHouse/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.ClickHouse.svg)](https://www.nuget.org/packages/Vitorm.ClickHouse) ![](https://img.shields.io/nuget/dt/Vitorm.ClickHouse.svg) |
 
 
 
@@ -261,8 +261,8 @@ namespace App
             // #1 No need to init Vitorm.Data
 
             // #2 Create Table
-            Data.Drop<User>();
-            Data.Create<User>();
+            Data.TryDropTable<User>();
+            Data.TryCreateTable<User>();
 
             // #3 Insert Records
             Data.Add(new User { id = 1, name = "lith" });
@@ -306,32 +306,6 @@ namespace App
             }
 
             // #8 Transactions
-            {
-                using var dbContext = Data.DataProvider<User>().CreateSqlDbContext();
-                using var tran1 = dbContext.BeginTransaction();
-
-                dbContext.Update(new User { id = 4, name = "u4001" });
-
-                using (var tran2 = dbContext.BeginTransaction())
-                {
-                    dbContext.Update(new User { id = 4, name = "u4002" });
-                    // will rollback
-                }
-
-                using (var tran2 = dbContext.BeginTransaction())
-                {
-                    dbContext.Update(new User { id = 4, name = "u4002" });
-                    tran2.Rollback();
-                }
-
-                using (var tran2 = dbContext.BeginTransaction())
-                {
-                    dbContext.Update(new User { id = 4, name = "u4003" });
-                    tran2.Commit();
-                }
-
-                tran1.Commit();
-            }
         }
 
         // Entity Definition

+ 3 - 0
Vitorm.ClickHouse.sln

@@ -11,6 +11,9 @@ EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7904FE51-04FF-4477-8E3A-CC340389EE32}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{05176905-A2A5-4015-9F04-2904506C902F}"
+	ProjectSection(SolutionItems) = preProject
+		src\Versions.props = src\Versions.props
+	EndProjectSection
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vitorm.ClickHouse", "src\Vitorm.ClickHouse\Vitorm.ClickHouse.csproj", "{853695CA-E3BF-492A-A20C-88122925AFC8}"
 EndProject

+ 6 - 0
src/Versions.props

@@ -0,0 +1,6 @@
+<Project>
+    <PropertyGroup>
+        <Version>2.1.2</Version>
+        <Vitorm_Version>[2.1.2, 2.2.0)</Vitorm_Version>
+    </PropertyGroup>
+</Project>

+ 2 - 2
src/Vitorm.ClickHouse/Vitorm.ClickHouse.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 
@@ -32,7 +32,7 @@
 
     <ItemGroup>
         <PackageReference Include="ClickHouse.Client" Version="7.7.3" />
-        <PackageReference Include="Vitorm" Version="[2.1.1, 2.2.0)" />
+        <PackageReference Include="Vitorm" Version="$(Vitorm_Version)"  />
     </ItemGroup>