Files
hash-wallet/scripts/ios/app_env.sh
T
jwinterm a1b3add2a6 iOS: source CAKEWALLET build number from pubspec_description.yaml
Bumping version in pubspec_description.yaml has had zero effect on
the iOS CFBundleVersion: app_env.sh hardcoded CAKEWALLET_BUILD_NUMBER=1,
app_config.sh substituted that literal into Info.plist's
\$(CURRENT_PROJECT_VERSION) placeholder via PlistBuddy before flutter
even saw it, and every TestFlight upload shipped as build 1 regardless
of what we bumped in pubspec. Apple rejected the +4 and +5 IPAs as
duplicates of the +3 that got through as build 1.

Make pubspec_description.yaml the single source of truth by parsing
its `version: X.Y.Z+N` line in app_env.sh.
2026-06-03 08:02:55 -04:00

62 lines
1.6 KiB
Bash

#!/bin/sh
APP_IOS_NAME=""
APP_IOS_VERSION=""
APP_IOS_BUILD_VERSION=""
APP_IOS_BUNDLE_ID=""
MONERO_COM="monero.com"
CAKEWALLET="cakewallet"
TYPES=($MONERO_COM $CAKEWALLET)
APP_IOS_TYPE=$1
MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="6.1.2"
MONERO_COM_BUILD_NUMBER=163
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
# Source CAKEWALLET version + build number from pubspec_description.yaml
# (single source of truth). Without this, the hardcoded build number
# here silently overrode pubspec via app_config.sh's PlistBuddy step,
# so iOS uploads all shipped as the same CFBundleVersion and Apple
# rejected duplicates.
_PUBSPEC_VERSION=$(awk -F': ' '/^version:/ {print $2; exit}' ../../pubspec_description.yaml)
CAKEWALLET_NAME="Hash Bags"
CAKEWALLET_VERSION="${_PUBSPEC_VERSION%+*}"
CAKEWALLET_BUILD_NUMBER="${_PUBSPEC_VERSION#*+}"
CAKEWALLET_BUNDLE_ID="com.suchsoftware.hashwallet"
if ! [[ " ${TYPES[*]} " =~ " ${APP_IOS_TYPE} " ]]; then
echo "Wrong app type."
exit 1
fi
case $APP_IOS_TYPE in
$MONERO_COM)
APP_IOS_NAME=$MONERO_COM_NAME
APP_IOS_VERSION=$MONERO_COM_VERSION
APP_IOS_BUILD_NUMBER=$MONERO_COM_BUILD_NUMBER
APP_IOS_BUNDLE_ID=$MONERO_COM_BUNDLE_ID
;;
$CAKEWALLET)
APP_IOS_NAME=$CAKEWALLET_NAME
APP_IOS_VERSION=$CAKEWALLET_VERSION
APP_IOS_BUILD_NUMBER=$CAKEWALLET_BUILD_NUMBER
APP_IOS_BUNDLE_ID=$CAKEWALLET_BUNDLE_ID
;;
$HAVEN)
APP_IOS_NAME=$HAVEN_NAME
APP_IOS_VERSION=$HAVEN_VERSION
APP_IOS_BUILD_NUMBER=$HAVEN_BUILD_NUMBER
APP_IOS_BUNDLE_ID=$HAVEN_BUNDLE_ID
;;
esac
export APP_IOS_TYPE
export APP_IOS_NAME
export APP_IOS_VERSION
export APP_IOS_BUILD_NUMBER
export APP_IOS_BUNDLE_ID