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
3 changes: 0 additions & 3 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Initialize environment
uses: PSModule/Initialize-PSModule@main

- name: Action-Test
uses: ./
env:
Expand Down
7 changes: 3 additions & 4 deletions scripts/helpers/Publish-PSModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#>
[OutputType([void])]
[CmdletBinding()]
#Requires -Modules Utilities, PowerShellGet, Microsoft.PowerShell.PSResourceGet, GitHub, PSSemVer
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter', '', Scope = 'Function',
Justification = 'LogGroup - Scoping affects the variables line of sight.'
Expand Down Expand Up @@ -146,7 +145,7 @@
$latestRelease = $releases | Where-Object { $_.isLatest -eq $true }
$latestRelease | Format-List | Out-String
$ghReleaseVersionString = $latestRelease.tagName
if ($ghReleaseVersionString | IsNotNullOrEmpty) {
if (-not [string]::IsNullOrEmpty($ghReleaseVersionString)) {
$ghReleaseVersion = New-PSSemVer -Version $ghReleaseVersionString
} else {
Write-Warning 'Could not find the latest release version. Using ''0.0.0'' as the version.'
Expand Down Expand Up @@ -198,7 +197,7 @@
try {
$manifestVersion = New-PSSemVer -Version (Test-ModuleManifest $manifestFilePath -Verbose:$false).Version
} catch {
if ($manifestVersion | IsNullOrEmpty) {
if ([string]::IsNullOrEmpty($manifestVersion)) {
Write-Warning 'Could not find the module version in the manifest. Using ''0.0.0'' as the version.'
$manifestVersion = New-PSSemVer -Version '0.0.0'
}
Expand Down Expand Up @@ -249,7 +248,7 @@
$newVersion.Prerelease = $prereleaseName
Write-Output "Partial new version: [$newVersion]"

if ($datePrereleaseFormat | IsNotNullOrEmpty) {
if (-not [string]::IsNullOrEmpty($datePrereleaseFormat)) {
Write-Output "Using date-based prerelease: [$datePrereleaseFormat]."
$newVersion.Prerelease += "$(Get-Date -Format $datePrereleaseFormat)"
Write-Output "Partial new version: [$newVersion]"
Expand Down
16 changes: 16 additions & 0 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
[CmdletBinding()]
param()

$retryCount = 5
$retryDelay = 10
for ($i = 0; $i -lt $retryCount; $i++) {
try {
Install-PSResource -Name 'PSSemVer' -TrustRepository -Repository PSGallery
break
} catch {
Write-Warning "Installation of $($psResourceParams.Name) failed with error: $_"
if ($i -eq $retryCount - 1) {
throw
}
Write-Warning "Retrying in $retryDelay seconds..."
Start-Sleep -Seconds $retryDelay
}
}

$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers')
LogGroup "Loading helper scripts from [$path]" {
Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | ForEach-Object {
Expand Down
Loading