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
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}?"}
381
385
}
382
386
}
383
-
387
+
#TODO: Replace SkipPublish Logic with Proper invokebuild task skipping
384
388
task PublishPSGallery {
385
389
if (-not$SkipPublish) {
386
390
if ($AppVeyor-and-not$NuGetAPIKey) {
387
391
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/"
388
392
$SkipPublish=$true
389
393
}
390
-
if (-not$env:NuGetAPIKey) {
394
+
if (-not$NuGetAPIKey) {
391
395
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
392
396
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'
393
397
$SkipPublish=$true
@@ -412,29 +416,70 @@ task PublishPSGallery {
412
416
}
413
417
414
418
task PublishGitHubRelease Package,{
415
-
416
-
#TODO: Add Prerelease Logic when message commit says "!prerelease"
419
+
#TODO: Add Prerelease Logic when message commit says "!prerelease" or is in a release branch
417
420
if (-not$SkipPublish) {
418
421
if ($AppVeyor-and-not$GitHubAPIKey) {
419
422
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"
420
423
$SkipPublish=$true
421
424
}
422
-
if (-not$env:GitHubAPIKey) {
425
+
if (-not$GitHubAPIKey) {
423
426
#TODO: Add Windows Credential Store support and some kind of Linux secure storage or caching option
424
-
write-build DarkYellow 'Task PublishGitHubRelease: $env:GitHubAPIKey was not found as an environment variable. Please specify it or use {Invoke-Build Deploy -NuGetAPIKey "MyAPIKeyString"}. Have you created a GitHub API key with minimum public_repo scope permissions yet? https://github.com/settings/tokens'
427
+
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'
428
+
$SkipPublish=$true
429
+
}
430
+
if (-not$GitHubUserName) {
431
+
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'
425
432
$SkipPublish=$true
426
433
}
427
434
}
428
435
if ($SkipPublish) {
429
436
write-build Magenta "Task $($task.name): Skipping Publish to GitHub Releases"
430
437
} else {
431
-
#TODO: Add GitHubRelease Logic
432
-
}
438
+
#TODO: Add Prerelease Logic when message commit says "!prerelease" or is in a release branch
439
+
#Inspiration from https://www.herebedragons.io/powershell-create-github-release-with-artifact
0 commit comments