Workaround macOS dmg build error with CMake (#819)
* Workaround macOS dmg build error with CMake Retry the macOS workflow multiple times in order to work around this issue with CMake: https://gitlab.kitware.com/cmake/cmake/-/issues/25671 Solution stolen wholesale from SDL and @madebr Thank you! https://github.com/libsdl-org/SDL/pull/9816
This commit is contained in:
parent
170a052489
commit
6d938bf7c9
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -148,7 +148,22 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build
|
cmake --build build
|
||||||
cpack --config build/CPackConfig.cmake -B build/installer --verbose
|
# DMG creation on macOS occasionally fails, so try multiple times
|
||||||
|
# https://gitlab.kitware.com/cmake/cmake/-/issues/25671
|
||||||
|
success=0
|
||||||
|
max_tries=10
|
||||||
|
for i in $(seq $max_tries); do
|
||||||
|
cpack --config build/CPackConfig.cmake -B build/installer --verbose && success=1
|
||||||
|
if test $success = 1; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Package creation failed. Sleep 1 second and try again."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
if test $success = 0; then
|
||||||
|
echo "Package creation failed after $max_tries attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
mv build/installer/*.dmg build/Release
|
mv build/installer/*.dmg build/Release
|
||||||
- name: Notarize
|
- name: Notarize
|
||||||
if: github.ref_name == 'main'
|
if: github.ref_name == 'main'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user