Skip to content

Commit

Permalink
fix: prerelease nuget generation (#196)
Browse files Browse the repository at this point in the history
* fix: prerelease nuget generation (#195)

* fix: prerelease nuget generation

* pr-fix: toggle out ps dsc resource export

* pr-fix: toggle out ps dsc resource export

* Update psd1-to-nuspec.ps1

* Update psgallery-release.yml

* Update psgallery-release.yml

* Update psgallery-release.yml

* Update psgallery-release.yml

* Update psgallery-release.yml

* Update psgallery-release.yml

* Update psd1-to-nuspec.ps1

* Update psd1-to-nuspec.ps1

* Update psgallery-release.yml

* Update psgallery-release.yml
  • Loading branch information
stijnmoreels authored Jul 16, 2021
1 parent a8974e3 commit 6bc6e1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
7 changes: 5 additions & 2 deletions build/psgallery-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ stages:
displayName: 'Push to PowerShell Gallery'
pool:
vmImage: '$(Vm.Image)'
variables:
${{ if ne(variables['Prerelease'], 'none') }}:
Package.Version: "${{ parameters['Package.Version'] }}${{ parameters['Prerelease'] }}"
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download build artifacts'
Expand All @@ -140,7 +143,7 @@ stages:
% { & $env:SCRIPT_PATH -ManifestPath $_.FullName -DestinationFolder $_.DirectoryName }
displayName: 'Generate .nuspec file for each PowerShell module'
env:
SCRIPT_PATH: '$(Build.SourcesDirectory)\build\tools\psd1-to-nuspec.ps1'
SCRIPT_PATH: '$(Build.SourcesDirectory)\build\tools\psd1-to-nuspec.ps1'
- task: NuGetCommand@2
inputs:
command: 'pack'
Expand All @@ -153,4 +156,4 @@ stages:
% { & "nuget" push $_.FullName -Source $(Source) -ApiKey $(NuGet.ApiKey) -SkipDuplicate }
displayName: 'Push to PowerShell Gallery'
env:
ARTIFACT_DIR: '$(Build.ArtifactStagingDirectory)'
ARTIFACT_DIR: '$(Build.ArtifactStagingDirectory)'
22 changes: 12 additions & 10 deletions build/tools/psd1-to-nuspec.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,18 @@ function New-NuSpecFile
"PSCommand_$_"
}
}

$dscResourceNames = Get-ExportedDscResources -PSModuleInfo $PSModuleInfo
if($dscResourceNames)
{
$Tags += 'PSIncludes_DscResource'

$Tags += $dscResourceNames | Microsoft.PowerShell.Core\ForEach-Object {
"PSDscResource_$_"
}
}

# Toggled out - not needed and causing exceptions when building prereleases
# -------------------------------------------------------------------------
#$dscResourceNames = Get-ExportedDscResources -PSModuleInfo $PSModuleInfo
#if($dscResourceNames)
#{
# $Tags += 'PSIncludes_DscResource'

# $Tags += $dscResourceNames | Microsoft.PowerShell.Core\ForEach-Object {
# "PSDscResource_$_"
# }
#}

$RoleCapabilityNames = Get-AvailableRoleCapabilityName -PSModuleInfo $PSModuleInfo
if($RoleCapabilityNames)
Expand Down

0 comments on commit 6bc6e1e

Please sign in to comment.