Skip to content

Commit ad36615

Browse files
committed
Release v2.15
1 parent 4810279 commit ad36615

5 files changed

Lines changed: 69 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
path: ./Release/
2525
if_no_artifact_found: fail
2626

27-
- run: ./tools/setup.ps1
27+
- run: ./Tools/setup.ps1
2828
shell: pwsh
2929

3030
- run: Invoke-Build -Task ShowDebugInfo -VersionToPublish ${{ github.ref_name }}
3131
shell: pwsh
3232

33-
- run: Invoke-Build -Task Publish -VersionToPublish ${{ github.ref_name }} -PSGalleryAPIKey ${{ secrets.PSGalleryAPIKey }}
33+
- run: Invoke-Build -Task Publish -VersionToPublish ${{ github.ref_name }} -PSGalleryAPIKey ${{ secrets.PSGALLERY_API_KEY }}
3434
shell: pwsh
3535

3636
- name: Cherry pick CHANGELOG.md

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Change Log
22

3-
## [NEXT VERSION] - YYYY-MM-DD
4-
5-
## [2.15-alpha1] - 2024-06-13
3+
## [2.15] - 2025-12-30
64

75
### Added
86

@@ -13,6 +11,7 @@
1311
### Changed
1412

1513
- Improved `-Transition` behavior in `Invoke-JiraIssueTransition` (#416, [@Rufus125])
14+
- Updated Pester to v5 (#543, [@SrBlackVoid])
1615

1716
### Fixed
1817

@@ -71,7 +70,7 @@
7170
### Added
7271

7372
- Parameter for retrieving information about a specific user with `Get-JiraUser` (#328, [@michalporeba])
74-
- this implementations will be changed with the next major update in favor of #306
73+
- this implementations will be changed with the next major update in favor of #306
7574

7675
### Changed
7776

@@ -407,6 +406,7 @@ which is in turn inspired by the [Vagrant](https://github.com/mitchellh/vagrant/
407406
[@Rufus125]: https://github.com/Rufus125
408407
[@sgtwilko]: https://github.com/sgtwilko
409408
[@spascoe]: https://github.com/spascoe
409+
[@SrBlackVoid]: https://github.com/SrBlackVoid
410410
[@thepsadmin]: https://github.com/ThePSAdmin
411411
[@tuxgoose]: https://github.com/tuxgoose
412412
[@vercellone]: https://github.com/vercellone

JiraPS.build.ps1

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ switch ($true) {
3535
#endregion HarmonizeVariables
3636

3737
if ($VersionToPublish) {
38-
$VersionToPublish = $VersionToPublish.TrimStart('v') -as [Version]
38+
$VersionToPublish = $VersionToPublish.TrimStart('v')
3939
}
40-
$currentVersion = (Get-Metadata -Path $env:BHPSModuleManifest) -as [Version]
4140
$builtManifestPath = "$env:BHBuildOutput/$env:BHProjectName/$env:BHProjectName.psd1"
4241

4342
Task ShowDebugInfo {
@@ -55,7 +54,6 @@ Task ShowDebugInfo {
5554
Write-Build Gray ('BHCommitHash: {0}' -f $env:BHCommitHash)
5655
Write-Build Gray ('BHCommitMessage: {0}' -f $env:BHCommitMessage)
5756
Write-Build Gray ('BHBuildNumber {0}' -f $env:BHBuildNumber)
58-
Write-Build Gray ('CurrentVersion {0}' -f $currentVersion)
5957
Write-Build Gray ('VersionToPublish {0}' -f $VersionToPublish)
6058
Write-Build Gray '-------------------------------------------------------'
6159
Write-Build Gray ('PowerShell version: {0}' -f $PSVersionTable.PSVersion.ToString())
@@ -151,10 +149,24 @@ Task UpdateManifest {
151149
}
152150

153151
Task SetVersion {
154-
Assert-True { $VersionToPublish -as [Version] } "Invalid version format: $VersionToPublish"
155-
Assert-True { $VersionToPublish -gt $currentVersion } "Version must be greater than the current version: $currentVersion"
152+
[System.Management.Automation.SemanticVersion]$versionToPublish = $VersionToPublish
156153

157-
Metadata\Update-Metadata -Path $builtManifestPath -PropertyName "ModuleVersion" -Value $VersionToPublish.ToString()
154+
$latestPublished = Get-LatestPublishedVersion -Name $env:BHProjectName
155+
156+
Write-Build Gray "Latest published version: $latestPublished"
157+
Assert-True { $versionToPublish -gt $latestPublished } "Version must be greater than latest published version: $latestPublished"
158+
159+
$versionString = "{0}.{1}.{2}" -f $versionToPublish.Major, $versionToPublish.Minor, $versionToPublish.Patch
160+
Metadata\Update-Metadata -Path $builtManifestPath -PropertyName "ModuleVersion" -Value $versionString
161+
162+
if ($versionToPublish.PreReleaseLabel) {
163+
Write-Build Gray "Setting Prerelease label: $($versionToPublish.PreReleaseLabel)"
164+
Metadata\Update-Metadata -Path $builtManifestPath -PropertyName "Prerelease" -Value $versionToPublish.PreReleaseLabel
165+
}
166+
else {
167+
Write-Build Gray "Removing Prerelease label (stable release)"
168+
Metadata\Update-Metadata -Path $builtManifestPath -PropertyName "Prerelease" -Value ''
169+
}
158170
}
159171

160172
Task Test {

JiraPS/JiraPS.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
# External dependent modules of this module
114114
# ExternalModuleDependencies = ''
115115

116-
Prerelease = 'alpha1'
116+
Prerelease = ''
117117

118118
} # End of PSData hashtable
119119

Tools/BuildTools.psm1

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,50 @@ function Remove-Utf8Bom {
256256
}
257257
}
258258

259+
function Get-LatestPublishedVersion {
260+
<#
261+
.SYNOPSIS
262+
Gets the latest published version of a module from PowerShell Gallery.
263+
.DESCRIPTION
264+
Queries the PowerShell Gallery for all published versions of a module and returns the latest version as a SemanticVersion.
265+
Handles both 4-part versions (e.g., "2.2.0.154") and semantic versions with pre-release labels (e.g., "2.15.0-alpha1").
266+
.PARAMETER Name
267+
The name of the module to query.
268+
.EXAMPLE
269+
Get-LatestPublishedVersion -Name JiraPS
270+
Returns the latest published version of JiraPS as a SemanticVersion object.
271+
#>
272+
[CmdletBinding()]
273+
[OutputType([System.Management.Automation.SemanticVersion])]
274+
param(
275+
[Parameter(Mandatory)]
276+
[String]$Name
277+
)
278+
279+
$publishedPackages = Find-NugetPackage -Name $Name -ErrorAction Stop
280+
$latestPublished = $publishedPackages |
281+
Select-Object -ExpandProperty Version |
282+
ForEach-Object {
283+
# Try SemanticVersion first (handles pre-release like "2.15.0-alpha1")
284+
$semVer = $_ -as [System.Management.Automation.SemanticVersion]
285+
if ($semVer) {
286+
# Return the full semantic version string (preserves pre-release label)
287+
$_.ToString()
288+
}
289+
else {
290+
# Fall back to Version for 4-part versions (like "2.2.0.154")
291+
# Convert to 3-part semantic version
292+
$ver = [Version]$_
293+
"{0}.{1}.{2}" -f $ver.Major, $ver.Minor, $ver.Build
294+
}
295+
} |
296+
ForEach-Object { $_ -as [System.Management.Automation.SemanticVersion] } |
297+
Sort-Object -Unique |
298+
Select-Object -Last 1
299+
300+
$latestPublished
301+
}
302+
259303
function Set-GitUser {
260304
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
261305
param()

0 commit comments

Comments
 (0)