sudo gem install fastlane
In Touchwodners 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.
At very beginning of every project's Fastfile:
import_from_git(url:"{touchwonders_git_repo}:/library/fastlane.git", path:"Fastfile")
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.
Every project root folder contains:
build_notes.md
: Markdown file containing the release note of latest deployed version. For project management reasons this file is kept under version control.RELEASE_NOTES.md
: Markdown file contaning a collection of all the build notes that have been deployed. For project management reasons this file is kept under version control.
At every interaction the build note file content is added to RELEASE_NOTES.md
collection and finally used for fill in Crashlytics 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 Touchwonders team is invited.
Description: Submit a new sprint-end/weekly 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.yaml
) - Publish to Crashlytics. By default all Touchwonders team 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 in build_notes.md
file.
Step:
- Load build release notes from
build_notes.md
file and updatedRELEASE_NOTES.md
changelog. - 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