Skip to content

Instantly share code, notes, and snippets.

@thibmaek
Created June 21, 2018 21:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thibmaek/03a99bb4fb0ed858f8e501ddcb66e544 to your computer and use it in GitHub Desktop.
Save thibmaek/03a99bb4fb0ed858f8e501ddcb66e544 to your computer and use it in GitHub Desktop.
CD for Expo RN applications
#! /usr/bin/env bash
set -e
# This is based on the expo blogpost:
# https://blog.expo.io/automating-standalone-expo-app-builds-and-deployments-with-fastlane-exp-and-exptool-9b2f5ad0a2cd
# Publish `production` release to Expo
function publish_expo() {
# Log into Expo when running in CI
# Locally you should already be logged in
if [ "$CI" = true ]; then
exp login -u "$EXPO_USERNAME" -p "$EXPO_PASSWORD" --non-interactive
fi
echo "-----Publish production release-----"
exp publish --release-channel production --non-interactive
}
# Build standalone iOS binary using release type 'production'
function build_ios() {
echo "-----Starting iOS production build-----"
exp build:ios --release-channel production --non-interactive
echo "-----Downloading iOS .ipa from latest build result-----"
curl -o app.ipa "$(exp url:ipa --non-interactive)"
}
# Submit the built binary to iTunes Connect
function upload_ios() {
export DELIVER_USERNAME="$ITUNES_CONNECT_USERNAME"
export DELIVER_PASSWORD="$ITUNES_CONNECT_PASSWORD"
echo "-----Uploading .ipa to iTunes Connect through Fastlane-----"
fastlane deliver --verbose --ipa "app.ipa" --skip_screenshots --skip_metadata
}
function deploy_ios() {
publish_expo
build_ios
upload_ios
# Log out of expo when on CI, local should not log out
if [ "$CI" = true ]; then
exp logout
fi
}
deploy_ios
@thibmaek
Copy link
Author

Example of a modified version of Expo's deploy script for iOS.
We're using this together with Bitbucket Pipelines which runs a Docker container loaded with node, exp and fastlane to continuously integrate & deploy an Expo RN application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment