Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions script/package_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,29 @@ fi
echo "Creating dmg..."
rm -rf "$DMG_STAGING"
mkdir -p "$DMG_STAGING"
cp -R "$APP_BUNDLE" "$DMG_STAGING/"
ditto "$APP_BUNDLE" "$DMG_STAGING/$APP_NAME.app"
ln -s /Applications "$DMG_STAGING/Applications"
hdiutil create \
-volname "$APP_NAME" \
-srcfolder "$DMG_STAGING" \
-ov \
-format UDZO \
"$DMG_PATH"

DMG_CREATED=false
for attempt in 1 2 3; do
rm -f "$DMG_PATH"
if hdiutil create \
-volname "$APP_NAME" \
-srcfolder "$DMG_STAGING" \
-ov \
-format UDZO \
"$DMG_PATH"; then
DMG_CREATED=true
break
fi
echo "DMG creation attempt $attempt failed; retrying..." >&2
sleep $((attempt * 3))
done

if [[ "$DMG_CREATED" != true ]]; then
echo "DMG creation failed after 3 attempts." >&2
exit 1
fi
echo "Signing dmg with Developer ID..."
codesign --force --timestamp --sign "$IDENTITY" "$DMG_PATH"
codesign --verify --verbose=2 "$DMG_PATH"
Expand Down
Loading