Publish an iOS app with Bitrise

Matteo
3 min readOct 2, 2019

--

Have you compiled and published your Android app with Bitrise?
I gave some tips here.

So, now it’s time to do the same with an iOS application. Let’s see how I’ve done it. As the last time, I publish a React Native app, but that doesn’t matter.

WF-iOSStore

Mini-WF: CloneAndPrepare

Workflow which clones the repository and setup the env

The first step of the process is a small workflow that I use only to clone the repository.
It has three steps:
1) Setup ssh key (source)
2) Clone the repository, setting the repository url and the clone directory path, using $GIT_REPOSITORY_URL set inside app settings (source)
3) Execute a bash script as follows:

#!/usr/bin/env bash
# fail if any commands fails
set -e# launch another script inside my project root folder to setup the machine: install nvm + node and launch yarn
./bitrise-postclone.sh

Small tip: I usually do not flag the option Run if previous Step failed included in each step, in order to make the build quick, skipping steps if something fails.

This workflow is shared with my Android workflow.

Mini-WF: iOSStore

Steps required to deploy app to ItunesConnect

This is the core workflow, made of all steps required to compile the app and to upload to iTunesConnect. Let’s see in detail:
1) Set version and build number of the app, linking also the Info.plist file (source)
2
) Download and install correct Apple certificates and mobile provisioning. All the credentials are stored inside Bitrise secrets (source)
3) Archive and create the IPA file (source). Set here the export type (app-store, ad-hoc, enterprise or development). Also, do not forget to include the developer portal team used for the export.
4) Deploy finally to iTunesConnect, using credentials, stored as Bitrise secrets. (source). Small tips for anyone who has enabled two-factor authentication on Apple: use application specific password.
5) Set a global variable that will be used to log the status of the build. Only if all previous steps are complete then this is executed (source)

Mini-WF: Finish

Publish artifacts created

With this workflow I upload the artefacts produced to Bitrise, so that it’s available inside Artifacts tab.
1) Deploy IPA (source). You can also notify user roles through a input variable already in the step
2) Deploy logs, a file containing all echo outputs from my custom scripts (source)

Event this step is the same as the Android one.

Any questions? Do you want to discover additional details?
Comment here or ping me!

--

--