Now that we have both a test and a beta lane, you will likely want to run tests on all pull requests and changes, and deploy to testflight when it reaches the master branch or when a tag is created on the repository.
This configuration can be simply set in the .travis.yml configuration file:
language: objective-c
osx_image: xcode10.1
install: bundle install
jobs:
include:
- stage: tests
script: fastlane test
- stage: release
deploy:
provider: script
script: fastlane beta
on:
tags: true
Let's review the code in the preceding snippet of the .travis.yml file:
- We use jobs to declare a series of build steps. The release stage will not run if the tests stage fails.
- On the release stage, we use the script deployment provider, which allows any kind of deployment to be run. Be sure to check the Travis documentation for all the providers it supports.
- With on: tags: true, the release stage will only be run when the build was triggered by a tag creation.
This concludes our section on fastlane.
You should now be able to kickstart any iOS project, and automatically upload new versions of your app with fastlane. While we just covered the basics, there is always more to learn about tools such as this one. Fastlane is driven by a strong community and grows in features every day. If you are interested, the project is open and you can always contribute on their GitHub repository: https://github.com/fastlane/fastlane.
Now that we are experts in setting up open source projects, let’s have a look in the next section at a few tips and tricks for setting up and maintaining open source projects.