Skip to content

Instantly share code, notes, and snippets.

@aterribili
Last active March 25, 2021 01:52
Show Gist options
  • Save aterribili/0955ca9913d6d88e4b1e85b566dd0a99 to your computer and use it in GitHub Desktop.
Save aterribili/0955ca9913d6d88e4b1e85b566dd0a99 to your computer and use it in GitHub Desktop.
iOS + Travis + Fastlane continuous delivery
language: objective-c
os: osx
xcode_workspace: {workspace-name}.xcworkspace
xcode_scheme: {workspace-name}
xcode_sdk: iphonesimulator9.0
osx_image: xcode8
before_install:
- |
brew update
gem install xcpretty -N --no-ri --no-doc
gem update fastlane
install: pod install
script:
- |
set -o pipefail
xcodebuild clean test -workspace {workspace-name}.xcworkspace -scheme talk7 -destination "platform=iOS Simulator,name=iPhone 6 Plus" | xcpretty
after_success:
- ./scripts/travis/testflight.sh

Deploy an app automatically to testflight after success build in Travis on branch master.

1 - Add .travis.yml to your project

2 - Configure travis.yml file changing the {workspace-name} to your workspace name

3 - Add Fastlane to your project

4 - Add Fastlane Match to your project

5 - Create scripts/travis directory and add testflight.sh to it

6 - Install Travis client to encrypt your Fastlane credentials

7 - Execute travis encrypt "FASTLANE_PASSWORD={apple password}" --add

8 - Execute travis encrypt "MATCH_PASSWORD={match password}" --add

9 - That's all. When you merge PR on master, the release will start.

#!/bin/sh
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "This is a pull request. No deployment will be done."
exit 0
fi
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
echo "Testing on a branch other than master. No deployment will be done."
exit 0
fi
fastlane matchappstore
fastlane beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment