Skip to content
Merged
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
8 changes: 5 additions & 3 deletions build/vsts-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ if (-not $env:SYSTEM_DEFAULTWORKINGDIRECTORY)
# Prepare build folder
$item = New-Item -Path $env:TEMP -Name "Build" -ItemType Directory -Force
Write-PSFMessage -Level Host -Message "Building in $($item.FullName)"
Copy-Item -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -Destination $item.FullName -Recurse
Copy-Item -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -Destination "$($item.FullName)\" -Recurse
Import-Module "$($item.FullName)\PSModuleDevelopment\PSModuleDevelopment.psd1"

# Build Templates
Write-PSFMessage -Level Host -Message "Building templates"
Write-PSFMessage -Level Host -Message " Creating root folder"
$templateBuild = New-Item -Path $item.FullName -Name "Templates" -ItemType Directory -Force
Write-PSFMessage -Level Host -Message " Executing package compilation"
& "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\templates\build.ps1" -Path $templateBuild.FullName
Write-PSFMessage -Level Host -Message " Merging tempalte packages into build"
Write-PSFMessage -Level Host -Message " Merging template packages into build"
Copy-Item -Path "$($templateBuild.FullName)\output\*" -Destination "$($item.FullName)\PSModuleDevelopment\internal\templates" -Force

# Publish to gallery
Expand All @@ -29,4 +30,5 @@ if ($env:BUILD_BUILDURI -like "vstfs*")
Write-PSFMessage -Level Host -Message "Publishing to gallery"
if ($WhatIf -or -not $ApiKey) { Publish-Module -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -NuGetApiKey $ApiKey -Force -WhatIf }
else { Publish-Module -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -NuGetApiKey $ApiKey -Force }
}
}
else { Write-PSFMessage -Level Host -Message "Skipping publish to gallery" }