mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-22 19:08:51 +00:00
Release: retry stapling and its validation on macOS (#164)
Apple's notarization ticket service dropped the connection in two release runs in a row (once while validating the stapled DMG, once while stapling), failing the macOS job after a successful build, signing and notarization. Stapling and its validation now try up to five times, 15 s apart.
This commit is contained in:
1 parent
c7771c7bb7
commit
c5830e4683
3 files changed
+16
-5
No files matched your search
@@ -62,6 +62,17 @@ smoke_bin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Emit a GitHub Actions warning (plain stderr outside Actions).
|
# Emit a GitHub Actions warning (plain stderr outside Actions).
|
||||||
|
# Run a command up to five times, 15 s apart: for steps that ask a remote service (Apple's
|
||||||
|
# notarization ticket service drops connections now and then).
|
||||||
|
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() {
|
warn() {
|
||||||
if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
|
if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ codesign --verify --strict --deep --verbose=2 "$APP"
|
|||||||
if [ "$NOTARIZE" = 1 ]; then
|
if [ "$NOTARIZE" = 1 ]; then
|
||||||
ditto -c -k --keepParent "$APP" "$WORK/FigCraft-notarize.zip"
|
ditto -c -k --keepParent "$APP" "$WORK/FigCraft-notarize.zip"
|
||||||
notarize "$WORK/FigCraft-notarize.zip"
|
notarize "$WORK/FigCraft-notarize.zip"
|
||||||
xcrun stapler staple "$APP"
|
retry xcrun stapler staple "$APP"
|
||||||
xcrun stapler validate "$APP"
|
retry xcrun stapler validate "$APP"
|
||||||
spctl --assess --type execute -vvv "$APP"
|
spctl --assess --type execute -vvv "$APP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -156,8 +156,8 @@ sign "$DMG"
|
|||||||
codesign --verify --strict --verbose=2 "$DMG"
|
codesign --verify --strict --verbose=2 "$DMG"
|
||||||
if [ "$NOTARIZE" = 1 ]; then
|
if [ "$NOTARIZE" = 1 ]; then
|
||||||
notarize "$DMG"
|
notarize "$DMG"
|
||||||
xcrun stapler staple "$DMG"
|
retry xcrun stapler staple "$DMG"
|
||||||
xcrun stapler validate "$DMG"
|
retry xcrun stapler validate "$DMG"
|
||||||
spctl --assess --type open --context context:primary-signature -vvv "$DMG"
|
spctl --assess --type open --context context:primary-signature -vvv "$DMG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ fi
|
|||||||
echo "==> $(basename "$DMG")"
|
echo "==> $(basename "$DMG")"
|
||||||
codesign --verify --strict --verbose=2 "$DMG"
|
codesign --verify --strict --verbose=2 "$DMG"
|
||||||
if [ "$STRICT" = 1 ]; then
|
if [ "$STRICT" = 1 ]; then
|
||||||
xcrun stapler validate "$DMG" || fail "no notarization ticket stapled to the DMG"
|
retry xcrun stapler validate "$DMG" || fail "no notarization ticket stapled to the DMG"
|
||||||
assess --assess --type open --context context:primary-signature -vv "$DMG" \
|
assess --assess --type open --context context:primary-signature -vv "$DMG" \
|
||||||
|| fail "Gatekeeper rejects the DMG"
|
|| fail "Gatekeeper rejects the DMG"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user