$ sudo gem install fastlane --verbose
$ cd MyAwesomeApp; fastlane init
app_identifier "com.MyCompany.MyApp"
apple_dev_portal_id "me@mycoolhost.com"
itunes_connect_id "thanos@atworks.gr"
team_name "Kick-ass Devs, Inc."
team_id "DEADB33F"
itc_team_name "Kick-ass Devs, Inc"
itc_team_id "B4DF00D"
# Fastfile
lane :appstore do
# whatever actions you want for an App Store release
end
lane :testflight do
# whatever actions you want for a Testflight release
end
# Fastfile
before_all do |lane|
# Executed before running the requested lane
# Supports the same actions as lanes
end
after_all do |lane|
# Executed after running the requested lane and
# the lane ran succesfully.
end
error do |lane, exception|
# Executed when an error occurs in any of the
# `before_all`, the lane itself or `after_all` blocks
end
# Example Actions
cocoapods # this will run pod install
increment_version_number( # Makes app version from 1.1.0 to 1.2.0
bump_type: "minor"
)
changelog_from_git_commits # Turns your git history into CHANGELOG
ensure_git_branch( # Makes sure you're on the "release" branch
branch: 'release'
)
ensure_git_status_clean # Ensures no uncommited changes get deployed
push_to_git_remote # Pushes `master` branch to `origin` remote
push_git_tags # Pushes only tags and nothing else
# Run tests
scan(
workspace: "MyApp.xcworkspace",
scheme: "MyTests",
clean: false
)
# Build an IPA out of the app
gym(
workspace: "MyApp.xcworkspace",
configuration: "Debug",
scheme: "MyApp",
silent: true,
clean: true, # clean build folder first
output_directory: "path/to/dir",
output_name: "my-app.ipa"
)
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/[REDACTED]"
cocoapods
end
lane :test do
desc "Run all tests in an iPad Air 2 Simulator"
test_app
end
def test_app
scan(
scheme: "RevealFootball",
configuration: "Testing",
clean: false,
device: "iPad Air 2",
skip_slack: true
)
end
lane :appstore do
test_app
ensure_git_branch(branch: 'release')
ensure_git_status_clean
increment_version_number(
bump_type: "minor"
)
gym(
scheme: "RevealFootball",
configuration: "Release",
output_directory: "./build/release",
silent: true,
clean: true
)
deliver(
ipa: "./build/release/Reveal Football.ipa",
app_identifier: "com.insightreplay.Reveal-Football",
skip_screenshots: true,
skip_metadata: true
)
commit_version_bump(
message: "Build version bump by build script",
force: true
)
version_number = Actions.lane_context[Actions::SharedValues::VERSION_NUMBER]
add_git_tag(
tag: "Release-v#{version_number}"
)
push_to_git_remote
slack(
message: "Reveal Football (#{version_number}) submitted to the App Store for review and release 😎",
channel: "#reveal-ios",
success: true,
)
end
lane :testflight do
ensure_git_branch('develop')
ensure_git_status_clean
increment_build_number
commit_version_bump
gym(
scheme: "RevealFootball",
configuration: "Testflight",
output_directory: "./build/beta",
silent: true,
clean: true
)
pilot(
ipa: "./build/beta/Reveal Football.ipa",
app_identifier: "com.insightreplay.Reveal-Football.testflight",
skip_submission: true
)
slack(
message: "New Testflight build pushed to ITC.",
channel: "#reveal-ios",
success: true,
)
end