1 Star 0 Fork 0

builderman/serilog-sinks-console

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Build.ps1 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
Write-Host "build: Build started"
Push-Location $PSScriptRoot
if(Test-Path .\artifacts) {
Write-Host "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}
& dotnet restore --no-cache
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
$commitHash = $(git rev-parse --short HEAD)
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
Write-Host "build: Package version suffix is $suffix"
Write-Host "build: Build version suffix is $buildSuffix"
foreach ($src in Get-ChildItem src/*) {
Push-Location $src
Write-Host "build: Packaging project in $src"
& dotnet build -c Release --version-suffix=$buildSuffix
if ($suffix) {
& dotnet pack -c Release --include-source -o ..\..\artifacts --version-suffix=$suffix --no-build
} else {
& dotnet pack -c Release --include-source -o ..\..\artifacts --no-build
}
if($LASTEXITCODE -ne 0) { exit 1 }
Pop-Location
}
foreach ($sample in Get-ChildItem sample/*) {
Push-Location $sample
Write-Host "build: Testing project in $sample"
& dotnet build -c Release --version-suffix=$buildSuffix
if($LASTEXITCODE -ne 0) { exit 3 }
Pop-Location
}
foreach ($test in Get-ChildItem test/*.Tests) {
Push-Location $test
Write-Host "build: Testing project in $test"
& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
Pop-Location
}
Pop-Location
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/builderman/serilog-sinks-console.git
git@gitee.com:builderman/serilog-sinks-console.git
builderman
serilog-sinks-console
serilog-sinks-console
dev

搜索帮助