Skip to content

Commit

Permalink
🚀 (maint) Ensure build publishes Pester
Browse files Browse the repository at this point in the history
In some cases it looks like Pester can fail to publish if there are too
many versions of Pester available. Prevent this by checking the version
we actually need and publishing just that version when doing a publish
to the filesystem.

Also set the initially installed version of pester to the correct
version based on the current required version specified by PSKoans
itself, instead of having to update the environment-setup.yml each time.
  • Loading branch information
vexx32 committed May 6, 2021
1 parent 9f56b06 commit 1220b16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Deploy/Publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ if ($OutputDirectory) {
Import-Module "$PSScriptRoot/PSKoans"
$Module = Get-Module -Name PSKoans
$Dependencies = @(
$Module.RequiredModules.Name
$Module.NestedModules.Name
$Module.RequiredModules | Select-Object -Property Name, Version
$Module.NestedModules | Select-Object -Property Name, Version
).Where{ $_ }

foreach ($Module in $Dependencies) {
Publish-Module -Name $Module -Repository FileSystem -NugetApiKey "Test-Publish"
Publish-Module -Name $Module.Name -Repository FileSystem -NugetApiKey "Test-Publish" -RequiredVersion $Module.Version
}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/environment-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
$Params.Name = 'Pester'
$Params.SkipPublisherCheck = $true
$Params.MinimumVersion = '5.0.2'
$Params.MinimumVersion = (Get-Module -ListAvailable ./PSKoans).RequiredModules.Where{$_.Name -eq 'Pester'}.Version
$Params | Out-String | Write-Host
Install-Module @Params
$Params.Remove('SkipPublisherCheck')
Expand Down

0 comments on commit 1220b16

Please sign in to comment.