Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2018 13:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
[Expo] Updates release channels and publishes to unique channel, based on version number.
# acceptable values for arg $1 are prod and beta
echo "Publishing to $1";
iOSBuildNumber="$(json -f app.json | json expo.ios.buildNumber)"
androidVersionCode="$(json -f app.json | json"
# Update all the config
name="$(json -f scripts/$1Config.json | json name)";
id="$(json -f scripts/$1Config.json | json id)";
slug="$(json -f scripts/$1Config.json | json slug)";
json -I -f app.json -e " = \"$id\"; this.expo.ios.bundleIdentifier = \"$id\"";
# Update all the host URI locations
plutil -replace manifestUrl -string "exp://$hostUriIOS" ./ios/PROJECT_NAME/Supporting/EXShell.plist;
echo "Updated EXSheel.plist manfiestUrl to exp://$hostUriIOS"
plutil -replace CFBundleDisplayName -string "$name" ./ios/PROJECT_NAME/Supporting/info.plist;
echo "Updated info.plist CFBundleDisplayName to $name"
# plutil -replace bundleIdentifier -string "$id" ./ios/PROJECT_NAME/Supporting/EXShell.plist;
sed -i '' "s/?release-channel=.*\"/?release-channel=$channelAndroid\"/" ./android/app/src/main/java/host/exp/exponent/;
echo "Updated release-channel to $channelAndroid"
json -I -f ./ios/PROJECT_NAME/Supporting/shell-app-manifest.json -e "this.hostUri = \"$hostUriIOS\"";
echo "Updated ios/../shell-app-manifest.json to $hostUriIOS"
json -I -f ./android/app/src/main/assets/shell-app-manifest.json -e "this.hostUri = \"$hostUriAndroid\"";
echo "Updated android/../shell-app-manifest.json to $hostUriAndroid"
expo p --release-channel="$channelIOS";
expo p --release-channel="$channelAndroid";
echo "published to $channelIOS and $channelAndroid";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment