Skip to content

Commit

Permalink
Rename powershell module, add debug info to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kekonn committed Mar 21, 2024
1 parent 5a31735 commit 46d1f67
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
shell: pwsh
id: versionManifest
run: |
Import-Module -Force .\Get-Versions.psm1
Import-Module -Force .\Build-Functions.psm1
Write-Output "::debug::Generating package versions"
$versionManifest = Get-Versions
"versionManifest='$($versionManifest | ConvertTo-Json)'" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Expand All @@ -48,12 +48,16 @@ jobs:
- name: Summarize
shell: pwsh
run: |
Import-Module -Force .\Build-Functions.psm1
Write-Output "::debug::Package lock file location"
Get-LockFiles | ForEach-Object { Write-Output "::debug::\t- $_"}
Write-Output "::debug::Working directory: $(pwd)"
- uses: actions/setup-dotnet@v4
name: Setup dotnet cli
with:
global-json-file: global.json
cache: true
cache-dependency-path: src/*/packages.lock.json
- name: Restore (locked)
shell: pwsh
run: dotnet restore --locked-mode
Expand Down
11 changes: 10 additions & 1 deletion Get-Versions.psm1 → Build-Functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@ function Get-Versions {
$packageVersions | ConvertTo-Json | Write-Output
}

function Get-LockFiles {
$lockFiles = Get-Item -Path src/**/packages.lock.json | Select-Object -ExpandProperty FullName
Write-Debug "Found the following lock files:"
$lockFiles | ForEach-Object { Write-Debug "\t- $_" }

$lockFiles | Write-Output
}

Install-Module -Name powershell-yaml -Force -AcceptLicense
Export-ModuleMember -Function Get-Versions
Export-ModuleMember -Function Get-Versions
Export-ModuleMember -Function Get-LockFiles

0 comments on commit 46d1f67

Please sign in to comment.