|
1 | | -#Requires -Modules Utilities |
2 | | - |
3 | | -[CmdletBinding()] |
4 | | -param() |
5 | | - |
6 | | -$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative |
7 | | -LogGroup "Loading helper scripts from [$path]" { |
8 | | - Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object { |
9 | | - Write-Host "$_" |
10 | | - . $_ |
11 | | - } |
12 | | -} |
13 | | - |
14 | | -LogGroup 'Loading inputs' { |
15 | | - $moduleName = ($env:GITHUB_ACTION_INPUT_Name | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name |
16 | | - Write-Host "Module name: [$moduleName]" |
17 | | - |
18 | | - $moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path/$moduleName |
19 | | - if (-not (Test-Path -Path $moduleSourceFolderPath)) { |
20 | | - $moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path |
21 | | - } |
22 | | - Write-Host "Source module path: [$moduleSourceFolderPath]" |
23 | | - if (-not (Test-Path -Path $moduleSourceFolderPath)) { |
24 | | - throw "Module path [$moduleSourceFolderPath] does not exist." |
25 | | - } |
26 | | - |
27 | | - $modulesOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_ModulesOutputPath |
28 | | - Write-Host "Modules output path: [$modulesOutputFolderPath]" |
29 | | - $docsOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_DocsOutputPath |
30 | | - Write-Host "Docs output path: [$docsOutputFolderPath]" |
31 | | -} |
32 | | - |
33 | | -LogGroup 'Build local scripts' { |
34 | | - Write-Host 'Execution order:' |
35 | | - $scripts = Get-ChildItem -Filter '*build.ps1' -Recurse | Sort-Object -Property Name | Resolve-Path -Relative |
36 | | - $scripts | ForEach-Object { |
37 | | - Write-Host " - $_" |
38 | | - } |
39 | | - $scripts | ForEach-Object { |
40 | | - LogGroup "Build local scripts - [$_]" { |
41 | | - . $_ |
42 | | - } |
43 | | - } |
44 | | -} |
45 | | - |
46 | | -$params = @{ |
47 | | - ModuleName = $moduleName |
48 | | - ModuleSourceFolderPath = $moduleSourceFolderPath |
49 | | - ModulesOutputFolderPath = $modulesOutputFolderPath |
50 | | - DocsOutputFolderPath = $docsOutputFolderPath |
51 | | -} |
52 | | - |
53 | | -Build-PSModuleDocumentation @params |
| 1 | +#Requires -Modules Utilities |
| 2 | + |
| 3 | +[CmdletBinding()] |
| 4 | +param() |
| 5 | + |
| 6 | +$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative |
| 7 | +LogGroup "Loading helper scripts from [$path]" { |
| 8 | + Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object { |
| 9 | + Write-Host "$_" |
| 10 | + . $_ |
| 11 | + } |
| 12 | +} |
| 13 | + |
| 14 | +LogGroup 'Loading inputs' { |
| 15 | + $moduleName = ($env:GITHUB_ACTION_INPUT_Name | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name |
| 16 | + Write-Host "Module name: [$moduleName]" |
| 17 | + |
| 18 | + $moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path/$moduleName |
| 19 | + if (-not (Test-Path -Path $moduleSourceFolderPath)) { |
| 20 | + $moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path |
| 21 | + } |
| 22 | + Write-Host "Source module path: [$moduleSourceFolderPath]" |
| 23 | + if (-not (Test-Path -Path $moduleSourceFolderPath)) { |
| 24 | + throw "Module path [$moduleSourceFolderPath] does not exist." |
| 25 | + } |
| 26 | + |
| 27 | + $modulesOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_ModulesOutputPath |
| 28 | + Write-Host "Modules output path: [$modulesOutputFolderPath]" |
| 29 | + $docsOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_DocsOutputPath |
| 30 | + Write-Host "Docs output path: [$docsOutputFolderPath]" |
| 31 | +} |
| 32 | + |
| 33 | +$params = @{ |
| 34 | + ModuleName = $moduleName |
| 35 | + ModuleSourceFolderPath = $moduleSourceFolderPath |
| 36 | + ModulesOutputFolderPath = $modulesOutputFolderPath |
| 37 | + DocsOutputFolderPath = $docsOutputFolderPath |
| 38 | +} |
| 39 | + |
| 40 | +Build-PSModuleDocumentation @params |
0 commit comments