Skip to content

Commit 2384d12

Browse files
committed
Merge pull request #634 from jornh/feature/av-nuget-tags
Have appveyor set nuget dependency versions based on tags
2 parents 907cca8 + 16771ea commit 2384d12

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

build.ps1

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,29 @@ $WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition
1414

1515
$CefSln = Join-Path $WorkingDir 'CefSharp3.sln'
1616

17+
function Write-Diagnostic
18+
{
19+
param(
20+
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
21+
[string] $Message
22+
)
23+
24+
Write-Host
25+
Write-Host $Message -ForegroundColor Green
26+
Write-Host
27+
}
28+
1729
if (Test-Path Env:\APPVEYOR_BUILD_VERSION)
1830
{
1931
$Version = $env:APPVEYOR_BUILD_VERSION
2032
}
2133

34+
if ($env:APPVEYOR_REPO_TAG -eq "True")
35+
{
36+
$Version = "$env:APPVEYOR_REPO_BRANCH".Substring(1) # trim leading "v"
37+
Write-Diagnostic "Setting version based on tag to $Version"
38+
}
39+
2240
# https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1
2341
function Invoke-BatchFile
2442
{
@@ -43,18 +61,6 @@ function Invoke-BatchFile
4361
Remove-Item $tempFile
4462
}
4563

46-
function Write-Diagnostic
47-
{
48-
param(
49-
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
50-
[string] $Message
51-
)
52-
53-
Write-Host
54-
Write-Host $Message -ForegroundColor Green
55-
Write-Host
56-
}
57-
5864
function Die
5965
{
6066
param(

0 commit comments

Comments
 (0)