Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions Module.BuildSettings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')]
Expand All @@ -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 ---------------------------------

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down