Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Sources/oab-instance-mcp/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CoreGraphics
import Foundation
import InstanceMCPCore

let version = "0.6.0"
let version = "0.6.1"

struct Options {
var host = "127.0.0.1"
Expand Down
4 changes: 2 additions & 2 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ lipo -create /tmp/imcp-arm64/release/oab-instance-mcp \
/tmp/imcp-x86_64/release/oab-instance-mcp \
-output /tmp/oab-instance-mcp
chmod +x /tmp/oab-instance-mcp
scripts/assemble-app.sh /tmp/oab-instance-mcp /tmp/oab-instance-mcp.app 0.6.0
ALLOW_UNSIGNED=1 scripts/package-pkg.sh /tmp/oab-instance-mcp.app /tmp/oab-instance-mcp.pkg 0.6.0
scripts/assemble-app.sh /tmp/oab-instance-mcp /tmp/oab-instance-mcp.app 0.6.1
ALLOW_UNSIGNED=1 scripts/package-pkg.sh /tmp/oab-instance-mcp.app /tmp/oab-instance-mcp.pkg 0.6.1
```

Unsigned artifacts are testing inputs only; do not install or publish them.
10 changes: 10 additions & 0 deletions scripts/package-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,25 @@ TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
PAYLOAD="$TMP/payload"
SCRIPTS="$TMP/scripts"
COMPONENTS="$TMP/components.plist"
mkdir -p "$PAYLOAD/Library/Application Support/OpenAB/instance-mcp" "$SCRIPTS" "$(dirname "$OUT")"
/usr/bin/ditto "$APP" "$PAYLOAD/Library/Application Support/OpenAB/instance-mcp/oab-instance-mcp.app"
cp "$ROOT/scripts/install-prebuilt.sh" "$SCRIPTS/install-prebuilt.sh"
cp "$ROOT/scripts/pkg/postinstall" "$SCRIPTS/postinstall"
chmod 755 "$SCRIPTS/install-prebuilt.sh" "$SCRIPTS/postinstall"

# Without an explicit component property list, pkgbuild marks the nested .app as
# relocatable. PackageKit then sees an existing copy under ~/.local and moves the
# payload there instead of /Library/Application Support; postinstall cannot find
# its source and fails. Pin the payload path — install-prebuilt performs the
# intentional per-user copy after dropping root.
/usr/bin/pkgbuild --analyze --root "$PAYLOAD" "$COMPONENTS" >/dev/null
/usr/libexec/PlistBuddy -c 'Set :0:BundleIsRelocatable false' "$COMPONENTS"

ARGS=(
--root "$PAYLOAD"
--scripts "$SCRIPTS"
--component-plist "$COMPONENTS"
--identifier "$IDENTIFIER"
--version "$VERSION"
--install-location /
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ EXPANDED="$TMP/expanded"
/usr/sbin/pkgutil --expand "$PKG" "$EXPANDED"
[ -x "$EXPANDED/Scripts/postinstall" ]
[ -x "$EXPANDED/Scripts/install-prebuilt.sh" ]
# A bundle listed under <relocate> is moved to any existing matching bundle on
# the target Mac; then postinstall's payload path vanishes (the first v0.6.0
# install failed exactly this way). The explicit component plist must remove it.
if /usr/bin/sed -n '/<relocate>/,/<\/relocate>/p' "$EXPANDED/PackageInfo" | /usr/bin/grep -q '<bundle'; then
echo "packaging test: app is still marked relocatable" >&2
exit 1
fi
/bin/bash -n "$EXPANDED/Scripts/postinstall"
/bin/bash -n "$EXPANDED/Scripts/install-prebuilt.sh"

Expand Down
Loading