Skip to content
15 changes: 14 additions & 1 deletion .ci_scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ shopt -s nullglob

if ([ "$OS_NAME" = "macos-10.15" ] || [ "$OS_NAME" = "macos-13" ]) && [ "$PACKAGE" = "ON" ]; then
sudo chmod -R +w /usr/local/Cellar

# Workaround resource busy bug on github on MacOS 13
# https://github.com/actions/runner-images/issues/7522
i=0
until
cpack -G Bundle;
sudo cpack -G Bundle;

base_path="/Users/runner/work/supertux/supertux/build/_CPack_Packages/Darwin/Bundle"
maybe_target=$(find $base_path -type d -depth -mindepth 1 -maxdepth 1)
directory_name=$(basename $maybe_target)
echo "Well, here's the example target:"
echo $maybe_target
echo "And here's the basename:"
echo $directory_name

/usr/bin/hdiutil create -debug -ov -srcfolder $maybe_target -volname "SuperTux v0.6.3-1698-g56492b0c8" -fs "HFS+" -format UDRW "$base_path/temp.dmg"
sudo fs_usage -t 10 | grep "/dev/disk"

do
if [ $i -eq 10 ]; then exit 1; fi
i=$((i+1))
Expand Down
Loading