Skip to content

Commit

Permalink
Merge pull request #195 from yssk22/develop
Browse files Browse the repository at this point in the history
[expo] app store submission fix
  • Loading branch information
yssk22 authored Dec 23, 2024
2 parents 8f59050 + 6721ee8 commit f0ea792
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/eas-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ jobs:
if: ${{ matrix.target != 'dev' }}
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secret.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
17 changes: 4 additions & 13 deletions expo/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,18 @@ module.exports = (_) => {
config.splash.image = path.join('config', cfgName, 'splash.png');

const isEAS = process.env.EAS_BUILD === 'true';
const easEnvvarPrefix = cfgName.toUpperCase() + '_';
const iosGoogleServicesFilePath = isEAS
? process.env[easEnvvarPrefix + 'GOOGLE_SERVICES_INFO_PLIST']
: path.join('config', cfgName, 'GoogleService-Info.plist');
const androidGoogleServicesFilePath = isEAS
? process.env[easEnvvarPrefix + 'GOOGLE_SERVICES_JSON']
: path.join('config', cfgName, 'google-services.json');
const iosGoogleServicesFilePath = path.join('config', cfgName, 'GoogleService-Info.plist');
const androidGoogleServicesFilePath = path.join('config', cfgName, 'google-services.json');

if (fs.existsSync(iosGoogleServicesFilePath)) {
config.ios.googleServicesFile = iosGoogleServicesFilePath;
} else {
if (isEAS) {
throw new Error('GoogleService-Info.plist file does not found in ' + iosGoogleServicesFilePath);
}
throw new Error('GoogleService-Info.plist file does not found in ' + iosGoogleServicesFilePath);
}
if (fs.existsSync(androidGoogleServicesFilePath)) {
config.android.googleServicesFile = androidGoogleServicesFilePath;
} else {
if (isEAS) {
throw new Error('google-services.json file does not found in ' + androidGoogleServicesFilePath);
}
throw new Error('google-services.json file does not found in ' + androidGoogleServicesFilePath);
}

// finally load the environment specific app.config.js
Expand Down
7 changes: 7 additions & 0 deletions expo/scripts/eas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ else
envsubst < $BASEDIR/config/GoogleService-Info.plist.env > $BASEDIR/config/$HPAPP_CONFIG_NAME/GoogleService-Info.plist
fi

if [ -z $GOOGLE_SERVICES_JSON ]; then
echo "no GOOGLE_SERVICES_JSON found"
else
echo "generating $BASEDIR/config/$HPAPP_CONFIG_NAME/google-services.json from environment variable."
envsubst < $BASEDIR/config/google-services.json.env > $BASEDIR/config/$HPAPP_CONFIG_NAME/google-services.json
fi

if [ "$1" == "build" ]; then
EAS_JSON=$BASEDIR/config/$HPAPP_CONFIG_NAME/eas.json
elif [ "$1" == "submit" ]; then
Expand Down

0 comments on commit f0ea792

Please sign in to comment.