From 3516dd3acb7d4f91e5a23876404f3026aa8527f4 Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Fri, 9 May 2025 15:12:23 -0400 Subject: [PATCH] Update build scripts to support version parameter --- Module/PSProxmox.psd1 | 3 ++- Scripts/Publish-PSProxmoxToGallery.ps1 | 5 +++-- Scripts/build-release-only.ps1 | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Module/PSProxmox.psd1 b/Module/PSProxmox.psd1 index 9dc2a71..f0f87c3 100644 --- a/Module/PSProxmox.psd1 +++ b/Module/PSProxmox.psd1 @@ -1,7 +1,7 @@ @{ RootModule = 'PSProxmox.psm1' NestedModules = @('bin\PSProxmox.dll') - ModuleVersion = '2025.05.09.1504' + ModuleVersion = '2025.05.09.1511' GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad' Author = 'PSProxmox Team' CompanyName = 'PSProxmox' @@ -107,3 +107,4 @@ + diff --git a/Scripts/Publish-PSProxmoxToGallery.ps1 b/Scripts/Publish-PSProxmoxToGallery.ps1 index da05171..2ea61e8 100644 --- a/Scripts/Publish-PSProxmoxToGallery.ps1 +++ b/Scripts/Publish-PSProxmoxToGallery.ps1 @@ -4,13 +4,14 @@ param( [Parameter(Mandatory = $true)] [string]$ApiKey, - + [Parameter(Mandatory = $false)] [string]$Version = (Get-Date -Format "yyyy.MM.dd.HHmm") ) # Ensure the module is built -Write-Host "Building the module..." +Write-Host "Building the module with version $Version..." +$env:MODULE_VERSION = $Version & "$PSScriptRoot\build-release-only.ps1" # Get the release directory diff --git a/Scripts/build-release-only.ps1 b/Scripts/build-release-only.ps1 index d2501f7..cde9e2d 100644 --- a/Scripts/build-release-only.ps1 +++ b/Scripts/build-release-only.ps1 @@ -5,8 +5,12 @@ $scriptRoot = $PSScriptRoot $rootPath = Split-Path -Parent $scriptRoot -# Set the version based on the current date and time -$version = Get-Date -Format "yyyy.MM.dd.HHmm" +# Set the version based on the environment variable or current date and time +if ($env:MODULE_VERSION) { + $version = $env:MODULE_VERSION +} else { + $version = Get-Date -Format "yyyy.MM.dd.HHmm" +} Write-Host "Building PSProxmox version $version" # Update the module version in the PSD1 file