Improve build scripts and move them to scripts/

This commit is contained in:
Kamil Trzciński 2022-11-26 13:54:20 +01:00
parent 5d653a3342
commit 43abc56a41
9 changed files with 100 additions and 28 deletions

31
scripts/build.ps1 Normal file
View file

@ -0,0 +1,31 @@
cd "$PSScriptRoot/.."
$configuration = "Release"
if ($args[0]) {
$configuration = $args[0]
}
$path = "build-$configuration"
if ($args[1]) {
$path = $args[1]
}
$majorVer = Get-Content VERSION
$lastVer = git tag --sort version:refname --list "$majorVer.*" | Select -last 1
echo "Configuration: $configuration"
echo "BuildPath: $path"
echo "Major: $majorVer"
echo "lastVer: $lastVer"
if ($lastVer -ne "") {
$nextVer = $lastVer.Split('.')
$lastItem = $nextVer.Length-1
$nextVer[$lastItem] = [int]$nextVer[$lastItem] + 1
$nextVer = $nextVer -Join '.'
} else {
$nextVer="$majorVer.0"
}
dotnet --list-sdks -or winget install Microsoft.DotNet.SDK.6
dotnet build --configuration "$configuration" "/property:Version=$nextVer" --output "$path"