Created
June 21, 2018 21:43
-
-
Save thibmaek/03a99bb4fb0ed858f8e501ddcb66e544 to your computer and use it in GitHub Desktop.
CD for Expo RN applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.