add PublishVersion task
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
task FullTests {
|
||||
$requiredPercent = $Script:CodeCoveragePercent
|
||||
|
||||
$params = @{
|
||||
CodeCoverage = 'Output\*\*.psm1'
|
||||
CodeCoverageOutputFile = 'Output\codecoverage.xml'
|
||||
OutputFile = $testFile
|
||||
OutputFormat = 'NUnitXml'
|
||||
PassThru = $true
|
||||
@@ -10,13 +10,18 @@ task FullTests {
|
||||
Tag = 'Build'
|
||||
}
|
||||
|
||||
if($requiredPercent -gt 0.00)
|
||||
{
|
||||
$params['CodeCoverage'] = 'Output\*\*.psm1'
|
||||
$params['CodeCoverageOutputFile'] = 'Output\codecoverage.xml'
|
||||
}
|
||||
|
||||
$results = Invoke-Pester @params
|
||||
if ($results.FailedCount -gt 0)
|
||||
{
|
||||
Write-Error -Message "Failed [$($results.FailedCount)] Pester tests."
|
||||
}
|
||||
|
||||
$requiredPercent = $Script:CodeCoveragePercent
|
||||
$codeCoverage = $results.codecoverage.NumberOfCommandsExecuted / $results.codecoverage.NumberOfCommandsAnalyzed
|
||||
if($codeCoverage -lt $requiredPercent)
|
||||
{
|
||||
7
BuildTasks/PublishVersion.Task.ps1
Normal file
7
BuildTasks/PublishVersion.Task.ps1
Normal file
@@ -0,0 +1,7 @@
|
||||
task PublishVersion {
|
||||
[version] $sourceVersion = (Get-Metadata -Path $manifestPath -PropertyName 'ModuleVersion')
|
||||
"##vso[build.updatebuildnumber]$sourceVersion"
|
||||
|
||||
# Do the same for appveyor
|
||||
# https://www.appveyor.com/docs/build-worker-api/#update-build-details
|
||||
}
|
||||
@@ -30,7 +30,7 @@ task SetVersion {
|
||||
$versionStamp = (git rev-parse origin/master) + (git rev-parse head)
|
||||
|
||||
"Load current version"
|
||||
[version] $sourceVersion = (Get-Metadata -Path $manifestPath -PropertyName 'ModuleVersion')
|
||||
[version] $sourceVersion = (Get-Metadata -Path $manifestPath -PropertyName 'ModuleVersion')
|
||||
" Source version [$sourceVersion]"
|
||||
|
||||
$downloadFolder = Join-Path -Path $output downloads
|
||||
|
||||
Reference in New Issue
Block a user