Fix script upload App Store: .p8 en ruta fija (mktemp roto) + ExportOptions firma manual con 3 perfiles

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZFmGhbWzibhApev3C4554
This commit is contained in:
alexandrev-tibco
2026-07-20 21:20:43 +02:00
parent 1e6e3ef361
commit 2a5ffca48f
+20 -3
View File
@@ -47,8 +47,11 @@ find_p8_file() {
# 2. Extraer de pass y escribir en fichero temporal (limpieza al salir del script)
if command -v pass >/dev/null 2>&1 && pass show appstore/api-key-p8 &>/dev/null; then
local tmp_p8
tmp_p8="$(mktemp /tmp/AuthKey_XXXXXX.p8)"
# OJO: macOS `mktemp` solo sustituye las X si están al FINAL del patrón; con
# `AuthKey_XXXXXX.p8` deja el nombre literal y xcodebuild no encuentra el fichero.
# Además `altool` exige que la key se llame AuthKey_<KEY_ID>.p8 dentro de
# API_PRIVATE_KEYS_DIR, así que usamos ese nombre fijo directamente.
local tmp_p8="/tmp/AuthKey_${KEY_ID}.p8"
pass show appstore/api-key-p8 > "$tmp_p8"
chmod 600 "$tmp_p8"
# Registrar para limpieza al salir del script (trap en el shell principal).
@@ -91,8 +94,22 @@ create_export_options() {
<false/>
<key>method</key>
<string>app-store-connect</string>
<!-- Firma MANUAL obligatoria: el cloud signing con API key falla al exportar la
extensión QuickUpdate ("No profiles ... were found"). Los 3 targets se firman
con "Apple Distribution" + sus perfiles App Store instalados localmente. -->
<key>signingStyle</key>
<string>automatic</string>
<string>manual</string>
<key>signingCertificate</key>
<string>Apple Distribution</string>
<key>provisioningProfiles</key>
<dict>
<key>com.alexandrevazquez.PortfolioJournal</key>
<string>porfoliojournal</string>
<key>com.alexandrevazquez.PortfolioJournal.PortfolioJournalWidget</key>
<string>Portfolio Journalwidget</string>
<key>com.alexandrevazquez.PortfolioJournal.QuickUpdate</key>
<string>PortfolioJournal QuickUpdate AppStore</string>
</dict>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>