# BrowserOS macOS Release Build Configuration (Universal Binary)
#
# This config builds a universal binary (arm64 + x64).
# For single-architecture builds, use --arch flag to override.
#
# Environment Variables:
#   Use !env tag to reference environment variables:
#     Example: chromium_src: !env CHROMIUM_SRC

build:
  type: release
  architecture: universal # Builds both arm64 and x64, then merges

gn_flags:
  file: build/config/gn/flags.macos.release.gn

# Explicit module execution order
modules:
  # Phase 1: Setup
  - clean
  - git_setup
  - sparkle_setup

  # Phase 2: Patches & Resources
  - download_resources
  - bundled_extensions
  - chromium_replace
  - string_replaces
  - series_patches
  - patches

  # Phase 3: Universal Build (full pipeline)
  # This module handles:
  #   - Build arm64 -> sign -> package -> upload
  #   - Build x64 -> sign -> package -> upload
  #   - Merge -> sign universal -> package -> upload
  # Output: 3 DMGs uploaded (arm64, x64, universal)
  - universal_build

  # NOTE: sign_macos, package_macos, upload are now internal to universal_build
  # For single-arch builds, use the standard pipeline with those modules

# Required environment variables
# Note: CHROMIUM_SRC can be provided via --chromium-src CLI flag, YAML config, or env var
required_envs:
  - MACOS_CERTIFICATE_NAME
  - PROD_MACOS_NOTARIZATION_APPLE_ID
  - PROD_MACOS_NOTARIZATION_TEAM_ID
  - PROD_MACOS_NOTARIZATION_PWD

# Notification settings
notifications:
  slack: true
