3737 run : |
3838 rm -rf libserum
3939 git clone https://github.com/PPUC/libserum.git libserum
40- (cd libserum && git checkout f871ab8923460108776595170d0bef8f7a3bc8e4 )
40+ (cd libserum && git checkout d2616536ea90fe6bf83bb48dc4655dc3fb3e25fd )
4141
4242 - if : matrix.platform == 'linux'
4343 name : Install dependencies (linux)
@@ -110,49 +110,18 @@ jobs:
110110 New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\\vcpkg" | Out-Null
111111
112112 - if : matrix.platform == 'win'
113- name : Restore vcpkg cache (Windows installed )
113+ name : Restore vcpkg cache (Windows)
114114 uses : actions/cache/restore@v4
115115 with :
116- path : vcpkg/installed
117- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
118- restore-keys : |
119- vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-dynamic-
120-
121- - if : matrix.platform == 'win'
122- name : Restore vcpkg cache (Windows downloads)
123- uses : actions/cache/restore@v4
124- with :
125- path : vcpkg/downloads
126- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
127- restore-keys : |
128- vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-dynamic-
129-
130- - if : matrix.platform == 'win'
131- name : Restore vcpkg cache (Windows buildtrees)
132- uses : actions/cache/restore@v4
133- with :
134- path : vcpkg/buildtrees
135- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
136- restore-keys : |
137- vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-dynamic-
138-
139- - if : matrix.platform == 'win'
140- name : Restore vcpkg cache (Windows packages)
141- uses : actions/cache/restore@v4
142- with :
143- path : vcpkg/packages
144- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
145- restore-keys : |
146- vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-dynamic-
147-
148- - if : matrix.platform == 'win'
149- name : Restore vcpkg cache (Windows registry)
150- uses : actions/cache/restore@v4
151- with :
152- path : vcpkg/registry
153- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
116+ path : |
117+ vcpkg/installed
118+ vcpkg/downloads
119+ vcpkg/buildtrees
120+ vcpkg/packages
121+ vcpkg/registry
122+ key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
154123 restore-keys : |
155- vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry- dynamic-
124+ vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-
156125
157126 - if : matrix.platform == 'win'
158127 name : Setup vcpkg (Windows)
@@ -169,7 +138,6 @@ jobs:
169138 }
170139 & "$root/bootstrap-vcpkg.bat"
171140 $triplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows" } else { "x64-windows" }
172- $staticTriplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows-static" } else { "x64-windows-static" }
173141 "VCPKG_ROOT=$root" | Out-File -FilePath $env:GITHUB_ENV -Append
174142 "VCPKG_DEFAULT_TRIPLET=$triplet" | Out-File -FilePath $env:GITHUB_ENV -Append
175143 "VCPKG_DEFAULT_BINARY_CACHE=$binaryCache" | Out-File -FilePath $env:GITHUB_ENV -Append
@@ -179,7 +147,7 @@ jobs:
179147 uses : actions/cache/restore@v4
180148 with :
181149 path : vcpkg-binary-cache
182- key : vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-static -${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
150+ key : vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic -${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
183151 restore-keys : |
184152 vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic-
185153
@@ -193,39 +161,16 @@ jobs:
193161 & "$root/vcpkg.exe" install opencv qtbase --triplet $triplet
194162
195163 - if : matrix.platform == 'win'
196- name : Save vcpkg cache (Windows installed )
164+ name : Save vcpkg cache (Windows)
197165 uses : actions/cache/save@v4
198166 with :
199- path : vcpkg/installed
200- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
201-
202- - if : matrix.platform == 'win'
203- name : Save vcpkg cache (Windows downloads)
204- uses : actions/cache/save@v4
205- with :
206- path : vcpkg/downloads
207- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
208-
209- - if : matrix.platform == 'win'
210- name : Save vcpkg cache (Windows buildtrees)
211- uses : actions/cache/save@v4
212- with :
213- path : vcpkg/buildtrees
214- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
215-
216- - if : matrix.platform == 'win'
217- name : Save vcpkg cache (Windows packages)
218- uses : actions/cache/save@v4
219- with :
220- path : vcpkg/packages
221- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
222-
223- - if : matrix.platform == 'win'
224- name : Save vcpkg cache (Windows registry)
225- uses : actions/cache/save@v4
226- with :
227- path : vcpkg/registry
228- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
167+ path : |
168+ vcpkg/installed
169+ vcpkg/downloads
170+ vcpkg/buildtrees
171+ vcpkg/packages
172+ vcpkg/registry
173+ key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
229174
230175 - if : matrix.platform == 'win'
231176 name : Save vcpkg binary cache (Windows)
@@ -234,57 +179,6 @@ jobs:
234179 path : vcpkg-binary-cache
235180 key : vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
236181
237- - if : matrix.platform == 'win'
238- name : vcpkg install (Windows static)
239- shell : pwsh
240- run : |
241- $root = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
242- $env:VCPKG_DEFAULT_BINARY_CACHE = Join-Path $env:GITHUB_WORKSPACE "vcpkg-binary-cache"
243- $staticTriplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows-static" } else { "x64-windows-static" }
244- & "$root/vcpkg.exe" install opencv qtbase --triplet $staticTriplet
245-
246- - if : matrix.platform == 'win'
247- name : Save vcpkg cache (Windows installed, static)
248- uses : actions/cache/save@v4
249- with :
250- path : vcpkg/installed
251- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
252-
253- - if : matrix.platform == 'win'
254- name : Save vcpkg cache (Windows downloads, static)
255- uses : actions/cache/save@v4
256- with :
257- path : vcpkg/downloads
258- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
259-
260- - if : matrix.platform == 'win'
261- name : Save vcpkg cache (Windows buildtrees, static)
262- uses : actions/cache/save@v4
263- with :
264- path : vcpkg/buildtrees
265- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
266-
267- - if : matrix.platform == 'win'
268- name : Save vcpkg cache (Windows packages, static)
269- uses : actions/cache/save@v4
270- with :
271- path : vcpkg/packages
272- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
273-
274- - if : matrix.platform == 'win'
275- name : Save vcpkg cache (Windows registry, static)
276- uses : actions/cache/save@v4
277- with :
278- path : vcpkg/registry
279- key : vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
280-
281- - if : matrix.platform == 'win'
282- name : Save vcpkg binary cache (Windows static)
283- uses : actions/cache/save@v4
284- with :
285- path : vcpkg-binary-cache
286- key : vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
287-
288182 - if : matrix.platform == 'win'
289183 name : Add msbuild (Windows)
290184 uses : microsoft/setup-msbuild@v2
@@ -295,9 +189,43 @@ jobs:
295189 run : |
296190 find platforms \( -name "build.sh" -o -name "external.sh" \) -exec chmod +x {} \;
297191 ./platforms/${{ matrix.platform }}/${{ matrix.arch }}/build.sh
298- if [ "${{ matrix.platform }}" = "win" ]; then
299- STATIC_LINKING=1 ./platforms/${{ matrix.platform }}/${{ matrix.arch }}/build.sh
300- fi
192+
193+ - if : matrix.platform == 'win'
194+ name : Package Windows dynamic runtime
195+ shell : pwsh
196+ run : |
197+ $arch = "${{ matrix.arch }}"
198+ $triplet = if ($arch -eq "x86") { "x86-windows" } else { "x64-windows" }
199+ $root = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
200+ $artifact = Join-Path $env:GITHUB_WORKSPACE "artifacts\win-$arch"
201+ $exe = Join-Path $artifact "PPUC-Serum-Colorizer.exe"
202+ if (-not (Test-Path $exe)) {
203+ throw "Missing executable: $exe"
204+ }
205+ $windeployqt = Join-Path $root "installed\$triplet\tools\qt6\bin\windeployqt.exe"
206+ if (-not (Test-Path $windeployqt)) {
207+ throw "Missing windeployqt: $windeployqt"
208+ }
209+ & $windeployqt --release --dir $artifact $exe
210+ $opencvBin = Join-Path $root "installed\$triplet\bin"
211+ Get-ChildItem -Path $opencvBin -Filter "opencv_*.dll" | Copy-Item -Destination $artifact -Force
212+ $licenses = Join-Path $artifact "licenses"
213+ New-Item -ItemType Directory -Force -Path $licenses | Out-Null
214+ Copy-Item (Join-Path $env:GITHUB_WORKSPACE "LICENSE") -Destination $licenses -Force
215+ $qtShare = Join-Path $root "installed\$triplet\share\qt6"
216+ if (Test-Path $qtShare) {
217+ Get-ChildItem -Path $qtShare -File -Include "LICENSE*", "COPYING*", "LGPL*", "GPL*" |
218+ Copy-Item -Destination $licenses -Force
219+ }
220+ $opencvShare = Join-Path $root "installed\$triplet\share\opencv4"
221+ if (Test-Path $opencvShare) {
222+ Get-ChildItem -Path $opencvShare -File -Include "LICENSE*", "COPYING*" |
223+ Copy-Item -Destination $licenses -Force
224+ }
225+ $libserumLicense = Join-Path $env:GITHUB_WORKSPACE "libserum\LICENSE"
226+ if (Test-Path $libserumLicense) {
227+ Copy-Item $libserumLicense -Destination $licenses -Force
228+ }
301229
302230 - if : matrix.platform != 'win'
303231 name : Upload artifacts
@@ -312,10 +240,3 @@ jobs:
312240 with :
313241 name : PPUC-Serum-Colorizer-${{ matrix.platform }}-${{ matrix.arch }}
314242 path : artifacts/${{ matrix.platform }}-${{ matrix.arch }}
315-
316- - if : matrix.platform == 'win'
317- name : Upload artifacts (Windows static)
318- uses : actions/upload-artifact@v4
319- with :
320- name : PPUC-Serum-Colorizer-${{ matrix.platform }}-${{ matrix.arch }}-static
321- path : artifacts/${{ matrix.platform }}-${{ matrix.arch }}-static
0 commit comments