diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml index 408d124..162e476 100644 --- a/.github/workflows/build_main.yml +++ b/.github/workflows/build_main.yml @@ -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" \ @@ -108,7 +125,7 @@ jobs: AutoPkg Wizard - + diff --git a/.github/workflows/build_pr.yml b/.github/workflows/build_pr.yml index 3b9ccc8..14bc9d7 100644 --- a/.github/workflows/build_pr.yml +++ b/.github/workflows/build_pr.yml @@ -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" \ @@ -102,7 +119,7 @@ jobs: AutoPkg Wizard - + diff --git a/Makefile b/Makefile index 5ca378f..e26e433 100644 --- a/Makefile +++ b/Makefile @@ -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)" \ @@ -291,7 +308,7 @@ _pkg: echo ''; \ echo ' $(APP_NAME)'; \ echo ' '; \ - echo ' '; \ + echo ' '; \ echo ' '; \ echo ' '; \ echo ' '; \