Skip to content

Commit 016d80b

Browse files
fix(build): retry transient dmgbuild failures (#1368)
* fix(build): retry transient dmgbuild failures * fix(build): back off between dmg retries * fix(ci): serialize Poetry installs in Tauri builds * ci: retry transient artifact upload
1 parent fbd1562 commit 016d80b

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ jobs:
435435
AW_EXTRAS: true
436436
TAURI_BUILD: true
437437
MACOSX_DEPLOYMENT_TARGET: "12.0"
438+
# All subprojects share one virtualenv. Poetry's parallel installer can
439+
# race while replacing the same dependency from different lock files.
440+
POETRY_INSTALLER_PARALLEL: "false"
438441
defaults:
439442
run:
440443
shell: bash
@@ -722,3 +725,5 @@ jobs:
722725
files: dist/*/activitywatch-*.*
723726
body_path: dist/release_notes/release_notes.md
724727
prerelease: ${{ !(steps.version.outputs.is_stable == 'true') }}
728+
729+
# Retry CI after transient upload-artifact timeout.

‎Makefile‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,17 @@ endif
181181
dist/ActivityWatch.dmg: dist/ActivityWatch.app
182182
# NOTE: This does not codesign the dmg, that is done in the CI config
183183
pip install dmgbuild
184-
dmgbuild -s scripts/package/dmgbuild-settings.py -D app=dist/ActivityWatch.app "ActivityWatch" dist/ActivityWatch.dmg
184+
@for attempt in 1 2 3; do \
185+
rm -f dist/ActivityWatch.dmg; \
186+
if dmgbuild -s scripts/package/dmgbuild-settings.py -D app=dist/ActivityWatch.app "ActivityWatch" dist/ActivityWatch.dmg; then \
187+
exit 0; \
188+
fi; \
189+
if [ $$attempt -eq 3 ]; then \
190+
exit 1; \
191+
fi; \
192+
echo "dmgbuild attempt $$attempt failed; retrying after macOS releases the disk image" >&2; \
193+
sleep $$((5 * attempt)); \
194+
done
185195

186196
dist/notarize:
187197
./scripts/notarize.sh

0 commit comments

Comments
 (0)