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
19 changes: 18 additions & 1 deletion .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@ jobs:
COMPONENT="artifacts/AutoPkgWizard-component.pkg"
DIST_XML="artifacts/distribution.xml"

# Verify universal binary
ARCHS=$(lipo -archs "$APP_PATH/Contents/MacOS/AutoPkg Wizard" 2>/dev/null || echo "error")
if [ "$ARCHS" = "error" ]; then
echo "ERROR: Could not read architectures from $APP_PATH" >&2
echo " Binary may be missing or invalid." >&2
exit 1
fi
echo "App architectures: $ARCHS"
if ! echo "$ARCHS" | grep -q "arm64"; then
echo "ERROR: App does not contain arm64 architecture. Found: $ARCHS" >&2
exit 1
fi
if ! echo "$ARCHS" | grep -q "x86_64"; then
echo "ERROR: App does not contain x86_64 architecture. Found: $ARCHS" >&2
exit 1
fi

# Create component package
pkgbuild \
--component "$APP_PATH" \
Expand All @@ -108,7 +125,7 @@ jobs:
<installer-gui-script minSpecVersion="2">
<title>AutoPkg Wizard</title>
<pkg-ref id="com.grahamrpugh.AutoPkg-Wizard"/>
<options customize="never" require-scripts="false" rootVolumeOnly="true"/>
<options customize="never" require-scripts="false" rootVolumeOnly="true" hostArchitectures="arm64,x86_64"/>
<choices-outline>
<line choice="default">
<line choice="com.grahamrpugh.AutoPkg-Wizard"/>
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ jobs:
COMPONENT="artifacts/AutoPkgWizard-component.pkg"
DIST_XML="artifacts/distribution.xml"

# Verify universal binary
ARCHS=$(lipo -archs "$APP_PATH/Contents/MacOS/AutoPkg Wizard" 2>/dev/null || echo "error")
if [ "$ARCHS" = "error" ]; then
echo "ERROR: Could not read architectures from $APP_PATH" >&2
echo " Binary may be missing or invalid." >&2
exit 1
fi
echo "App architectures: $ARCHS"
if ! echo "$ARCHS" | grep -q "arm64"; then
echo "ERROR: App does not contain arm64 architecture. Found: $ARCHS" >&2
exit 1
fi
if ! echo "$ARCHS" | grep -q "x86_64"; then
echo "ERROR: App does not contain x86_64 architecture. Found: $ARCHS" >&2
exit 1
fi

# Create component package
pkgbuild \
--component "$APP_PATH" \
Expand All @@ -102,7 +119,7 @@ jobs:
<installer-gui-script minSpecVersion="2">
<title>AutoPkg Wizard</title>
<pkg-ref id="com.grahamrpugh.AutoPkg-Wizard"/>
<options customize="never" require-scripts="false" rootVolumeOnly="true"/>
<options customize="never" require-scripts="false" rootVolumeOnly="true" hostArchitectures="arm64,x86_64"/>
<choices-outline>
<line choice="default">
<line choice="com.grahamrpugh.AutoPkg-Wizard"/>
Expand Down
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,23 @@ github:
# --- Internal: create the .pkg ---------------------------------------------
_pkg:
@mkdir -p "$(OUTPUT_DIR)"
@echo "==> Verifying app is universal binary…"
@ARCHS=$$(lipo -archs "$(RELEASE_APP)/Contents/MacOS/AutoPkg Wizard" 2>/dev/null || echo "error"); \
if [ "$$ARCHS" = "error" ]; then \
echo "ERROR: Could not read architectures from $(RELEASE_APP)" >&2; \
exit 1; \
fi; \
if ! echo "$$ARCHS" | grep -q "arm64"; then \
echo "ERROR: App does not contain arm64 architecture. Found: $$ARCHS" >&2; \
echo " Run 'make release' to build a universal binary first." >&2; \
exit 1; \
fi; \
if ! echo "$$ARCHS" | grep -q "x86_64"; then \
echo "ERROR: App does not contain x86_64 architecture. Found: $$ARCHS" >&2; \
echo " Run 'make release' to build a universal binary first." >&2; \
exit 1; \
fi; \
echo " ✓ Verified universal binary: $$ARCHS"
@echo "==> Creating component package…"
@pkgbuild \
--component "$(RELEASE_APP)" \
Expand All @@ -291,7 +308,7 @@ _pkg:
echo '<installer-gui-script minSpecVersion="2">'; \
echo ' <title>$(APP_NAME)</title>'; \
echo ' <pkg-ref id="$(BUNDLE_ID)"/>'; \
echo ' <options customize="never" require-scripts="false" rootVolumeOnly="true"/>'; \
echo ' <options customize="never" require-scripts="false" rootVolumeOnly="true" hostArchitectures="arm64,x86_64"/>'; \
echo ' <choices-outline>'; \
echo ' <line choice="default">'; \
echo ' <line choice="$(BUNDLE_ID)"/>'; \
Expand Down
Loading