1414
1515jobs :
1616 deploy :
17- runs-on : ubuntu -latest
17+ runs-on : windows -latest
1818
1919 steps :
2020 - name : ' Checkout GitHub Action'
2121 uses : actions/checkout@v4
22+
23+ - name : Setup PowerShell module cache
24+ id : cacher
25+ uses : actions/cache@v3
26+ with :
27+ path : " ~/.local/share/powershell/Modules"
28+ key : ${{ runner.os }}-ModuleBuilder
29+
30+ - name : Install ModuleBuilder
31+ if : steps.cacher.outputs.cache-hit != 'true'
32+ shell : pwsh
33+ run : |
34+ Set-PSRepository PSGallery -InstallationPolicy Trusted
35+ Install-Module ModuleBuilder -AllowClobber -Force
36+
37+ - name : Build CIPPCore Module
38+ shell : pwsh
39+ run : |
40+ $ModulePath = Join-Path $env:GITHUB_WORKSPACE "Modules/CIPPCore"
41+ $OutputPath = Join-Path $env:GITHUB_WORKSPACE "Output"
42+
43+ Write-Host "Building module from: $ModulePath"
44+ Write-Host "Output directory: $OutputPath"
45+
46+ # Build the module using ModuleBuilder
47+ Build-Module -SourcePath $ModulePath -OutputDirectory $OutputPath -Verbose
48+
49+ # Replace the source module with the built module
50+ Remove-Item -Path $ModulePath -Recurse -Force
51+ Copy-Item -Path (Join-Path $OutputPath "CIPPCore") -Destination $ModulePath -Recurse -Force
52+
53+ Write-Host "Module built and replaced successfully"
54+
55+ # Clean up output directory
56+ Remove-Item -Path $OutputPath -Recurse -Force
57+
58+ - name : Build CippExtensions Module
59+ shell : pwsh
60+ run : |
61+ $ModulePath = Join-Path $env:GITHUB_WORKSPACE "Modules/CippExtensions"
62+ $OutputPath = Join-Path $env:GITHUB_WORKSPACE "Output"
63+
64+ Write-Host "Building module from: $ModulePath"
65+ Write-Host "Output directory: $OutputPath"
66+
67+ # Build the module using ModuleBuilder
68+ Build-Module -SourcePath $ModulePath -OutputDirectory $OutputPath -Verbose
69+
70+ # Replace the source module with the built module
71+ Remove-Item -Path $ModulePath -Recurse -Force
72+ Copy-Item -Path (Join-Path $OutputPath "CippExtensions") -Destination $ModulePath -Recurse -Force
73+
74+ Write-Host "Module built and replaced successfully"
75+
76+ # Clean up output directory
77+ Remove-Item -Path $OutputPath -Recurse -Force
2278
2379 - name : ' Run Azure Functions Action'
2480 uses : Azure/functions-action@v1
2783 app-name : ' cipppehdy'
2884 slot-name : ' Production'
2985 package : ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30- publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4508E611D7944AD6961241F6FF9B5670 }}
31- sku : ' flexconsumption'
32-
86+
87+ publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4508E611D7944AD6961241F6FF9B5670 }}
88+ sku : ' flexconsumption'
89+
0 commit comments