Repository Public
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : MacLustr Vision iOS8# File : Scripts/release.sh9# Description : Archive de publication, export de l'IPA (signature10# automatique, clé d'équipe App Store Connect déjà sur ce11# Mac), envoi TestFlight. usage : release.sh archive |12# export | upload | all (incrémenter CURRENT_PROJECT_VERSION13# avant chaque envoi)14# Module : Scripts15# Repository : https://git.spboucher.ai/maclustr-vision-ios16# Project Website : https://camera.spboucher.ai17# Created : 2026-11-3018# Last Modified : 2026-11-3019#20# Author : Simon-Pierre Boucher21# Position : Professor of Finance22# Institution : Université du Québec en Outaouais (UQO)23# Organization : SP Boucher24# Website : https://spboucher.ai25# Git : https://git.spboucher.ai26#27# Preferred Contact: admin@spboucher.ai28# Technical Contact: dev@spboucher.ai29# Security/Admin : admin@spboucher.ai30#31# Copyright (c) 202632# Simon-Pierre Boucher33# All rights reserved where applicable. This file is governed by the34# applicable project license, copyright notices and relevant law.35# Existing third-party rights and notices remain unaffected.36#37# License : None specified (no license file in this repository)38#39# Do not embed credentials, private keys, access tokens,40# certificates or confidential personal information.41#42# =============================================================================43# END OF SP BOUCHER SOURCE HEADER44# =============================================================================4546set -euo pipefail47cd "$(dirname "$0")/.."48export PATH="/opt/homebrew/bin:$PATH"49KEY_ID="${ASC_KEY_ID:-L379BDKR69}"50ISSUER="${ASC_ISSUER_ID:-013e761f-e05c-4d93-a50b-f3d960adae4a}"51KEY="$HOME/.appstoreconnect/private_keys/AuthKey_${KEY_ID}.p8"52AUTH=(-allowProvisioningUpdates -authenticationKeyPath "$KEY" -authenticationKeyID "$KEY_ID" -authenticationKeyIssuerID "$ISSUER")53ARCHIVE="build/MacLustrVision.xcarchive"54mkdir -p build/logs dist55step="${1:-all}"5657if [[ "$step" == archive || "$step" == all ]]; then58 xcodegen generate >/dev/null59 rm -rf "$ARCHIVE"60 xcodebuild -project MacLustrVision.xcodeproj -scheme MacLustrVision -configuration Release -destination "generic/platform=iOS" \61 -archivePath "$ARCHIVE" -derivedDataPath build/DerivedData-release "${AUTH[@]}" archive > build/logs/archive.log 2>&1 \62 || { grep -E "error:|\*\* " build/logs/archive.log | sort -u | head -20; exit 1; }63 APP="$ARCHIVE/Products/Applications/MacLustrVision.app"64 echo "archive : $(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Info.plist") ($(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$APP/Info.plist"))"65fi6667if [[ "$step" == export || "$step" == all ]]; then68 rm -rf dist/export69 xcodebuild -exportArchive -archivePath "$ARCHIVE" -exportOptionsPlist Scripts/ExportOptions.plist -exportPath dist/export "${AUTH[@]}" > build/logs/export.log 2>&1 \70 || { grep -E "error:|\*\* " build/logs/export.log | sort -u | head -20; exit 1; }71 ls -lh dist/export/*.ipa72fi7374if [[ "$step" == upload || "$step" == all ]]; then75 xcrun altool --upload-app -f dist/export/*.ipa -t ios --apiKey "$KEY_ID" --apiIssuer "$ISSUER" 2>&1 | tee build/logs/upload.log | tail -876fi77