My Fastlane configuration is inspired to Touchwonders Fastfile configuration.
sudo gem install fastlane
In my Mobile department we decided to implement a base collection of standard lanes and actions that we want to share among all our projects. To import them we take advantage of import_from_git action.
For Custom lane :
At very beginning of every project's Fastfile:
fastlane init
emacs fastlane/Fastfile
import_from_git(url:"git@github.com:CharlesHarroch/fastlane-generic.git}:/library/fastlane.git", path:"Fastfile")
For Generic lane :
In yout project directory :
git clone git@github.com:CharlesHarroch/fastlane-generic.git
Every project's fastlane folder contains a required configuration file responsible to load proper environment and settings per project deployment.
Example: fastlane_config.yaml
Load release notes for current project's deployment.
The build note file content is loaded after the last tag and finally used for fill in Crashlytics and Appetize.io build's release notes.
Checkout a branch from project working copy.
The predefined lanes are divided in public and private.
The rule of thumb is to keep the public lanes as simple as possible by leveraging all the implementation load to private lanes such that they can be easily re-used.
Description: Submit a new daily build to Crashlytics.
Steps:
- Increment build number
- Download latest provisioning profile for targets specified in
fastlane_configuration.yaml
file. - Add icon overlay if needed (see
fastlane_configuration.yml
) - Publish to Crashlytics. By default all team members is invited.
Description: Submit a new build to Apptize.io for test application directly from your browser
- Download latest provisioning profile for targets specified in
fastlane_configuration.yaml
file. - Build application with sdk specified in
fastlane_configuration.yaml
file. - Publish to Appetize.io.
Description: Start Units test & User interface test
- Build application for testing
- Start testUI & Units test
- Generate an HTML report
Description: Submit a new sprint-end/weekly build to Crashlytics & Appetize.io.
Steps:
- Increment build number
- Download latest provisioning profile for targets specified in
fastlane_configuration.yaml
file. - Add icon overlay if needed (see
fastlane_configuration.yaml
) - Publish to Crashlytics. By default all team members is invited.
Description: Submit a new app version to AppStore.
Steps:
- Download latest provisioning profile for targets specified in
fastlane_configuration.yaml
file. - Upload to iTunes Connect.
Description: Configure the environment to drive required lanes with provided options.
Steps:
- Select proper Xcode tool by looking up the
xcode_select
parameter defined in project’sfastlane_configuration.yaml
file.
Description: Prepare required tools to drive required lanes with provided options.
Step:
- Ensure clean
git status
. - Checkout/Pull latest and greatest from
remote_branch
parameter specified in project’sfastlane_configuration.yaml
file. - Cocoapods.
Description: Create/Renew/Download required provisioning profiles for all targets specified in fastlane_configuration.yaml
file.
Step:
- Download targets provisioning profile. Every targets provides an identifier which is used to create an environment variable containing proper mobile provisioning profile UDID. This is useful in case the UDID is fetched from an environment variable, in your Xcode project’s setting.
Description: Last step before ‘build&archive’ process.
Step:
- Add icon overlay if needed.
- Increment build number. N.B.: Release lane will never increment project build number.
Description: Build and export IPA for your project. All intermediate and final step result are named after project’s scheme defined in the fastlane_configuration.yaml
Step:
- Build project by using parameters specified in
fastlane_configuration.yaml
file. - Export build’s product to IPA.
Description: Publish build to Crashlytics by using build notes available from last tag.
Step:
- Load build release notes from last tag.
- Publish build to Crashlytics. When specified, emails have prevalence over groups notification.
More information about fastlane can be found on https://fastlane.tools. The documentation of fastlane can be found on GitHub