Skip to content

Commit 79170cc

Browse files
committed
fix(ci): Run create-dmg until it succeeds
The previous workaround from commit 2d759ce did not stop our macOS build jobs from randomly failing. This stupid approach will continue to invoke create-dmg until it succeeds. If it fails to do so after 10 tries, we just give up.
1 parent 2d759ce commit 79170cc

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

.github/workflows/macos.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,32 @@ jobs:
187187
- name: Build dmg (${{ matrix.build-type }})
188188
run: |
189189
cd build
190-
# FIXME: No, we're not crazy. We invoke create-dmg as root to work around this issue:
191-
# https://github.com/actions/runner-images/issues/7522
192-
sudo create-dmg \
193-
--no-internet-enable \
194-
--format ULFO \
195-
--background ../packaging/macos/dmg-background.png \
196-
--hide-extension 'Notes Better.app' \
197-
--icon 'Notes Better.app' 180 170 \
198-
--icon-size 160 \
199-
--text-size 12 \
200-
--volname Notes \
201-
--volicon ../src/images/notes_icon.icns \
202-
--window-size 660 400 \
203-
--app-drop-link 480 170 \
204-
'${{ steps.vars.outputs.file_name }}' \
205-
'Notes Better.app'
190+
# FIXME: Undo this overengineered crap once the following issue gets figured out:
191+
# https://github.com/actions/runner-images/issues/7522
192+
max_tries=10
193+
i=0
194+
until create-dmg \
195+
--no-internet-enable \
196+
--format ULFO \
197+
--background ../packaging/macos/dmg-background.png \
198+
--hide-extension 'Notes Better.app' \
199+
--icon 'Notes Better.app' 180 170 \
200+
--icon-size 160 \
201+
--text-size 12 \
202+
--volname Notes \
203+
--volicon ../src/images/notes_icon.icns \
204+
--window-size 660 400 \
205+
--app-drop-link 480 170 \
206+
'${{ steps.vars.outputs.file_name }}' \
207+
'Notes Better.app'
208+
do
209+
if [ $i -eq $max_tries ]
210+
then
211+
echo 'Error: create-dmg did not succeed even after 10 tries.'
212+
exit 1
213+
fi
214+
((i++))
215+
done
206216
207217
- name: Notarize
208218
if: github.repository == 'nuttyartist/notes' && github.event_name != 'pull_request'

0 commit comments

Comments
 (0)