This repository has been archived by the owner on Mar 2, 2021. It is now read-only.
forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
appveyor.yml
78 lines (65 loc) · 2.8 KB
/
appveyor.yml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: '{build}'
branches:
only:
- master
- vNext
skip_tags: true
clone_folder: C:\projects\libgit2sharp
environment:
version : 0.22.0
matrix:
- xunit_runner: xunit.console.clr4.exe
Arch: 64
- xunit_runner: xunit.console.clr4.x86.exe
Arch: 32
matrix:
fast_finish: true
install:
- ps: |
Write-Host "Commit being built = $($Env:APPVEYOR_REPO_COMMIT)"
Write-Host "Current build version = $($Env:VERSION)"
Write-Host "Target branch = $($Env:APPVEYOR_REPO_BRANCH)"
Write-Host "Is a Pull Request = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)"
$BuildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
Write-Host "Build UTC date = $BuildDate"
$VersionSuffix = ""
If ($Env:APPVEYOR_REPO_BRANCH -ne "master")
{
$VersionSuffix = "-pre$BuildDate"
}
$Version = "$($Env:VERSION)$($VersionSuffix)"
$Env:ASSEMBLY_INFORMATIONAL_VERSION = $Version
Write-Host "Assembly informational version = $($Env:ASSEMBLY_INFORMATIONAL_VERSION)"
$ShouldPublishNugetArtifact = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)"
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
Write-Host "Should publish Nuget artifact = $($Env:SHOULD_PUBLISH_NUGET_ARTIFACT)"
cinst sourcelink -y
assembly_info:
patch: true
file: LibGit2Sharp\Properties\AssemblyInfo.cs
assembly_version: '$(VERSION)'
assembly_file_version: '$(VERSION)'
assembly_informational_version: '$(ASSEMBLY_INFORMATIONAL_VERSION)'
cache:
- packages
before_build:
- nuget restore "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln"
build_script:
- msbuild "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln" /verbosity:normal /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:ExtraDefine="LEAKS_IDENTIFYING"
test_script:
- '%xunit_runner% "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor'
- IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
on_success:
- ps: |
& "$env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" -commitSha "$env:APPVEYOR_REPO_COMMIT" -postBuild { sourcelink index -pr LibGit2Sharp.csproj -pp Configuration Release -nf Core\NativeDllName.cs -nf Core\UniqueIdentifier.cs -nf Properties\AssemblyInfo.cs -r .. -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
Add-Type -Path "$env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
{
Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
}
notifications:
- provider: Email
to:
on_build_status_changed: true