SPB Git

Repository Public

release-ios.sh 2.2 KB 38 lines shellscript

1#!/usr/bin/env bash2# Author: Simon-Pierre Boucher — contact@spboucher.ai3# File: Scripts/release-ios.sh4# Description: Release archive of Local Chat for iOS / iPadOS with automatic App Store signing (team API key already on this Mac), IPA export, optional TestFlight upload.5# Usage: Scripts/release-ios.sh archive | export | upload | all      ("all" = archive + export; upload is always explicit)6set -euo pipefail7cd "$(dirname "$0")/.."8KEY_ID="${ASC_KEY_ID:-L379BDKR69}"9ISSUER="${ASC_ISSUER_ID:-013e761f-e05c-4d93-a50b-f3d960adae4a}"10KEY="$HOME/.appstoreconnect/private_keys/AuthKey_${KEY_ID}.p8"11AUTH=(-allowProvisioningUpdates -authenticationKeyPath "$KEY" -authenticationKeyID "$KEY_ID" -authenticationKeyIssuerID "$ISSUER")12ARCHIVE="build/LocalChatIOS.xcarchive"13mkdir -p build/logs dist14step="${1:-all}"1516if [[ "$step" == archive || "$step" == all ]]; then17  xcodegen generate --quiet18  rm -rf "$ARCHIVE"19  xcodebuild -workspace LocalChat.xcworkspace -scheme LocalChatIOS -configuration Release -destination "generic/platform=iOS" \20    -archivePath "$ARCHIVE" -derivedDataPath build/DD-ios-release -skipMacroValidation -skipPackagePluginValidation "${AUTH[@]}" archive > build/logs/archive-ios.log 2>&1 \21    || { grep -E "error:|\*\* " build/logs/archive-ios.log | sort -u | head -20; exit 1; }22  APP="$ARCHIVE/Products/Applications/LocalChat.app"23  echo "archive : $(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Info.plist") ($(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$APP/Info.plist"))"24  codesign -d --entitlements - "$APP" 2>/dev/null | grep -E "increased-memory-limit|extended-virtual" | sed 's/^[[:space:]]*/entitlement: /' || true25fi2627if [[ "$step" == export || "$step" == all ]]; then28  rm -rf dist/export-ios29  xcodebuild -exportArchive -archivePath "$ARCHIVE" -exportOptionsPlist Scripts/ExportOptions.plist -exportPath dist/export-ios "${AUTH[@]}" > build/logs/export-ios.log 2>&1 \30    || { grep -E "error:|\*\* " build/logs/export-ios.log | sort -u | head -20; exit 1; }31  ls -lh dist/export-ios/*.ipa32fi3334if [[ "$step" == upload ]]; then35  IPA="$(ls dist/export-ios/*.ipa | head -1)"36  xcrun altool --upload-app -f "$IPA" -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/upload-ios.log | tail -1537fi38
Files main
Menu

Theme