@@ -32,10 +32,11 @@ jobs:
32
32
NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
33
33
PSGALLERY_API_KEY : ${{ secrets.PSGALLERY_API_KEY }}
34
34
35
- - uses : actions/upload-artifact@v4
35
+ - name : Upload Built Modules
36
+ uses : actions/upload-artifact@v4
36
37
with :
37
- name : ModuleBuilder
38
- path : Modules/ModuleBuilder
38
+ name : OutputModules
39
+ path : Modules
39
40
40
41
- uses : actions/upload-artifact@v4
41
42
with :
@@ -62,33 +63,40 @@ jobs:
62
63
matrix :
63
64
os : [windows-latest, ubuntu-latest, macos-latest]
64
65
steps :
65
- - name : Download Build Output
66
+ - name : Download build.requires.psd1
66
67
uses : actions/download-artifact@v4
67
68
with :
68
- name : ModuleBuilder
69
- path : Modules/ModuleBuilder # /home/runner/work/ModuleBuilder/ModuleBuilder/Modules/ModuleBuilder
69
+ name : build.requires.psd1
70
70
- name : Download Pester Tests
71
71
uses : actions/download-artifact@v4
72
72
with :
73
73
name : PesterTests
74
74
path : PesterTests
75
- - name : Download build.requires.psd1
75
+ - name : Download Build Output
76
76
uses : actions/download-artifact@v4
77
77
with :
78
- name : build.requires.psd1
79
- - name : ⚡ Install PowerShell Modules
80
- uses :
JustinGrote/[email protected]
81
- - name : Put Build output in PATH
82
- shell : pwsh
83
- run : | # PowerShell
84
- Convert-Path Modules -OutVariable BuiltModules
85
- Add-Content -Path $env:GITHUB_PATH -Value $BuiltModules -Encoding utf8
86
- # Uninstall the "installed" copy of ModuleBuilder
87
- Get-Module -Name ModuleBuilder -List | Where ModuleBase -notmatch ([regex]::escape($pwd)) | Split-Path | Remove-Item -Recurse -Force
88
- - name : Put Build output in PATH
78
+ name : Modules
79
+ path : Modules # /home/runner/work/ModuleBuilder/ModuleBuilder/Modules
80
+ - name : Install Output Modules
89
81
shell : pwsh
90
82
run : | # PowerShell
91
- $Env:PATH -split ([IO.Path]::PathSeparator) | Out-Host
83
+ $ModuleDestination = if ($IsWindows) {
84
+ Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'PowerShell/Modules'
85
+ } else {
86
+ Join-Path $HOME '.local/share/powershell/Modules'
87
+ }
88
+
89
+ Get-ChildItem -Directory Modules -OutVariable Modules
90
+ | Move-Item -Destination $ModuleDestination -Force
91
+
92
+ Write-Host "Installing $($Modules -join ', ') to $ModuleDestination"
93
+ $Env:PSModulePath -split ([IO.Path]::PathSeparator) | Out-Host
94
+
95
+ @(Get-Content build.requires.psd1)
96
+ | Where { $_ -notmatch "ModuleBuilder"}
97
+ | Set-Content build.requires.psd1
98
+ - name : ⚡ Install Required Modules
99
+ uses :
JustinGrote/[email protected]
92
100
- name : Invoke Pester Tests
93
101
id : pester
94
102
uses : zyborg/pester-tests-report@v1
0 commit comments