Skip to content

Commit

Permalink
🩹 [Patch]: Use the PSSemVer module (#58)
Browse files Browse the repository at this point in the history
## Description

- Use the `PSSemVer` module, instead of the PSSemVer class in
`Utilities`.

## Type of change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
  • Loading branch information
MariusStorhaug authored Mar 15, 2024
1 parent d52f03d commit 3be3223
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ runs:
run: |
# Auto-Release
Write-Host '::group::Loading libraries'
Install-PSResource -Name 'Utilities', 'powershell-yaml' -TrustRepository -Verbose
Install-PSResource -Name 'Utilities', 'powershell-yaml', 'PSSemVer' -TrustRepository -Verbose
Write-Host '::endgroup::'
. "$env:GITHUB_ACTION_PATH\scripts\main.ps1" -Verbose
8 changes: 4 additions & 4 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#REQUIRES -Modules Utilities, powershell-yaml
#REQUIRES -Modules Utilities, powershell-yaml, PSSemVer

[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidLongLines', '', Justification = 'Long ternary operators are used for readability.'
Expand Down Expand Up @@ -141,7 +141,7 @@ $latestRelease = $releases | Where-Object { $_.isLatest -eq $true }
$latestRelease | Format-List
$latestVersionString = $latestRelease.tagName
if ($latestVersionString | IsNotNullOrEmpty) {
$latestVersion = $latestVersionString | ConvertTo-SemVer
$latestVersion = $latestVersionString | ConvertTo-PSSemVer
Write-Output '-------------------------------------------------'
Write-Output 'Latest version:'
$latestVersion | Format-Table
Expand All @@ -157,8 +157,8 @@ Write-Output '-------------------------------------------------'
#region Create a new version
if ($createPrerelease -or $createRelease -or $whatIf) {
Start-LogGroup 'Calculate new version'
$latestVersion = New-SemVer -Version $latestVersion
$newVersion = New-SemVer -Version $latestVersion
$latestVersion = New-PSSemVer -Version $latestVersion
$newVersion = New-PSSemVer -Version $latestVersion
$newVersion.Prefix = $versionPrefix
if ($majorRelease) {
Write-Output 'Incrementing major version.'
Expand Down

0 comments on commit 3be3223

Please sign in to comment.