File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,8 +277,13 @@ $deployScriptBlock = {
277277 if ($versionToDeploy ) {
278278 try {
279279 if ($ENV: BHBuildSystem -eq ' VSTS' -and -not [String ]::IsNullOrEmpty($env: NugetApiKey )) {
280- " Updating module version on manifest to [$ ( $versionToDeploy ) ]"
281- Update-Metadata - Path (Join-Path $outputModVerDir " $ ( $env: BHProjectName ) .psd1" ) - PropertyName ModuleVersion - Value $versionToDeploy - Verbose
280+ if ($manifest.Version.ToString () -eq $versionToDeploy.ToStrin ()) {
281+ " Manifest is already the expected version. Skipping manifest version update"
282+ }
283+ else {
284+ " Updating module version on manifest to [$ ( $versionToDeploy ) ]"
285+ Update-Metadata - Path (Join-Path $outputModVerDir " $ ( $env: BHProjectName ) .psd1" ) - PropertyName ModuleVersion - Value $versionToDeploy - Verbose
286+ }
282287 try {
283288 " Publishing version [$ ( $versionToDeploy ) ] to PSGallery..."
284289 Publish-Module - Path $outputModVerDir - NuGetApiKey $env: NugetApiKey - Repository PSGallery - Verbose
@@ -340,7 +345,6 @@ $deployScriptBlock = {
340345 }
341346 if ($ENV: BHBuildSystem -eq ' VSTS' -and -not [String ]::IsNullOrEmpty($env: TwitterAccessSecret ) -and -not [String ]::IsNullOrEmpty($env: TwitterAccessToken ) -and -not [String ]::IsNullOrEmpty($env: TwitterConsumerKey ) -and -not [String ]::IsNullOrEmpty($env: TwitterConsumerSecret )) {
342347 " Publishing tweet about new release..."
343- $manifest = Import-PowerShellDataFile - Path (Join-Path $outputModVerDir " $ ( $env: BHProjectName ) .psd1" )
344348 $text = " #$ ( $env: BHProjectName ) v$ ( $versionToDeploy ) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$ ( $env: BHProjectName ) #PowerShell"
345349 $manifest.PrivateData.PSData.Tags | Foreach-Object {
346350 $text += " #$ ( $_ ) "
You can’t perform that action at this time.
0 commit comments