chore: versionado por variables, fix bug .p8 en script de upload y .gitignore
- Info.plist (app + widget): CFBundleShortVersionString -> $(MARKETING_VERSION), CFBundleVersion -> $(CURRENT_PROJECT_VERSION). Antes estaban hardcodeados, lo que obligaba a editar 3 sitios por release y causó el rebote de build (subía 41). - archive_and_upload_appstore.sh: find_p8_file ahora asigna la variable global P8_PATH en vez de devolverla por $(...); el trap EXIT que limpia el .p8 temporal ya no corre en un subshell, así que el fichero sobrevive hasta el upload (antes xcodebuild fallaba en -exportArchive con "-authenticationKeyPath ... existing file"). - .gitignore nuevo: build artifacts, credenciales (.p8/.mobileprovision), basura macOS y documentos personales. Destrackeados .DS_Store y UserInterfaceState.xcuserstate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015qUZrBusG82T37R7PeokqJ
This commit is contained in:
@@ -33,37 +33,41 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Resuelve la clave .p8 y la deja en la variable global P8_PATH.
|
||||
# IMPORTANTE: NO llamar con $(find_p8_file). El fichero temporal extraído de pass se
|
||||
# limpia con un `trap EXIT`; si la función corre dentro de un subshell de sustitución
|
||||
# de comandos, ese trap se dispara al cerrarse el subshell y borra el .p8 ANTES del
|
||||
# export (xcodebuild fallaba con "-authenticationKeyPath ... existing file").
|
||||
find_p8_file() {
|
||||
# 1. Variable de entorno explícita
|
||||
if [[ -n "$P8_PATH" ]]; then
|
||||
[[ -f "$P8_PATH" ]] || fail "No existe el fichero APPSTORE_P8_PATH=$P8_PATH"
|
||||
echo "$P8_PATH"
|
||||
return
|
||||
fi
|
||||
|
||||
# 2. Extraer de pass y escribir en fichero temporal
|
||||
# 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)"
|
||||
pass show appstore/api-key-p8 > "$tmp_p8"
|
||||
chmod 600 "$tmp_p8"
|
||||
# Registrar para limpieza al salir
|
||||
# Registrar para limpieza al salir del script (trap en el shell principal).
|
||||
trap "rm -f '$tmp_p8'" EXIT
|
||||
echo "$tmp_p8"
|
||||
P8_PATH="$tmp_p8"
|
||||
return
|
||||
fi
|
||||
|
||||
# 3. Fichero por defecto en HOME
|
||||
local default_path="$HOME/AuthKey_${KEY_ID}.p8"
|
||||
if [[ -f "$default_path" ]]; then
|
||||
echo "$default_path"
|
||||
P8_PATH="$default_path"
|
||||
return
|
||||
fi
|
||||
|
||||
# 4. Único .p8 en HOME
|
||||
local matches=("${HOME}"/*.p8(N))
|
||||
if (( ${#matches[@]} == 1 )); then
|
||||
echo "${matches[1]}"
|
||||
P8_PATH="${matches[1]}"
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -143,7 +147,7 @@ main() {
|
||||
command -v xcodebuild >/dev/null 2>&1 || fail "xcodebuild no esta disponible"
|
||||
command -v xcrun >/dev/null 2>&1 || fail "xcrun no esta disponible"
|
||||
|
||||
P8_PATH="$(find_p8_file)"
|
||||
find_p8_file # asigna P8_PATH; NO usar $(...) o el trap del subshell borra el .p8
|
||||
P8_DIR="$(dirname "$P8_PATH")"
|
||||
|
||||
echo "Usando proyecto: $PROJECT_PATH"
|
||||
|
||||
Reference in New Issue
Block a user