Files
PdfPig/tools/get-next-main-version.ps1
Eliot Jones 8408c98aec Draft release on master build (#1145)
* remove alpha postfix, releases will increment version

* update the master build job to draft a release

* add publish action to publish full release

* enable setting assembly and file version

* bump assembly and file version for package project

---------

Co-authored-by: BobLd <38405645+BobLd@users.noreply.github.com>
2025-09-08 20:07:36 +01:00

20 lines
569 B
PowerShell

$xml = New-Object XML
$projectPath = Join-Path $PSScriptRoot "UglyToad.PdfPig.Package\UglyToad.PdfPig.Package.csproj"
$xml.Load($projectPath)
$current = $xml.Project.PropertyGroup[0].Version
$hyphenIndex = $current.IndexOf('-')
$len = If ($hyphenIndex -lt 0) { $current.Length } Else { $hyphenIndex }
$version = $current.Substring(0, $len)
# Split into parts
$parts = $version.Split('.')
# Increment last part (patch)
$patch = [int]$parts[-1]
$patch++
# Build new version string
$parts[-1] = $patch.ToString()
$newVersion = $parts -join '.'
Write-Output $newVersion