@@ -25,68 +25,14 @@ jobs:
2525 uses : actions/checkout@v4
2626 with :
2727 persist-credentials : false
28-
28+
2929 - name : Setup PowerShell module cache
3030 id : cacher
3131 uses : actions/cache@v3
3232 with :
3333 path : " ~/.local/share/powershell/Modules"
3434 key : ${{ runner.os }}-ModuleBuilder
3535
36- - name : Install ModuleBuilder
37- if : steps.cacher.outputs.cache-hit != 'true'
38- shell : pwsh
39- run : |
40- Set-PSRepository PSGallery -InstallationPolicy Trusted
41- Install-Module ModuleBuilder -AllowClobber -Force
42-
43- - name : Build CIPPCore Module
44- shell : pwsh
45- run : |
46- $ModulePath = Join-Path $env:GITHUB_WORKSPACE "Modules/CIPPCore"
47- $OutputPath = Join-Path $env:GITHUB_WORKSPACE "Output"
48-
49- Write-Host "Building module from: $ModulePath"
50- Write-Host "Output directory: $OutputPath"
51-
52- # Generate function permissions before replacing the source module
53- $ToolsPath = Join-Path $env:GITHUB_WORKSPACE "Tools"
54- $ScriptPath = Join-Path $ToolsPath "Build-FunctionPermissions.ps1"
55- pwsh -File $ScriptPath -ModulePath $ModulePath
56-
57- # Build the module using ModuleBuilder
58- Build-Module -SourcePath $ModulePath -OutputDirectory $OutputPath -Verbose
59-
60- # Replace the source module with the built module
61- Remove-Item -Path $ModulePath -Recurse -Force
62- Copy-Item -Path (Join-Path $OutputPath "CIPPCore") -Destination $ModulePath -Recurse -Force
63-
64- Write-Host "Module built and replaced successfully"
65-
66- # Clean up output directory
67- Remove-Item -Path $OutputPath -Recurse -Force
68-
69- - name : Build CippExtensions Module
70- shell : pwsh
71- run : |
72- $ModulePath = Join-Path $env:GITHUB_WORKSPACE "Modules/CippExtensions"
73- $OutputPath = Join-Path $env:GITHUB_WORKSPACE "Output"
74-
75- Write-Host "Building module from: $ModulePath"
76- Write-Host "Output directory: $OutputPath"
77-
78- # Build the module using ModuleBuilder
79- Build-Module -SourcePath $ModulePath -OutputDirectory $OutputPath -Verbose
80-
81- # Replace the source module with the built module
82- Remove-Item -Path $ModulePath -Recurse -Force
83- Copy-Item -Path (Join-Path $OutputPath "CippExtensions") -Destination $ModulePath -Recurse -Force
84-
85- Write-Host "Module built and replaced successfully"
86-
87- # Clean up output directory
88- Remove-Item -Path $OutputPath -Recurse -Force
89-
9036 - name : Login to Azure
9137 uses : azure/login@v2
9238 with :
0 commit comments