File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change
1
+ echo " build: Build started"
2
+
1
3
Push-Location $PSScriptRoot
2
4
3
- if (Test-Path .\artifacts) { Remove-Item .\artifacts - Force - Recurse }
5
+ if (Test-Path .\artifacts) {
6
+ echo " build: Cleaning .\artifacts"
7
+ Remove-Item .\artifacts - Force - Recurse
8
+ }
4
9
5
- & dotnet restore
10
+ & dotnet restore -- no - cache
6
11
7
- $revision = @ { $true = $env: APPVEYOR_BUILD_NUMBER ; $false = 1 }[$env: APPVEYOR_BUILD_NUMBER -ne $NULL ];
12
+ $branch = @ { $true = $env: APPVEYOR_REPO_BRANCH ; $false = $ (git symbolic- ref -- short - q HEAD) }[$env: APPVEYOR_REPO_BRANCH -ne $NULL ];
13
+ $revision = @ { $true = " {0:00000}" -f [convert ]::ToInt32(" 0" + $env: APPVEYOR_BUILD_NUMBER , 10 ); $false = " local" }[$env: APPVEYOR_BUILD_NUMBER -ne $NULL ];
14
+ $suffix = @ { $true = " " ; $false = " $ ( $branch.Substring (0 , [math ]::Min(10 , $branch.Length ))) -$revision " }[$branch -eq " master" -and $revision -ne " local" ]
8
15
9
- Push-Location src / Serilog.Enrichers.Thread
16
+ echo " build: Version suffix is $suffix "
10
17
11
- & dotnet pack - c Release - o ..\..\.\artifacts -- version - suffix = $revision
12
- if ( $LASTEXITCODE -ne 0 ) { exit 1 }
18
+ foreach ( $src in ls src /* ) {
19
+ Push-Location $src
13
20
14
- Pop-Location
15
- # Push-Location test/Serilog.Enrichers.Thread.Tests
21
+ echo " build: Packaging project in $src "
22
+
23
+ & dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix
24
+ if ($LASTEXITCODE -ne 0 ) { exit 1 }
16
25
17
- # & dotnet test -c Release
18
- # if($LASTEXITCODE -ne 0) { exit 2 }
26
+ Pop-Location
27
+ }
19
28
20
- # Pop-Location
21
29
Pop-Location
You can’t perform that action at this time.
0 commit comments