|
63 | 63 | shell: bash |
64 | 64 | run: | |
65 | 65 | ref="${GITHUB_REF_NAME}" |
66 | | - echo "H5CPP_VERSION=${ref#v}" >> "$GITHUB_ENV" |
| 66 | + if [[ "$ref" == v* ]]; then |
| 67 | + echo "H5CPP_VERSION=${ref#v}" >> "$GITHUB_ENV" |
| 68 | + else |
| 69 | + echo "H5CPP_VERSION=1.12.99-test" >> "$GITHUB_ENV" |
| 70 | + fi |
67 | 71 |
|
68 | 72 | - name: Install LLVM toolchain (Linux) |
69 | 73 | if: runner.os == 'Linux' |
@@ -213,6 +217,15 @@ jobs: |
213 | 217 | cpack -G "${{ matrix.generators }}" \ |
214 | 218 | -D "CPACK_PACKAGE_FILE_NAME=h5cpp-compiler-${H5CPP_VERSION}-${{ matrix.asset_suffix }}" \ |
215 | 219 | --config CPackConfig.cmake |
| 220 | + # macOS guard: productbuild must produce a real payload |
| 221 | + if [[ "${{ matrix.generators }}" == "productbuild" ]]; then |
| 222 | + pkg="h5cpp-compiler-${H5CPP_VERSION}-${{ matrix.asset_suffix }}.pkg" |
| 223 | + size=$(stat -f%z "$pkg" 2>/dev/null || stat -c%s "$pkg" 2>/dev/null) |
| 224 | + if (( size < 100000 )); then |
| 225 | + echo "macOS package is suspiciously small (${size} bytes) — likely empty" >&2 |
| 226 | + exit 1 |
| 227 | + fi |
| 228 | + fi |
216 | 229 | env: |
217 | 230 | CPACK_DEBIAN_PACKAGE_ARCHITECTURE: ${{ matrix.deb_arch }} |
218 | 231 | CPACK_RPM_PACKAGE_ARCHITECTURE: ${{ matrix.rpm_arch }} |
@@ -264,6 +277,70 @@ jobs: |
264 | 277 | if-no-files-found: error |
265 | 278 | path: dist/*.tar.gz |
266 | 279 |
|
| 280 | + wine-smoke-test: |
| 281 | + name: Wine smoke-test / Windows NSIS |
| 282 | + needs: package |
| 283 | + runs-on: ubuntu-24.04 |
| 284 | + if: startsWith(github.ref, 'refs/tags/') |
| 285 | + |
| 286 | + steps: |
| 287 | + - name: Install Wine |
| 288 | + shell: bash |
| 289 | + run: | |
| 290 | + set -euxo pipefail |
| 291 | + sudo dpkg --add-architecture i386 |
| 292 | + sudo apt-get update |
| 293 | + sudo apt-get install -y --no-install-recommends wine64 wine32 xvfb |
| 294 | +
|
| 295 | + - name: Download Windows artifact |
| 296 | + uses: actions/download-artifact@v8 |
| 297 | + with: |
| 298 | + name: h5cpp-compiler-windows-latest-NSIS |
| 299 | + path: windows-artifact |
| 300 | + |
| 301 | + - name: Smoke-test under Wine |
| 302 | + shell: bash |
| 303 | + run: | |
| 304 | + set -euxo pipefail |
| 305 | + export WINEPREFIX=/tmp/wine-smoke |
| 306 | + export WINEARCH=win64 |
| 307 | +
|
| 308 | + # Initialize Wine prefix silently |
| 309 | + xvfb-run -a wine64 wineboot --init 2>/dev/null || true |
| 310 | +
|
| 311 | + # Locate the NSIS installer |
| 312 | + installer=( windows-artifact/h5cpp-compiler-*.exe ) |
| 313 | + if [[ ! -f "${installer[0]}" ]]; then |
| 314 | + echo "No Windows installer found in artifact" >&2 |
| 315 | + exit 1 |
| 316 | + fi |
| 317 | +
|
| 318 | + # Silent install |
| 319 | + xvfb-run -a wine64 "${installer[0]}" /S |
| 320 | +
|
| 321 | + # Locate installed binary (glob handles versioned install dir) |
| 322 | + h5cpp_exe=( /tmp/wine-smoke/drive_c/Program\ Files/h5cpp-compiler/*/bin/h5cpp.exe ) |
| 323 | + if [[ ! -f "${h5cpp_exe[0]}" ]]; then |
| 324 | + echo "h5cpp.exe not found after NSIS install" >&2 |
| 325 | + exit 1 |
| 326 | + fi |
| 327 | +
|
| 328 | + # Run smoke test |
| 329 | + output=$(xvfb-run -a wine64 "${h5cpp_exe[0]}" --version 2>&1) |
| 330 | + echo "$output" |
| 331 | +
|
| 332 | + # Validate expected output |
| 333 | + if ! grep -q "H5CPP:" <<< "$output"; then |
| 334 | + echo "Smoke test failed: missing H5CPP banner" >&2 |
| 335 | + exit 1 |
| 336 | + fi |
| 337 | + if ! grep -q "LLVM version" <<< "$output"; then |
| 338 | + echo "Smoke test failed: missing LLVM version string" >&2 |
| 339 | + exit 1 |
| 340 | + fi |
| 341 | +
|
| 342 | + echo "Wine smoke-test passed" |
| 343 | +
|
267 | 344 | publish: |
268 | 345 | name: Publish Release |
269 | 346 | needs: [package, musl] |
|
0 commit comments