Skip to content

Commit f9cbb08

Browse files
committed
Missing install steps
1 parent cb85725 commit f9cbb08

2 files changed

Lines changed: 49 additions & 10 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
id: version
2727
shell: pwsh
2828
run: |
29+
$ErrorActionPreference = 'Stop'
2930
$tag = "${{ github.ref_name }}"
3031
$ver = if ($tag -match '^v(.+)$') { $Matches[1] } else { "0.0.0-dev" }
3132
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
@@ -55,6 +56,7 @@ jobs:
5556
- name: Download WebView2 SDK
5657
shell: pwsh
5758
run: |
59+
$ErrorActionPreference = 'Stop'
5860
nuget install Microsoft.Web.WebView2 -OutputDirectory wv2_pkg
5961
$wv2Dir = Get-ChildItem -Path wv2_pkg -Filter "Microsoft.Web.WebView2.*" -Directory | Select-Object -First 1
6062
$destBase = "third_party/webview2/sdk/build/native"
@@ -66,6 +68,7 @@ jobs:
6668
- name: Configure CMake
6769
shell: pwsh
6870
run: |
71+
$ErrorActionPreference = 'Stop'
6972
$qtBase = (Get-Item "$env:QT_ROOT_DIR").Parent.Parent.FullName
7073
$toolsDir = Join-Path $qtBase "Tools"
7174
@@ -93,40 +96,66 @@ jobs:
9396
9497
- name: Build
9598
shell: pwsh
96-
run: cmake --build build --config ${{ env.BUILD_TYPE }}
99+
run: |
100+
$ErrorActionPreference = 'Stop'
101+
cmake --build build --config ${{ env.BUILD_TYPE }}
97102
98103
- name: Install
99104
shell: pwsh
100105
run: |
106+
$ErrorActionPreference = 'Stop'
101107
$installDir = Join-Path "${{ github.workspace }}" "build\install"
102108
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
103109
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 }
104113
105-
- name: Deploy Qt runtime
114+
- name: Copy Python bundle to install tree
106115
shell: pwsh
107116
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"
111131
}
112-
if (-not $exe) { Write-Error "CapScriptPro.exe not found"; exit 1 }
113132
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 }
114139
$windeployqt = Join-Path $env:QT_ROOT_DIR "bin\windeployqt.exe"
115140
if (-not (Test-Path $windeployqt)) { Write-Error "windeployqt not found at $windeployqt"; exit 1 }
116-
117141
& $windeployqt $exe.FullName --no-translations --no-system-d3d-compiler --no-opengl-sw
118142
119143
- name: Create build archive
120144
shell: pwsh
121145
run: |
146+
$ErrorActionPreference = 'Stop'
122147
$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"
126154
127155
- name: Create installed archive
128156
shell: pwsh
129157
run: |
158+
$ErrorActionPreference = 'Stop'
130159
$ver = "${{ steps.version.outputs.VERSION }}"
131160
$installDir = Join-Path "${{ github.workspace }}" "build\install"
132161
if (-not (Test-Path $installDir)) { Write-Error "Install directory not found: $installDir"; exit 1 }

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,16 @@ if(WIN32 AND Qt6WebView_FOUND AND Qt6QuickWidgets_FOUND AND Qt6WebViewQuick_FOUN
299299
endif()
300300
endif()
301301

302+
install(TARGETS ${PROJECT_NAME} CapScriptUpdater
303+
RUNTIME DESTINATION .
304+
)
305+
306+
if(WIN32 AND CAPSCRIPT_WEBVIEW2_AVAILABLE AND EXISTS "${_WV2_LOADER_DLL}")
307+
install(FILES "${_WV2_LOADER_DLL}" DESTINATION .)
308+
endif()
302309

310+
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/python/"
311+
DESTINATION python
312+
)
303313

304314

0 commit comments

Comments
 (0)