@@ -301,10 +301,14 @@ jobs:
301301 $version = "${{ needs.prepare.outputs.version }}"
302302 $outdir = "dist/Windows"
303303 if (!(Test-Path "$outdir/spectHR.exe")) { throw "Missing $outdir/spectHR.exe" }
304+ if (!(Test-Path "ExampleData")) { throw "Missing ExampleData/ at repo root" }
304305
305306 $zip = "$outdir/spectHR-Windows-v$version.zip"
306307 if (Test-Path $zip) { Remove-Item $zip -Force }
307- Compress-Archive -Path "$outdir/spectHR.exe" -DestinationPath $zip
308+ # ``-Path`` accepts multiple roots; each one lands at the top
309+ # of the archive, so the .exe and the ExampleData/ folder sit
310+ # side-by-side inside the zip.
311+ Compress-Archive -Path "$outdir/spectHR.exe","ExampleData" -DestinationPath $zip
308312 Remove-Item "$outdir/spectHR.exe" -Force
309313
310314 - name : Package macOS artifact
@@ -322,11 +326,20 @@ jobs:
322326 exit 1
323327 fi
324328
329+ if [ ! -d "ExampleData" ]; then
330+ echo "Missing ExampleData/ at repo root"
331+ exit 1
332+ fi
333+
325334 APP_NAME="spectHR-macOS-v$VERSION.app"
326335 mv "$APP_PATH" "$OUTDIR/$APP_NAME"
327336
328- ( cd "$OUTDIR" && /usr/bin/zip -r "spectHR-macOS-v$VERSION.zip" "$APP_NAME" )
329- rm -rf "$OUTDIR/$APP_NAME"
337+ # Stage ExampleData/ next to the .app so both end up at the
338+ # archive root after ``cd "$OUTDIR" && zip -r``.
339+ cp -R ExampleData "$OUTDIR/ExampleData"
340+
341+ ( cd "$OUTDIR" && /usr/bin/zip -r "spectHR-macOS-v$VERSION.zip" "$APP_NAME" "ExampleData" )
342+ rm -rf "$OUTDIR/$APP_NAME" "$OUTDIR/ExampleData"
330343
331344 - name : Package Linux artifact
332345 if : runner.os == 'Linux'
@@ -343,8 +356,18 @@ jobs:
343356 exit 1
344357 fi
345358
346- ( cd "$OUTDIR" && tar -czf "spectHR-Linux-v$VERSION.tar.gz" "spectHR-Linux-v$VERSION" )
359+ if [ ! -d "ExampleData" ]; then
360+ echo "Missing ExampleData/ at repo root"
361+ exit 1
362+ fi
363+
364+ # Stage ExampleData/ next to the binary so both sit at the
365+ # archive root after ``cd "$OUTDIR" && tar``.
366+ cp -R ExampleData "$OUTDIR/ExampleData"
367+
368+ ( cd "$OUTDIR" && tar -czf "spectHR-Linux-v$VERSION.tar.gz" "spectHR-Linux-v$VERSION" "ExampleData" )
347369 rm -f "$BIN"
370+ rm -rf "$OUTDIR/ExampleData"
348371
349372 - name : Upload artifact (only packaged files)
350373 uses : actions/upload-artifact@v4
0 commit comments