#!/bin/bash

# EAS Build script for iOS with Robert's Apple Team credentials
# This script uses ASC API Key to authenticate and manage credentials

export EXPO_APPLE_TEAM_ID="UHLZD54ULZ"
export EXPO_APPLE_TEAM_TYPE="INDIVIDUAL"
export EXPO_ASC_KEY_ID="GA9C2GRPHS"
export EXPO_ASC_ISSUER_ID="dcac5647-0710-4764-affd-2d3270bf49d4"
export EXPO_ASC_API_KEY_PATH="$(pwd)/AuthKey_GA9C2GRPHS.p8"

# Optional: Skip Apple login prompt and use existing credentials
# Add --non-interactive if credentials are already set up

echo "Building iOS with Apple Team ID: $EXPO_APPLE_TEAM_ID"
echo "Using ASC API Key: $EXPO_ASC_KEY_ID"
echo ""

# Run the build
npx eas-cli build --platform ios --profile "${1:-production}"
