@@ -11,41 +11,33 @@ if(Test-Path .\artifacts) {
11
11
12
12
$branch = @ { $true = $env: APPVEYOR_REPO_BRANCH ; $false = $ (git symbolic- ref -- short - q HEAD) }[$env: APPVEYOR_REPO_BRANCH -ne $NULL ];
13
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" ]
14
+ $suffix = @ { $true = " " ; $false = " $ ( $branch.Substring (0 , [math ]::Min(10 , $branch.Length ))) -$revision " }[$branch -eq " main" -and $revision -ne " local" ]
15
+ $commitHash = $ (git rev- parse -- short HEAD)
16
+ $buildSuffix = @ { $true = " $ ( $suffix ) -$ ( $commitHash ) " ; $false = " $ ( $branch ) -$ ( $commitHash ) " }[$suffix -ne " " ]
15
17
16
- echo " build: Version suffix is $suffix "
18
+ echo " build: Package version suffix is $suffix "
19
+ echo " build: Build version suffix is $buildSuffix "
17
20
18
21
foreach ($src in ls src/* ) {
19
22
Push-Location $src
20
23
21
- echo " build: Packaging project in $src "
24
+ echo " build: Packaging project in $src "
22
25
26
+ & dotnet build - c Release -- version- suffix= $buildSuffix - p:EnableSourceLink= true
23
27
if ($suffix ) {
24
- & dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix -- include - source
28
+ & dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix -- no - build
25
29
} else {
26
- & dotnet pack - c Release - o ..\..\artifacts -- include - source
30
+ & dotnet pack - c Release - o ..\..\artifacts -- no - build
27
31
}
28
-
29
32
if ($LASTEXITCODE -ne 0 ) { exit 1 }
30
33
31
34
Pop-Location
32
35
}
33
36
34
- foreach ($test in ls test/* .PerformanceTests) {
35
- Push-Location $test
36
-
37
- echo " build: Building performance test project in $test "
38
-
39
- & dotnet build - c Release
40
- if ($LASTEXITCODE -ne 0 ) { exit 2 }
41
-
42
- Pop-Location
43
- }
44
-
45
37
foreach ($test in ls test/* .Tests) {
46
38
Push-Location $test
47
39
48
- echo " build: Testing project in $test "
40
+ echo " build: Testing project in $test "
49
41
50
42
& dotnet test - c Release
51
43
if ($LASTEXITCODE -ne 0 ) { exit 3 }
0 commit comments