diff options
author | nulltoken <emeric.fermas@gmail.com> | 2015-01-20 18:56:41 +0300 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-01-20 18:56:41 +0300 |
commit | d60995fa712515de4167757d07918c3efe30a3a7 (patch) | |
tree | 24d1a38ab5ca6beba8f0b2723c6cefdc138d5af5 /appveyor.yml | |
parent | e43c1cc0e0efa0320acd6d0587507a06fea0128f (diff) |
Make AppVeyor create NuGet packages upon a merge
Prior to generating the packages, the AssemblyInfo.cs is patched with
the build version. Additionally, the assembly informational version
will bear a `-pre` suffix would this build result from a push on a
branch which isn't `master`.
Produced packages will be published as build artifacts.
No packaging will be performed when the build has been triggered from a Pull Request.
Diffstat (limited to 'appveyor.yml')
-rw-r--r-- | appveyor.yml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/appveyor.yml b/appveyor.yml index 29943470..aca3cde7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,6 +19,30 @@ environment: matrix: fast_finish: true +install: +- ps: | + Write-Host "Current build version = $($Env:APPVEYOR_BUILD_VERSION)" + Write-Host "Target branch = $($Env:APPVEYOR_REPO_BRANCH)" + Write-Host "Is a Pull Request = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)" + $VersionSuffix = "" + If ($Env:APPVEYOR_REPO_BRANCH -ne "master") + { + $VersionSuffix = "-pre" + } + $Version = "$($Env:APPVEYOR_BUILD_VERSION)$($VersionSuffix)" + $Env:ASSEMBLY_INFORMATIONAL_VERSION = $Version + Write-Host "Assembly informational version = $($Env:ASSEMBLY_INFORMATIONAL_VERSION)" + $ShouldBuildNuget = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)" + $Env:SHOULD_BUILD_NUGET = $ShouldBuildNuget + Write-Host "Should build Nuget = $($Env:SHOULD_BUILD_NUGET)" + +assembly_info: + patch: true + file: LibGit2Sharp\Properties\AssemblyInfo.cs + assembly_version: '{version}' + assembly_file_version: '{version}' + assembly_informational_version: '$(ASSEMBLY_INFORMATIONAL_VERSION)' + cache: - packages @@ -32,6 +56,14 @@ test_script: - '%xunit_runner% "C:\projects\libgit2sharp\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor' - IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% +on_success: +- ps: | + If ($Env:SHOULD_BUILD_NUGET -eq $True) + { + & "C:\projects\libgit2sharp\nuget.package\BuildNugetPackage.ps1" "$env:APPVEYOR_REPO_COMMIT" + Get-ChildItem "C:\projects\libgit2sharp\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + } + notifications: - provider: Email to: |