8000 Clean AppVeyor PowerShell scripting · UiPath/libgit2sharp@ef60b2a · GitHub
[go: up one dir, main page]

Skip to content

Commit ef60b2a

Browse files
committed
Clean AppVeyor PowerShell scripting
1 parent 01b4c5e commit ef60b2a

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

appveyor.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ matrix:
2222

2323
install:
2424
- ps: |
25-
Write-Host "Commit being built = $($Env:APPVEYOR_REPO_COMMIT)"
26-
Write-Host "Current build version = $($Env:VERSION)"
27-
Write-Host "Target branch = $($Env:APPVEYOR_REPO_BRANCH)"
25+
Write-Host "Commit being built = $Env:APPVEYOR_REPO_COMMIT"
26+
Write-Host "Current build version = $Env:VERSION"
27+
Write-Host "Target branch = $Env:APPVEYOR_REPO_BRANCH"
2828
Write-Host "Is a Pull Request = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)"
29+
2930
$BuildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
3031
Write-Host "Build UTC date = $BuildDate"
32+
3133
$VersionSuffix = ""
3234
If ($Env:APPVEYOR_REPO_BRANCH -ne "master")
3335
{
3436
$VersionSuffix = "-pre$BuildDate"
3537
}
3638
$Version = "$($Env:VERSION)$($VersionSuffix)"
3739
$Env:ASSEMBLY_INFORMATIONAL_VERSION = $Version
38-
Write-Host "Assembly informational version = $($Env:ASSEMBLY_INFORMATIONAL_VERSION)"
39-
$ShouldPublishNugetArtifact = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)"
40+
Write-Host "Assembly informational version = $Env:ASSEMBLY_INFORMATIONAL_VERSION"
41+
42+
$ShouldPublishNugetArtifact = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
4043
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
41-
Write-Host "Should publish Nuget artifact = $($Env:SHOULD_PUBLISH_NUGET_ARTIFACT)"
44+
Write-Host "Should publish Nuget artifact = $Env:SHOULD_PUBLISH_NUGET_ARTIFACT"
45+
4246
cinst sourcelink -y
4347
4448
assembly_info:
@@ -52,23 +56,33 @@ cache:
5256
- packages
5357

5458
before_build:
55-
- nuget restore "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln"
59+
- ps: nuget restore "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln"
5660

5761
build_script:
5862
- msbuild "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln" /verbosity:normal /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:ExtraDefine="LEAKS_IDENTIFYING"
5963

6064
test_script:
61-
- '%xunit_runner% "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor'
62-
- IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
65+
- ps: & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
6366

6467
on_success:
6568
- ps: |
66-
& "$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%' }
67-
Add-Type -Path "$env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
69+
& "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
70+
-commitSha "$Env:APPVEYOR_REPO_COMMIT" `
71+
-postBuild { sourcelink index `
72+
-pr LibGit2Sharp.csproj `
73+
-pp Configuration Release `
74+
-nf Core\NativeDllName.cs `
75+
-nf Core\UniqueIdentifier.cs `
76+
-nf Properties\AssemblyInfo.cs `
77+
-r .. `
78+
-u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
79+
80+
Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
6881
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
82+
6983
If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
7084
{
71-
Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
85+
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
7286
}
7387
7488
notifications:

0 commit comments

Comments
 (0)
0