SPB Git

Repository Public License

release.sh 2.3 KB 46 lines shellscript

1#!/usr/bin/env bash2# ORIX Arcade3# File: Scripts/release.sh4# Description: Release archive, App Store Connect export (automatic signing with the team API key on this Mac) and, only on explicit request, TestFlight upload.5#              usage: release.sh archive | export | validate | upload6#7# Author: Simon-Pierre Boucher8# Contact: contact@spboucher.ai9set -euo pipefail10cd "$(dirname "$0")/.."11KEY_ID="${ASC_KEY_ID:-L379BDKR69}"12ISSUER="${ASC_ISSUER_ID:-013e761f-e05c-4d93-a50b-f3d960adae4a}"13KEY="$HOME/.appstoreconnect/private_keys/AuthKey_${KEY_ID}.p8"14AUTH=(-allowProvisioningUpdates -authenticationKeyPath "$KEY" -authenticationKeyID "$KEY_ID" -authenticationKeyIssuerID "$ISSUER")15ARCHIVE="build/ORIXArcade.xcarchive"16IPA="dist/export/ORIXArcade.ipa"17mkdir -p build/logs dist18step="${1:?usage: release.sh archive | export | validate | upload}"1920case "$step" in21archive)22  xcodegen generate --quiet23  rm -rf "$ARCHIVE"24  xcodebuild -project ORIXArcade.xcodeproj -scheme ORIXArcade -configuration Release -destination "generic/platform=iOS" \25    -archivePath "$ARCHIVE" -derivedDataPath build/DerivedData-release "${AUTH[@]}" archive > build/logs/archive.log 2>&1 \26    || { grep -E "error:|\*\* " build/logs/archive.log | sort -u | head -20; exit 1; }27  APP="$ARCHIVE/Products/Applications/ORIXArcade.app"28  echo "archive: $(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Info.plist") ($(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$APP/Info.plist"))"29  ;;30export)31  rm -rf dist/export32  xcodebuild -exportArchive -archivePath "$ARCHIVE" -exportOptionsPlist Scripts/ExportOptions.plist -exportPath dist/export "${AUTH[@]}" > build/logs/export.log 2>&1 \33    || { grep -E "error:|\*\* " build/logs/export.log | sort -u | head -20; exit 1; }34  ls -lh dist/export/*.ipa35  ;;36validate)37  # Validation needs the app record to exist in App Store Connect; it uploads nothing.38  xcrun altool --validate-app -f "$IPA" -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/validate.log | tail -1539  ;;40upload)41  # Uploads the exported build to App Store Connect (TestFlight).42  xcrun altool --upload-app -f "$IPA" -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/upload.log | tail -1543  ;;44*) echo "unknown step: $step"; exit 2 ;;45esac46
Files main
Menu

Theme