2323 git lfs install
2424 git lfs pull
2525
26- # ВОССТАНОВЛЕНИЕ КЭША ЗАГРУЗОК
27- - name : Restore downloads cache
28- uses : actions/cache@v4
29- with :
30- path : cache
31- key : downloads-${{ inputs.version }}-${{ hashFiles('resources/matrix/*.json', 'generate/genall.ps1', 'resources/composer/*') }}
32- restore-keys : |
33- downloads-${{ inputs.version }}-
34- downloads-
35-
36- # На случай первого запуска — создаём папку кэша
37- - name : Ensure cache folder exists
38- shell : pwsh
39- run : |
40- if (-not (Test-Path "cache")) { New-Item -ItemType Directory -Path "cache" -Force | Out-Null }
41- Write-Host "Cache folder ready: $(Resolve-Path cache)"
42-
4326 - name : Remove old Inno Setup (if exists)
4427 shell : pwsh
4528 run : |
8063
8164 Write-Host "Set AppVersion to $ver and AppVersion_ to $verUnderscore in OpenServerPanel.iss"
8265
83- # Подготовка данных PostgreSQL: очистка/ACL для data и temp
84- - name : Prepare PostgreSQL data dirs (reset ACL and owner)
85- shell : pwsh
86- run : |
87- $ErrorActionPreference = 'Stop'
88-
89- function Reset-AclRecursive {
90- param([string]$Path)
91- if (-not (Test-Path $Path)) { return }
92-
93- attrib -r -h -s "$Path" /S /D 2>$null
94- icacls "$Path" /inheritance:e /T /C | Out-Null
95-
96- try { Remove-Item "$Path" -Recurse -Force -ErrorAction SilentlyContinue } catch {}
97- New-Item -ItemType Directory -Force -Path "$Path" | Out-Null
98-
99- icacls "$Path" /inheritance:d /T /C | Out-Null
100-
101- $me = "$env:USERDOMAIN\$env:USERNAME"
102- takeown /F "$Path" /R /D Y | Out-Null
103- cmd /c "icacls ""$Path"" /setowner ""$me"" /T /C" | Out-Null
104-
105- icacls "$Path" /grant:r "${me}:(OI)(CI)F" /T /C | Out-Null
106- icacls "$Path" /grant:r "*S-1-5-18:(OI)(CI)F" /T /C | Out-Null # SYSTEM
107- icacls "$Path" /grant:r "*S-1-5-32-545:(OI)(CI)F" /T /C | Out-Null # BUILTIN\Users
108-
109- attrib -r -h -s "$Path" /S /D 2>$null
110- }
111-
112- $modules = Join-Path (Get-Location) 'modules'
113- $pgVers = 11..17 | ForEach-Object { "PostgreSQL-$_" }
114- foreach ($v in $pgVers) {
115- $mod = Join-Path $modules $v
116- $data = Join-Path $mod 'ospanel_data\default_data'
117- $tmp = Join-Path $mod 'temp'
118- Reset-AclRecursive -Path $data
119- Reset-AclRecursive -Path $tmp
120- }
121-
122- Start-Sleep -Seconds 2
123-
12466 - name : Run generators (genall.ps1 and gendb.bat)
12567 shell : pwsh
12668 env :
@@ -130,15 +72,6 @@ jobs:
13072 $ErrorActionPreference = 'Stop'
13173 if (-not (Test-Path $env:TEMP)) { New-Item -ItemType Directory -Force -Path $env:TEMP | Out-Null }
13274
133- # Листинг кэша перед генерацией (для диагностики)
134- if (Test-Path "..\cache") {
135- Write-Host "Pre-run cache listing (..\\cache):"
136- Get-ChildItem -Recurse -Force "..\cache" | Select-Object FullName, Length | Format-Table -AutoSize
137- } elseif (Test-Path "cache") {
138- Write-Host "Pre-run cache listing (cache):"
139- Get-ChildItem -Recurse -Force "cache" | Select-Object FullName, Length | Format-Table -AutoSize
140- }
141-
14275 Set-Location generate
14376 # genall.ps1 использует $CacheDir = "..\cache" — это указывает на корневую папку cache
14477 .\genall.ps1
@@ -161,23 +94,4 @@ jobs:
16194 with :
16295 name : open-server-panel-setup
16396 path : release/*.exe
164-
165- # Диагностика содержимого кэша перед сохранением
166- - name : List cache dir
167- if : always()
168- shell : pwsh
169- run : |
170- if (Test-Path "cache") {
171- Write-Host "Post-run cache listing:"
172- Get-ChildItem -Recurse -Force "cache" | Select-Object FullName, Length | Format-Table -AutoSize
173- } else {
174- Write-Host "Cache directory not found."
175- }
176-
177- # СОХРАНЕНИЕ КЭША ПОСЛЕ СБОРКИ
178- - name : Save downloads cache
179- if : always()
180- uses : actions/cache/save@v4
181- with :
182- path : cache
183- key : downloads-${{ inputs.version }}-${{ hashFiles('resources/matrix/*.json', 'generate/genall.ps1', 'resources/composer/*') }}
97+
0 commit comments