Skip to content

Commit

Permalink
Added build script for module versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
RobFaie committed Feb 1, 2020
1 parent 2671d74 commit a8415e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[CMDletBinding()]
Param()

if ((Get-Command -Name 'gitversion' -ErrorAction 'SilentlyContinue' | Measure-Object).Count -eq 0) {
throw 'gitversion must be installed'
}

$version = gitversion | ConvertFrom-Json
$versionString = $version.NuGetVersion
Write-Information -MessageData "Calculated Module Version: $versionString"

$rawManifest = Get-Content -Path "$PSScriptRoot/PwshZendesk.psd1" -raw
Write-Debug -Message "Raw Manifest:`n$rawManifest"

$updatedManifest = $rawManifest -replace "ModuleVersion\s*=\s*['`"][0-9.]+['`"]", "ModuleVersion = '$versionString'"
Write-Debug -Message "Updated Manifest:`n$updatedManifest"

$updatedManifest | Out-File -Path "$PSScriptRoot/PwshZendesk.psd1" -NoNewline
1 change: 1 addition & 0 deletions gitversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mode: Mainline

0 comments on commit a8415e5

Please sign in to comment.