|
26 | 26 | id: version |
27 | 27 | shell: pwsh |
28 | 28 | run: | |
| 29 | + $ErrorActionPreference = 'Stop' |
29 | 30 | $tag = "${{ github.ref_name }}" |
30 | 31 | $ver = if ($tag -match '^v(.+)$') { $Matches[1] } else { "0.0.0-dev" } |
31 | 32 | echo "VERSION=$ver" >> $env:GITHUB_OUTPUT |
|
55 | 56 | - name: Download WebView2 SDK |
56 | 57 | shell: pwsh |
57 | 58 | run: | |
| 59 | + $ErrorActionPreference = 'Stop' |
58 | 60 | nuget install Microsoft.Web.WebView2 -OutputDirectory wv2_pkg |
59 | 61 | $wv2Dir = Get-ChildItem -Path wv2_pkg -Filter "Microsoft.Web.WebView2.*" -Directory | Select-Object -First 1 |
60 | 62 | $destBase = "third_party/webview2/sdk/build/native" |
|
66 | 68 | - name: Configure CMake |
67 | 69 | shell: pwsh |
68 | 70 | run: | |
| 71 | + $ErrorActionPreference = 'Stop' |
69 | 72 | $qtBase = (Get-Item "$env:QT_ROOT_DIR").Parent.Parent.FullName |
70 | 73 | $toolsDir = Join-Path $qtBase "Tools" |
71 | 74 |
|
@@ -93,40 +96,66 @@ jobs: |
93 | 96 |
|
94 | 97 | - name: Build |
95 | 98 | shell: pwsh |
96 | | - run: cmake --build build --config ${{ env.BUILD_TYPE }} |
| 99 | + run: | |
| 100 | + $ErrorActionPreference = 'Stop' |
| 101 | + cmake --build build --config ${{ env.BUILD_TYPE }} |
97 | 102 |
|
98 | 103 | - name: Install |
99 | 104 | shell: pwsh |
100 | 105 | run: | |
| 106 | + $ErrorActionPreference = 'Stop' |
101 | 107 | $installDir = Join-Path "${{ github.workspace }}" "build\install" |
102 | 108 | New-Item -ItemType Directory -Path $installDir -Force | Out-Null |
103 | 109 | cmake --install build --config ${{ env.BUILD_TYPE }} --prefix "$installDir" |
| 110 | + $items = Get-ChildItem -Recurse $installDir |
| 111 | + if (-not $items) { Write-Error "Install directory is empty — check install() rules in CMakeLists.txt"; exit 1 } |
| 112 | + Write-Host "Install tree:"; $items | ForEach-Object { Write-Host $_.FullName } |
104 | 113 |
|
105 | | - - name: Deploy Qt runtime |
| 114 | + - name: Copy Python bundle to install tree |
106 | 115 | shell: pwsh |
107 | 116 | run: | |
108 | | - $exe = Get-ChildItem -Path "build\install" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1 |
109 | | - if (-not $exe) { |
110 | | - $exe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1 |
| 117 | + $ErrorActionPreference = 'Stop' |
| 118 | + $buildExe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | |
| 119 | + Where-Object { $_.FullName -notlike "*install*" } | |
| 120 | + Select-Object -First 1 |
| 121 | + if (-not $buildExe) { Write-Error "CapScriptPro.exe not found in build output"; exit 1 } |
| 122 | + $buildDir = $buildExe.DirectoryName |
| 123 | + $installDir = Join-Path "${{ github.workspace }}" "build\install" |
| 124 | + $srcPython = Join-Path $buildDir "python" |
| 125 | + $dstPython = Join-Path $installDir "python" |
| 126 | + if (Test-Path $srcPython) { |
| 127 | + Write-Host "Copying bundled Python from $srcPython to $dstPython" |
| 128 | + Copy-Item -Path $srcPython -Destination $dstPython -Recurse -Force |
| 129 | + } else { |
| 130 | + Write-Warning "No python bundle found at $srcPython — skipping" |
111 | 131 | } |
112 | | - if (-not $exe) { Write-Error "CapScriptPro.exe not found"; exit 1 } |
113 | 132 |
|
| 133 | + - name: Deploy Qt runtime |
| 134 | + shell: pwsh |
| 135 | + run: | |
| 136 | + $ErrorActionPreference = 'Stop' |
| 137 | + $exe = Get-ChildItem -Path "build\install" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1 |
| 138 | + if (-not $exe) { Write-Error "CapScriptPro.exe not found in install tree"; exit 1 } |
114 | 139 | $windeployqt = Join-Path $env:QT_ROOT_DIR "bin\windeployqt.exe" |
115 | 140 | if (-not (Test-Path $windeployqt)) { Write-Error "windeployqt not found at $windeployqt"; exit 1 } |
116 | | -
|
117 | 141 | & $windeployqt $exe.FullName --no-translations --no-system-d3d-compiler --no-opengl-sw |
118 | 142 |
|
119 | 143 | - name: Create build archive |
120 | 144 | shell: pwsh |
121 | 145 | run: | |
| 146 | + $ErrorActionPreference = 'Stop' |
122 | 147 | $ver = "${{ steps.version.outputs.VERSION }}" |
123 | | - $exePath = (Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | Select-Object -First 1).FullName |
124 | | - $exeDir = [System.IO.Path]::GetDirectoryName($exePath) |
125 | | - Compress-Archive -Path "$exeDir\*" -DestinationPath "CapScriptPro-Windows-x64-$ver-build.zip" |
| 148 | + $buildExe = Get-ChildItem -Path "build" -Filter "CapScriptPro.exe" -Recurse | |
| 149 | + Where-Object { $_.FullName -notlike "*install*" } | |
| 150 | + Select-Object -First 1 |
| 151 | + if (-not $buildExe) { Write-Error "CapScriptPro.exe not found in build output"; exit 1 } |
| 152 | + $buildDir = $buildExe.DirectoryName |
| 153 | + Compress-Archive -Path "$buildDir\*" -DestinationPath "CapScriptPro-Windows-x64-$ver-build.zip" |
126 | 154 |
|
127 | 155 | - name: Create installed archive |
128 | 156 | shell: pwsh |
129 | 157 | run: | |
| 158 | + $ErrorActionPreference = 'Stop' |
130 | 159 | $ver = "${{ steps.version.outputs.VERSION }}" |
131 | 160 | $installDir = Join-Path "${{ github.workspace }}" "build\install" |
132 | 161 | if (-not (Test-Path $installDir)) { Write-Error "Install directory not found: $installDir"; exit 1 } |
|
0 commit comments