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:
+30
@@ -0,0 +1,30 @@
|
|||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Xcode / build artifacts
|
||||||
|
build/
|
||||||
|
DerivedData/
|
||||||
|
*.xcarchive
|
||||||
|
*.ipa
|
||||||
|
*.dSYM
|
||||||
|
*.dSYM.zip
|
||||||
|
*.xcuserstate
|
||||||
|
xcuserdata/
|
||||||
|
|
||||||
|
# Signing / credentials (no versionar)
|
||||||
|
*.mobileprovision
|
||||||
|
*.p8
|
||||||
|
*.p12
|
||||||
|
*.cer
|
||||||
|
ExportOptions.plist
|
||||||
|
|
||||||
|
# fastlane generated
|
||||||
|
fastlane/report.xml
|
||||||
|
fastlane/README.md
|
||||||
|
fastlane/Preview.html
|
||||||
|
fastlane/test_output/
|
||||||
|
|
||||||
|
# Documentos personales / binarios que no son del proyecto
|
||||||
|
Justificante_*.pdf
|
||||||
|
*.pkg
|
||||||
|
og-image.png
|
||||||
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -17,7 +17,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.4.1</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>42</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>GADApplicationIdentifier</key>
|
<key>GADApplicationIdentifier</key>
|
||||||
<string>ca-app-pub-1549720748100858~9632507420</string>
|
<string>ca-app-pub-1549720748100858~9632507420</string>
|
||||||
<key>GADDelayAppMeasurementInit</key>
|
<key>GADDelayAppMeasurementInit</key>
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.4.1</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>42</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
|
|||||||
@@ -33,37 +33,41 @@ fail() {
|
|||||||
exit 1
|
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() {
|
find_p8_file() {
|
||||||
# 1. Variable de entorno explícita
|
# 1. Variable de entorno explícita
|
||||||
if [[ -n "$P8_PATH" ]]; then
|
if [[ -n "$P8_PATH" ]]; then
|
||||||
[[ -f "$P8_PATH" ]] || fail "No existe el fichero APPSTORE_P8_PATH=$P8_PATH"
|
[[ -f "$P8_PATH" ]] || fail "No existe el fichero APPSTORE_P8_PATH=$P8_PATH"
|
||||||
echo "$P8_PATH"
|
|
||||||
return
|
return
|
||||||
fi
|
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
|
if command -v pass >/dev/null 2>&1 && pass show appstore/api-key-p8 &>/dev/null; then
|
||||||
local tmp_p8
|
local tmp_p8
|
||||||
tmp_p8="$(mktemp /tmp/AuthKey_XXXXXX.p8)"
|
tmp_p8="$(mktemp /tmp/AuthKey_XXXXXX.p8)"
|
||||||
pass show appstore/api-key-p8 > "$tmp_p8"
|
pass show appstore/api-key-p8 > "$tmp_p8"
|
||||||
chmod 600 "$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
|
trap "rm -f '$tmp_p8'" EXIT
|
||||||
echo "$tmp_p8"
|
P8_PATH="$tmp_p8"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3. Fichero por defecto en HOME
|
# 3. Fichero por defecto en HOME
|
||||||
local default_path="$HOME/AuthKey_${KEY_ID}.p8"
|
local default_path="$HOME/AuthKey_${KEY_ID}.p8"
|
||||||
if [[ -f "$default_path" ]]; then
|
if [[ -f "$default_path" ]]; then
|
||||||
echo "$default_path"
|
P8_PATH="$default_path"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 4. Único .p8 en HOME
|
# 4. Único .p8 en HOME
|
||||||
local matches=("${HOME}"/*.p8(N))
|
local matches=("${HOME}"/*.p8(N))
|
||||||
if (( ${#matches[@]} == 1 )); then
|
if (( ${#matches[@]} == 1 )); then
|
||||||
echo "${matches[1]}"
|
P8_PATH="${matches[1]}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -143,7 +147,7 @@ main() {
|
|||||||
command -v xcodebuild >/dev/null 2>&1 || fail "xcodebuild no esta disponible"
|
command -v xcodebuild >/dev/null 2>&1 || fail "xcodebuild no esta disponible"
|
||||||
command -v xcrun >/dev/null 2>&1 || fail "xcrun 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")"
|
P8_DIR="$(dirname "$P8_PATH")"
|
||||||
|
|
||||||
echo "Usando proyecto: $PROJECT_PATH"
|
echo "Usando proyecto: $PROJECT_PATH"
|
||||||
|
|||||||
Reference in New Issue
Block a user