Skip to content

Commit

Permalink
New build scripts [Skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Jul 18, 2016
1 parent 0c5f924 commit 6b346dc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
52 changes: 41 additions & 11 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
echo "build: Build started"

Push-Location $PSScriptRoot

if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
if(Test-Path .\artifacts) {
echo "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}

& dotnet restore
& dotnet restore --no-cache

$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$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"]

Push-Location src/Serilog.Enrichers.Environment
echo "build: Version suffix is $suffix"

& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
if($LASTEXITCODE -ne 0) { exit 1 }
foreach ($src in ls src/*) {
Push-Location $src

Pop-Location
Push-Location test/Serilog.Enrichers.Environment.Tests
echo "build: Packaging project in $src"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 2 }
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
if($LASTEXITCODE -ne 0) { exit 1 }

Pop-Location
}

foreach ($test in ls test/*.PerformanceTests) {
Push-Location $test

echo "build: Building performance test project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}

foreach ($test in ls test/*.Tests) {
Push-Location $test

echo "build: Testing project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }

Pop-Location
}

Pop-Location
Pop-Location
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ deploy:
secure: nvZ/z+pMS91b3kG4DgfES5AcmwwGoBYQxr9kp4XiJHj25SAlgdIxFx++1N0lFH2x
skip_symbols: true
on:
branch: /^(master)$/
branch: /^(master|dev)$/
- provider: GitHub
auth_token:
secure: ggZTqqV1z0xecDoQbeoy3A7xikShCt9FWZIGp95dG9Fo0p5RAT9oGU0ZekHfUIwk
secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX
artifact: /Serilog.*\.nupkg/
tag: v$(appveyor_build_version)
on:
branch: master
branch: master
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview1-002702"
"version": "1.0.0-preview2-003121"
}
}
2 changes: 1 addition & 1 deletion src/Serilog.Enrichers.Environment/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "2.0.1-*",
"description": "Enrich Serilog log events with properties from System.Environment.",
"authors": [
"Serilog Contributors"
Expand Down

0 comments on commit 6b346dc

Please sign in to comment.