File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,18 @@ jobs:
5050 - name : Build module artifact
5151 shell : pwsh
5252 run : |
53+
5354 $moduleManifest = Get-ChildItem -Path . -Filter '*.psd1' -Recurse | Select-Object -First 1
5455 $moduleName = $moduleManifest.BaseName
5556 $artifactPath = "$env:GITHUB_WORKSPACE/artifact"
57+
58+ # Build NuGet package (.nupkg) for the PowerShell module
5659 New-Item -ItemType Directory -Path $artifactPath -Force | Out-Null
60+ Publish-Module -Path $moduleManifest.Directory.FullName -NuGetApiKey 'AnyValue' -Repository 'LocalRepo' -Force -SkipAutomaticTags -WhatIf
61+ $nupkgFile = Get-ChildItem -Path "$env:USERPROFILE/.local/share/powershell/Modules" -Filter '*.nupkg' -Recurse | Sort-Object LastWriteTime -Descending | Select-Object -First 1
62+ if ($nupkgFile) {
63+ Copy-Item -Path $nupkgFile.FullName -Destination $artifactPath
64+ }
5765 Copy-Item -Path "$($moduleManifest.Directory.FullName)\*.ps*1)" -Destination $artifactPath\$moduleName
5866 Copy-Item -Path "$($moduleManifest.Directory.FullName)\public" -Destination $artifactPath\$moduleName -Recurse
5967 Copy-Item -Path "$($moduleManifest.Directory.FullName)\private" -Destination $artifactPath\$moduleName -Recurse
You can’t perform that action at this time.
0 commit comments