add support for Azure DevOps Pipelines

resolves #18
This commit is contained in:
Kevin Marquette
2018-10-16 09:14:03 -07:00
parent e7e2612082
commit e20c048eb1
2 changed files with 35 additions and 3 deletions

View File

@@ -2,17 +2,22 @@ task PublishModule {
if ( $ENV:BHBuildSystem -ne 'Unknown' -and
$ENV:BHBranchName -eq "master" -and
[string]::IsNullOrWhiteSpace($ENV:APPVEYOR_PULL_REQUEST_NUMBER) -and
-not [string]::IsNullOrWhiteSpace($ENV:NugetApiKey))
-not [string]::IsNullOrWhiteSpace($ENV:nugetapikey))
{
$publishModuleSplat = @{
Path = $Destination
NuGetApiKey = $ENV:NugetApiKey
NuGetApiKey = $ENV:nugetapikey
Verbose = $true
Force = $true
Repository = $PSRepository
ErrorAction = 'Stop'
}
"Files in module output:"
Get-ChildItem $Destination -Recurse -File |
Select-Object -Expand FullName
"Publishing [$Destination] to [$PSRepository]"
Publish-Module @publishModuleSplat
}
else
@@ -20,6 +25,7 @@ task PublishModule {
"Skipping deployment: To deploy, ensure that...`n" +
"`t* You are in a known build system (Current: $ENV:BHBuildSystem)`n" +
"`t* You are committing to the master branch (Current: $ENV:BHBranchName) `n" +
"`t* The repository APIKey is defined in `$ENV:nugetapikey (Current: $(![string]::IsNullOrWhiteSpace($ENV:nugetapikey))) `n" +
"`t* This is not a pull request"
}
}