diff --git a/Module.BuildSettings.ps1 b/Module.BuildSettings.ps1 index e3b1908..3595338 100644 --- a/Module.BuildSettings.ps1 +++ b/Module.BuildSettings.ps1 @@ -119,7 +119,7 @@ $CodeCoverageFiles = "$SrcRootDir\*.ps1", "$SrcRootDir\*.psm1" # you will be prompted to enter your API key. The build will store the key encrypted in the # settings file, so that on subsequent publishes you will no longer be prompted for the API key. [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssigments', '')] -$NuGetApiKey = $env:PowerShellGalleryKey +$NuGetApiKey = $env:PowershellGalleryKey # Name of the repository you wish to publish to. If $null is specified the default repo (PowerShellGallery) is used. [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssigments', '')] @@ -128,7 +128,7 @@ $PublishRepository = "PSGallery" # Path to the release notes file. Set to $null if the release notes reside in the manifest file. # The contents of this file are used during publishing for the ReleaseNotes parameter. [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssigments', '')] -$ReleaseNotesPath = "$PSScriptRoot\ReleaseNotes.md" +$ReleaseNotesPath = $null # ----------------------- Misc properties --------------------------------- @@ -171,11 +171,15 @@ Task AfterStageFiles -After StageFiles { # Update prerelase string if($env:APPVEYOR_REPO_COMMIT_MESSAGE -like "pre: *") { $Manifest = $Manifest -Replace 'Prerelease = \$null', 'Prerelease = "pre"' + } else { + "AppVeyor pre-release not detected" } # Update module version if($env:APPVEYOR_BUILD_VERSION) { $Manifest = $Manifest -Replace "ModuleVersion ?= ?['`"](\d+\.?){2,4}['`"]", "ModuleVersion = '$env:APPVEYOR_BUILD_VERSION'" + } else { + "AppVeyor build version not detected" } # Write updated manifest @@ -275,5 +279,7 @@ Task AfterTest -After Test { if($env:APPVEYOR_JOB_ID -and (Test-Path $TestOutputFile)) { $wc = New-Object System.Net.WebClient $wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $TestOutputFile)) + } else { + "Skipping upload test results" } } \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 82aa1eb..7a2e806 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,10 +22,10 @@ install: install-module PSScriptAnalyzer -force -AllowClobber -SkipPublisherCheck build_script: - ps: | - if($env:APPVEYOR_REPO_BRANCH -eq "master") { - .\Invoke-Build.ps1 publish - } else { + if($env:APPVEYOR_REPO_BRANCH -ne "master" -or $env:APPVEYOR_PULL_REQUEST_NUMBER) { .\Invoke-Build.ps1 build,test + } else { + .\Invoke-Build.ps1 publish } artifacts: