Skip to content

Commit 1c9de6a

Browse files
committed
add default build suffix when appveyor_repro_tag present
1 parent 37ca8d5 commit 1c9de6a

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

build.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ param(
3131
$ErrorActionPreference = "Stop"
3232
$msgColor = @{Default="White"; Heading="Cyan"; Danger="Red"; Success="Green"; Attention="Yellow"}
3333
$BuildConfiguration = 'Release'
34+
$DefaultCIBuildSuffix = 'ci'
3435

3536
function Die ($message) {
3637
Write-Host ">>> ERROR:`t$message`n" -ForegroundColor $msgColor.Danger
@@ -90,7 +91,6 @@ if($DebugBuild)
9091
if($BuildNumber -eq 0 -and $PullRequestNumber -eq 0) { Die "Build Number or Pull Request Number must be supplied" }
9192
if(!(Test-Path "version.props")) { Die "Unable to locate required file: version.props" }
9293
$outputPath = "$PSScriptRoot\.nupkgs"
93-
$queryBuilderPath = "$PSScriptRoot\QueryBuilder\QueryBuilder.csproj"
9494
$stdSwitches = " /p:Configuration=$BuildConfiguration /nologo /verbosity:d /p:BuildNumber=$BuildNumber"
9595

9696
if($SourceLinkEnable)
@@ -99,6 +99,16 @@ if($SourceLinkEnable)
9999
}
100100

101101
$versionProps = [xml](Get-Content "version.props")
102+
103+
if($Env:APPVEYOR_REPRO_TAG)
104+
{
105+
if([string]::IsNullOrWhiteSpace($versionProps.Project.PropertyGroup.VersionSuffix))
106+
{
107+
$versionProps.Project.PropertyGroup.VersionSuffix=$DefaultCIBuildSuffix
108+
$versionProps.Save("$PSScriptRoot\version.props")
109+
}
110+
}
111+
102112
$versionPrefix = $versionProps.Project.PropertyGroup.VersionPrefix
103113
$versionSuffix = $versionProps.Project.PropertyGroup.VersionSuffix
104114

version.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
2-
<PropertyGroup>
3-
<VersionPrefix>1.1.7</VersionPrefix>
4-
<VersionSuffix></VersionSuffix>
5-
</PropertyGroup>
6-
</Project>
2+
<PropertyGroup>
3+
<VersionPrefix>1.1.7</VersionPrefix>
4+
<VersionSuffix></VersionSuffix>
5+
</PropertyGroup>
6+
</Project>

0 commit comments

Comments
 (0)