SPB Git

Repository Public

release.sh 3.2 KB 47 lines shellscript

1#!/usr/bin/env bash2# VQuant iOS3# File: Scripts/release.sh4# Description: iOS distribution: Release archive signed by Xcode's automatic signing (Apple ID account of this Mac —5#              required because the app has an App Group), IPA export for App Store Connect, validation, and upload to6#              TestFlight on request. iOS apps are code-signed and provisioned; there is no notarization step.7#              usage: release.sh archive | export | validate | upload | device8#9# Author: Simon-Pierre Boucher10# Contact: contact@spboucher.ai11set -euo pipefail12cd "$(dirname "$0")/.."13KEY_ID="${ASC_KEY_ID:-L379BDKR69}"14ISSUER="${ASC_ISSUER_ID:-013e761f-e05c-4d93-a50b-f3d960adae4a}"15ARCHIVE="build/VQuant.xcarchive"16mkdir -p build/logs dist17step="${1:-archive}"18fail() { grep -E "error:|\*\* " "$1" | sed "s|$PWD/||" | sort -u | head -20; exit 1; }1920case "$step" in21  archive)22    Scripts/build.sh generate23    rm -rf "$ARCHIVE"24    xcodebuild -project VQuant.xcodeproj -scheme VQuant -configuration Release -destination "generic/platform=iOS" \25      -archivePath "$ARCHIVE" -derivedDataPath build/DerivedData-release -allowProvisioningUpdates archive > build/logs/archive.log 2>&1 || fail build/logs/archive.log26    APP="$ARCHIVE/Products/Applications/VQuant.app"27    echo "archive : $(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Info.plist") ($(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$APP/Info.plist"))"28    codesign -dv "$APP" 2>&1 | grep -E "Identifier|TeamIdentifier|Authority" | head -429    codesign -d --entitlements :- "$APP" 2>/dev/null | plutil -p - | grep -E "associated-domains|application-groups|application-identifier|aps-environment|get-task-allow" -A2 | head -20 ;;30  export)31    rm -rf dist/export32    xcodebuild -exportArchive -archivePath "$ARCHIVE" -exportOptionsPlist Scripts/ExportOptions.plist -exportPath dist/export -allowProvisioningUpdates \33      -authenticationKeyPath "$HOME/.appstoreconnect/private_keys/AuthKey_${KEY_ID}.p8" -authenticationKeyID "$KEY_ID" -authenticationKeyIssuerID "$ISSUER" > build/logs/export.log 2>&1 || fail build/logs/export.log34    ls -lh dist/export/*.ipa ;;35  validate)36    xcrun altool --validate-app -f dist/export/VQuant.ipa -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/validate.log | tail -8 ;;37  upload)38    # Publishes the build to App Store Connect (TestFlight). Run only when asked to: it is an outward-facing action.39    xcrun altool --upload-app -f dist/export/VQuant.ipa -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/upload.log | tail -15 ;;40  device)41    # Development build installed on a connected iPhone / iPad: release.sh device <device name or UDID>42    DEV="${2:?usage: release.sh device <nom ou UDID>}"43    xcodebuild -project VQuant.xcodeproj -scheme VQuant -configuration Debug -destination "platform=iOS,name=$DEV" -derivedDataPath build/DerivedData-device -allowProvisioningUpdates build > build/logs/device.log 2>&1 || fail build/logs/device.log44    xcrun devicectl device install app --device "$DEV" build/DerivedData-device/Build/Products/Debug-iphoneos/VQuant.app | tail -3 ;;45  *) echo "usage: release.sh archive|export|validate|upload|device"; exit 2 ;;46esac47
Files main
Menu

Theme