Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -168,29 +168,31 @@ function Invoke-AppVeyorFull
# Implements the AppVeyor 'build_script' step
function Invoke-AppVeyorBuild
{
# check to be sure our test tags are correct
$result = Get-PesterTag
if ( $result.Result -ne "Pass" ) {
$releaseTag = Get-ReleaseTag
# check to be sure our test tags are correct
$result = Get-PesterTag
if ( $result.Result -ne "Pass" ) {
$result.Warnings
throw "Tags must be CI, Feature, Scenario, or Slow"
}
}

if(Test-DailyBuild)
{
Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore
}
if(Test-DailyBuild)
{
Start-PSBuild -Configuration 'CodeCoverage' -PSModuleRestore -ReleaseTag $releaseTag
}

Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release'
Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
}

# Implements the AppVeyor 'install' step
function Invoke-AppVeyorInstall
{
# Make sure we have all the tags
Sync-PSTags -AddRemoteIfMissing
$releaseTag = Get-ReleaseTag
if($env:APPVEYOR_BUILD_NUMBER)
{
Update-AppveyorBuild -Version "$(Get-PSVersion -OmitCommitId)-$env:APPVEYOR_BUILD_NUMBER"
Update-AppveyorBuild -Version $releaseTag
}

if(Test-DailyBuild){
Expand Down Expand Up @@ -420,14 +422,31 @@ function Get-PackageName
return $name
}

function Get-ReleaseTag
{
$metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json'
$metaData = Get-Content $metaDataPath | ConvertFrom-Json

$releaseTag = $metadata.NextReleaseTag
if($env:APPVEYOR_BUILD_NUMBER)
{
$releaseTag = $releaseTag.split('.')[0..2] -join '.'
$releaseTag = $releaseTag+'.'+$env:APPVEYOR_BUILD_NUMBER
}

return $releaseTag
}

# Implements AppVeyor 'on_finish' step
function Invoke-AppveyorFinish
{
try {
$releaseTag = Get-ReleaseTag

$packageParams = @{}
if($env:APPVEYOR_BUILD_VERSION)
{
$packageParams += @{Version=$env:APPVEYOR_BUILD_VERSION}
$packageParams += @{ReleaseTag=$releaseTag}
}

# Build packages
Expand All @@ -454,7 +473,7 @@ function Invoke-AppveyorFinish
}
else
{
$previewVersion = (git describe --abbrev=0).Split('-')
$previewVersion = $releaseTag.Split('-')
$previewPrefix = $previewVersion[0]
$previewLabel = $previewVersion[1].replace('.','')

Expand Down
3 changes: 2 additions & 1 deletion tools/metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"ReleaseTag": "v6.0.0-beta.9"
"ReleaseTag": "v6.0.0-rc",
"NextReleaseTag": "v6.1.0-preview.1"
}
28 changes: 21 additions & 7 deletions tools/travis.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ OS Type: $($PSVersionTable.OS) </br>
}
}

function Get-ReleaseTag
{
$metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json'
$metaData = Get-Content $metaDataPath | ConvertFrom-Json

$releaseTag = $metadata.NextReleaseTag
if($env:TRAVIS_BUILD_NUMBER)
{
$releaseTag = $releaseTag.split('.')[0..2] -join '.'
$releaseTag = $releaseTag+'.'+$env:TRAVIS_BUILD_NUMBER
}

return $releaseTag
}

# This function retrieves the appropriate svg to be used when presenting
# the daily test run badge
# the location in azure is public readonly
Expand Down Expand Up @@ -171,15 +186,16 @@ if($Stage -eq 'Bootstrap')
}
elseif($Stage -eq 'Build')
{
$BaseVersion = (Get-PSVersion -OmitCommitId) + '-'
$releaseTag = Get-ReleaseTag

Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage"
$output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions))

$originalProgressPreference = $ProgressPreference
$ProgressPreference = 'SilentlyContinue'
try {
## We use CrossGen build to run tests only if it's the daily build.
Start-PSBuild -CrossGen -PSModuleRestore
Start-PSBuild -CrossGen -PSModuleRestore -ReleaseTag $releaseTag
}
finally{
$ProgressPreference = $originalProgressPreference
Expand Down Expand Up @@ -235,12 +251,10 @@ elseif($Stage -eq 'Build')
}

if ($createPackages) {

$packageParams = @{}
if($env:TRAVIS_BUILD_NUMBER)
{
$version = $BaseVersion + $env:TRAVIS_BUILD_NUMBER
$packageParams += @{Version=$version}
}
$packageParams += @{ReleaseTag=$releaseTag}

# Only build packages for branches, not pull requests
$packages = @(Start-PSPackage @packageParams -SkipReleaseChecks)
# Packaging AppImage depends on the deb package
Expand Down