-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-ci.ps1
26 lines (17 loc) · 985 Bytes
/
build-ci.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$ErrorActionPreference = 'Stop'
$versionInfo = .\tools\GitVersion\GitVersion.exe | ConvertFrom-Json
$versionPrefix = $versionInfo.MajorMinorPatch
$versionSuffix = $versionInfo.NuGetPreReleaseTagV2
$informationalVersion = $versionInfo.InformationalVersion
If ($versionSuffix) {
Write-Host "Build version is '$versionPrefix-$versionSuffix'."
} Else {
Write-Host "Build version is '$versionPrefix'."
}
Write-Host 'Restoring packages...'
dotnet restore /p:VersionPrefix="$versionPrefix" /p:VersionSuffix="$versionSuffix" /p:AssemblyInformationalVersion="$informationalVersion"
Write-Host 'Building...'
dotnet build /p:VersionPrefix="$versionPrefix" /p:VersionSuffix="$versionSuffix" /p:AssemblyInformationalVersion="$informationalVersion"
Write-Host 'Packing...'
$PackagesDir = "$PWD/src/artifacts/packages"
dotnet pack /p:VersionPrefix="$versionPrefix" /p:VersionSuffix="$versionSuffix" /p:AssemblyInformationalVersion="$informationalVersion" -o $PackagesDir --include-symbols