Compare commits

..
Author SHA1 Message Date
Brandon ThomasandClaude Opus 5.5 904f0fe522 Release 0.13.1: retry stapler validate on Apple network errors
0.13.0's macOS release job failed twice at `stapler validate` right after a successful notarization
and staple: the CloudKit ticket lookup lost its connection (NSURLErrorDomain -1005, Error 68). Retry
the validate up to four times with a growing pause; a missing or bad ticket still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 00:00:06 -04:00
2 changed files with 19 additions and 14 deletions

No files matched your search

-10
View File
@@ -40,16 +40,6 @@ export VECTORCRAFT_BUILD_DATE="${VECTORCRAFT_BUILD_DATE:-$(date -u +%Y-%m-%d)}"
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}"
# Emit a GitHub Actions warning (plain stderr outside Actions).
# Retry a flaky network step (Apple stapler/CloudKit) up to five times, 15 s apart.
retry() {
local attempt
for attempt in 1 2 3 4 5; do
"$@" && return 0
[ "$attempt" = 5 ] || { echo "retrying ($attempt/5): $*" >&2; sleep 15; }
done
return 1
}
warn() {
if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
}
+19 -4
View File
@@ -97,6 +97,21 @@ notarize() {
fi
}
# `stapler validate` looks the ticket up in Apple's CloudKit, and a dropped connection there
# (NSURLErrorDomain -1005, "Error 68") fails it although the staple worked. Retry with a pause; a
# missing or bad ticket still fails every try.
validate_stapled() {
local try
for try in 1 2 3 4; do
xcrun stapler validate "$1" && return 0
[ "$try" = 4 ] && break
echo "stapler validate failed (try $try of 4); retrying in $((try * 20)) s" >&2
sleep $((try * 20))
done
echo "error: stapler validate $(basename "$1") failed 4 times" >&2
exit 1
}
# ---- VectorCraft.app ----------------------------------------------------------------------------
echo "==> assembling $APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
@@ -120,8 +135,8 @@ codesign --verify --strict --deep --verbose=2 "$APP"
if [ "$NOTARIZE" = 1 ]; then
ditto -c -k --keepParent "$APP" "$WORK/VectorCraft-notarize.zip"
notarize "$WORK/VectorCraft-notarize.zip"
retry xcrun stapler staple "$APP"
retry xcrun stapler validate "$APP"
xcrun stapler staple "$APP"
validate_stapled "$APP"
spctl --assess --type execute -vvv "$APP"
fi
@@ -170,8 +185,8 @@ fi
hdiutil_retry detach detach "$MOUNT" >/dev/null
if [ "$NOTARIZE" = 1 ]; then
notarize "$DMG"
retry xcrun stapler staple "$DMG"
retry xcrun stapler validate "$DMG"
xcrun stapler staple "$DMG"
validate_stapled "$DMG"
spctl --assess --type open --context context:primary-signature -vvv "$DMG"
fi