You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw"Unable to detect a clean passing Pester Test xml in the $env:BHBuildOutput directory. Ensure you were successful in the Build and Test phases first."
374
+
throw"Unable to detect a clean passing Pester Test nunit xml file in the $env:BHBuildOutput directory. Did you run {Invoke-Build Build,Test} and ensure it passed all tests first?"
if ((-not$env:BHBranchName-eq'master') -or ($ForceDeploy-ne$true)) {
380
+
if (($env:BHBranchName-eq'master') -or$ForceDeploy) {
381
+
if (-not (Get-Item$ProjectBuildPath/*.psd1 -erroraction silentlycontinue)) {throw"No Powershell Module Found in $ProjectBuildPath. Skipping deployment. Did you remember to build it first with {Invoke-Build Build}?"}
382
+
} else {
381
383
write-build Magenta "Task $($task.name)`: We are not in master branch, skipping publish. If you wish to deploy anyways such as for testing, run {InvokeBuild Deploy -ForceDeploy:$true}"
382
384
$script:SkipPublish=$true
383
-
} else {
384
-
if (-not (Get-Item$ProjectBuildPath/*.psd1 -erroraction silentlycontinue)) {throw"No Powershell Module Found in $ProjectBuildPath. Skipping deployment. Did you remember to build it first with {Invoke-Build Build}?"}
#TODO: Add Prerelease Logic when message commit says "!prerelease" or is in a release branch
390
-
if (-not$SkipPublish) {
391
-
if ($AppVeyor-and-not$GitHubAPIKey) {
392
-
write-build DarkYellow "Task PublishGitHubRelease: Couldn't find GitHubAPIKey in the Appveyor secure environment variables. Did you save your Github API key as an Appveyor Secure Variable? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item and https://github.com/settings/tokens"
393
-
$SkipPublish=$true
394
-
}
395
-
if (-not$GitHubAPIKey) {
396
-
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
397
-
write-build DarkYellow 'Task PublishGitHubRelease: $env:GitHubAPIKey was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -GitHubUser "MyGitHubUser" -GitHubAPIKey "MyAPIKeyString"}. Have you created a GitHub API key with minimum public_repo scope permissions yet? https://github.com/settings/tokens'
398
-
$SkipPublish=$true
399
-
}
400
-
if (-not$GitHubUserName) {
401
-
write-build DarkYellow 'Task PublishGitHubRelease: $env:GitHubUserName was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -GitHubUser "MyGitHubUser" -GitHubAPIKey "MyAPIKeyString"}. Have you created a GitHub API key with minimum public_repo scope permissions yet? https://github.com/settings/tokens'
402
-
$SkipPublish=$true
403
-
}
390
+
if ($AppVeyor-and-not$GitHubAPIKey) {
391
+
write-build DarkYellow "Task PublishGitHubRelease: Couldn't find GitHubAPIKey in the Appveyor secure environment variables. Did you save your Github API key as an Appveyor Secure Variable? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item and https://github.com/settings/tokens"
392
+
$SkipGitHubRelease=$true
404
393
}
405
-
if ($SkipPublish) {
394
+
if (-not$GitHubAPIKey) {
395
+
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
396
+
write-build DarkYellow 'Task PublishGitHubRelease: $env:GitHubAPIKey was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -GitHubUser "MyGitHubUser" -GitHubAPIKey "MyAPIKeyString"}. Have you created a GitHub API key with minimum public_repo scope permissions yet? https://github.com/settings/tokens'
397
+
$SkipGitHubRelease=$true
398
+
}
399
+
if (-not$GitHubUserName) {
400
+
write-build DarkYellow 'Task PublishGitHubRelease: $env:GitHubUserName was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -GitHubUser "MyGitHubUser" -GitHubAPIKey "MyAPIKeyString"}. Have you created a GitHub API key with minimum public_repo scope permissions yet? https://github.com/settings/tokens'
401
+
$SkipGitHubRelease=$true
402
+
}
403
+
if ($SkipGitHubRelease) {
406
404
write-build Magenta "Task $($task.name): Skipping Publish to GitHub Releases"
407
405
} else {
408
406
#TODO: Add Prerelease Logic when message commit says "!prerelease" or is in a release branch
#TODO: Replace SkipPublish Logic with Proper invokebuild task skipping
451
-
task PublishPSGallery {
452
-
if (-not$SkipPublish) {
453
-
if ($AppVeyor-and-not$NuGetAPIKey) {
454
-
write-build DarkYellow "Couldn't find NuGetAPIKey in the Appveyor secure environment variables. Did you save your NuGet/Powershell Gallery API key as an Appveyor Secure Variable? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item and https://www.appveyor.com/docs/build-configuration/"
455
-
$SkipPublish=$true
456
-
}
457
-
if (-not$NuGetAPIKey) {
458
-
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
459
-
write-build DarkYellow '$env:NuGetAPIKey was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -NuGetAPIKey "MyAPIKeyString"}. Have you registered for a Powershell Gallery API key yet? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item'
460
-
$SkipPublish=$true
461
-
}
449
+
task PublishPSGallery -if (-not$SkipPublish) {
450
+
if ($AppVeyor-and-not$NuGetAPIKey) {
451
+
write-build DarkYellow "Couldn't find NuGetAPIKey in the Appveyor secure environment variables. Did you save your NuGet/Powershell Gallery API key as an Appveyor Secure Variable? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item and https://www.appveyor.com/docs/build-configuration/"
452
+
$SkipPSGallery=$true
453
+
}
454
+
if (-not$NuGetAPIKey) {
455
+
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
456
+
write-build DarkYellow '$env:NuGetAPIKey was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -NuGetAPIKey "MyAPIKeyString"}. Have you registered for a Powershell Gallery API key yet? https://docs.microsoft.com/en-us/powershell/gallery/psgallery/creating-and-publishing-an-item'
0 commit comments