Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/helpers/Build-PSModuleDocumentation.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
#Requires -Modules GitHub
#Requires -Modules Utilities

function Build-PSModuleDocumentation {
<#
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/Import-PSModule.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
#Requires -Modules Utilities

function Import-PSModule {
<#
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/Resolve-PSModuleDependency.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Requires -Modules @{ ModuleName = 'Retry'; ModuleVersion = '0.1.3' }
#Requires -Modules Retry

function Resolve-PSModuleDependency {
<#
Expand Down
93 changes: 40 additions & 53 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
@@ -1,53 +1,40 @@
#Requires -Modules Utilities

[CmdletBinding()]
param()

$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative
LogGroup "Loading helper scripts from [$path]" {
Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object {
Write-Host "$_"
. $_
}
}

LogGroup 'Loading inputs' {
$moduleName = ($env:GITHUB_ACTION_INPUT_Name | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name
Write-Host "Module name: [$moduleName]"

$moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path/$moduleName
if (-not (Test-Path -Path $moduleSourceFolderPath)) {
$moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path
}
Write-Host "Source module path: [$moduleSourceFolderPath]"
if (-not (Test-Path -Path $moduleSourceFolderPath)) {
throw "Module path [$moduleSourceFolderPath] does not exist."
}

$modulesOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_ModulesOutputPath
Write-Host "Modules output path: [$modulesOutputFolderPath]"
$docsOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_DocsOutputPath
Write-Host "Docs output path: [$docsOutputFolderPath]"
}

LogGroup 'Build local scripts' {
Write-Host 'Execution order:'
$scripts = Get-ChildItem -Filter '*build.ps1' -Recurse | Sort-Object -Property Name | Resolve-Path -Relative
$scripts | ForEach-Object {
Write-Host " - $_"
}
$scripts | ForEach-Object {
LogGroup "Build local scripts - [$_]" {
. $_
}
}
}

$params = @{
ModuleName = $moduleName
ModuleSourceFolderPath = $moduleSourceFolderPath
ModulesOutputFolderPath = $modulesOutputFolderPath
DocsOutputFolderPath = $docsOutputFolderPath
}

Build-PSModuleDocumentation @params
#Requires -Modules Utilities

[CmdletBinding()]
param()

$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative
LogGroup "Loading helper scripts from [$path]" {
Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object {
Write-Host "$_"
. $_
}
}

LogGroup 'Loading inputs' {
$moduleName = ($env:GITHUB_ACTION_INPUT_Name | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name
Write-Host "Module name: [$moduleName]"

$moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path/$moduleName
if (-not (Test-Path -Path $moduleSourceFolderPath)) {
$moduleSourceFolderPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $env:GITHUB_ACTION_INPUT_Path
}
Write-Host "Source module path: [$moduleSourceFolderPath]"
if (-not (Test-Path -Path $moduleSourceFolderPath)) {
throw "Module path [$moduleSourceFolderPath] does not exist."
}

$modulesOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_ModulesOutputPath
Write-Host "Modules output path: [$modulesOutputFolderPath]"
$docsOutputFolderPath = Join-Path $env:GITHUB_WORKSPACE $env:GITHUB_ACTION_INPUT_DocsOutputPath
Write-Host "Docs output path: [$docsOutputFolderPath]"
}

$params = @{
ModuleName = $moduleName
ModuleSourceFolderPath = $moduleSourceFolderPath
ModulesOutputFolderPath = $modulesOutputFolderPath
DocsOutputFolderPath = $docsOutputFolderPath
}

Build-PSModuleDocumentation @params
Loading