-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update AppVeyor config for tagged versioning * Update install script and add local test script * Switch to using AV build number as assembly revision
- Loading branch information
Showing
15 changed files
with
94 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Describe from the lastest tag matching 'vX.Y.Z', removing the initial 'v' | ||
$description = $(git describe --long --tags --match 'v[0-9]*.[0-9]*.[0-9]*').substring(1); | ||
|
||
# Description is in the format of: TAG-COMMITS_SINCE_TAG-COMMIT_HASH | ||
$dparts = $description -split('-'); | ||
$short_version = $dparts[0]; | ||
$commits_since_tag = $dparts[1]; | ||
$commit_hash = $dparts[2]; | ||
|
||
$masterBranches = @("master"); | ||
|
||
# If not in master branch, set branch variable | ||
$av_branch = $env:APPVEYOR_REPO_BRANCH; | ||
$branch = $(if ($masterBranches -contains $av_branch) { "" } else { "-$av_branch" }); | ||
|
||
# If this is a PR, add the PR suffix | ||
$suffix = $(if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { "-pr$env:APPVEYOR_PULL_REQUEST_NUMBER" } else { "" }); | ||
|
||
# Main build is when we're in the master branch and not a PR | ||
$is_main_build = ($branch -eq "" -and $suffix -eq "") | ||
|
||
# Use appveyor build number as the last version digit (x.x.x.B) | ||
$build = ${env:APPVEYOR_BUILD_NUMBER} | ||
|
||
$is_release_build = ($commits_since_tag -eq 0 -and $is_main_build) | ||
|
||
$version = $(if ($is_release_build) { $short_version } else { "$short_version-$commit_hash" }) | ||
$bin_version = "$short_version.$build" | ||
|
||
write-host -n "Release type: "; | ||
if ($is_release_build) {write-host -f green 'release'} else { write-host -f yellow 'pre-release'} | ||
|
||
write-host -n "NuGet Package Version: "; | ||
write-host -f cyan $version; | ||
|
||
write-host -n "Assembly Version: "; | ||
write-host -f cyan $bin_version; | ||
|
||
$av_version = "$bin_version$branch$suffix"; | ||
|
||
$env:APPVEYOR_BUILD_VERSION=$av_version; | ||
$env:BIN_VERSION=$bin_version; | ||
$env:VERSION=$version; | ||
|
||
write-host -n "AppVeyor Build Version: "; | ||
write-host -f green $av_version; | ||
|
||
appveyor UpdateBuild -Version $av_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$proj = ".\test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj"; | ||
$resxml = ".\docs\nunit3-test-results-debug.xml"; | ||
|
||
# Nuget 3 Console runner: | ||
#$tester = "nunit3-console .\test\ICSharpCode.SharpZipLib.Tests\bin\$($env:CONFIGURATION)\netcoreapp2.0\ICSharpCode.SharpZipLib.Tests.dll" | ||
|
||
# Bootstrapper: | ||
$tester = "dotnet run -f netcoreapp2 -p $proj -c $env:CONFIGURATION"; | ||
iex "$tester --explore=tests.xml"; | ||
|
||
[xml]$xml = Get-Content("tests.xml"); | ||
$assembly = select-xml "/test-suite[@type='Assembly']" $xml | select -f 1 -exp Node; | ||
$testcases = select-xml "//test-case" $xml | % { Add-AppveyorTest -Name $_.Node.fullname -Framework NUnit -Filename $assembly.name }; | ||
|
||
iex "$tester --result=$resxml"; | ||
|
||
$wc = New-Object 'System.Net.WebClient'; | ||
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $resxml)); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$env:APPVEYOR_BUILD_NUMBER = 123; | ||
|
||
function Test-Install { | ||
param( [string]$PR, [string]$Branch ) | ||
Write-Host -n "-- Testing with PR " | ||
if($PR -eq "") { Write-Host -n -f red "No" } else { Write-Host -n -f cyan "#$PR" } | ||
Write-Host -n " and branch " | ||
if($Branch -eq "master") { Write-Host -f green "master" } else { Write-Host -f cyan "$Branch" } | ||
$env:APPVEYOR_PULL_REQUEST_NUMBER = $PR; | ||
$env:APPVEYOR_REPO_BRANCH = $Branch; | ||
.\appveyor-install.ps1 | ||
Write-Host "---------------------------------------------------------------------"; | ||
Write-Host; | ||
} | ||
|
||
function appveyor { | ||
# Dummy function for compability with AV | ||
} | ||
|
||
Write-Host; | ||
Test-Install "" "master" | ||
Test-Install 42 "master" | ||
Test-Install "" "misc-feature" | ||
Test-Install 36 "other-branch" |