File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -12,16 +12,24 @@ if(Test-Path .\artifacts) {
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
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
24
echo " build: Packaging project in $src "
22
25
23
- & dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix - p:ContinuousIntegrationBuild= true
24
- if ($LASTEXITCODE -ne 0 ) { exit 1 }
26
+ & dotnet build - c Release -- version- suffix= $buildSuffix - p:ContinuousIntegrationBuild= true
27
+ if ($suffix ) {
28
+ & dotnet pack - c Release - o ..\..\artifacts -- version- suffix= $suffix -- no- build
29
+ } else {
30
+ & dotnet pack - c Release - o ..\..\artifacts -- no- build
31
+ }
32
+ if ($LASTEXITCODE -ne 0 ) { throw " build failed" }
25
33
26
34
Pop-Location
27
35
}
You can’t perform that action at this time.
0 commit comments