Created
February 11, 2016 22:58
-
-
Save pdesantis/f70a98635f4a3bdd011a to your computer and use it in GitHub Desktop.
An example Fastfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the minimum version number required. | |
# Update this, if you use features of a newer version | |
fastlane_version "1.41.0" | |
default_platform :ios | |
platform :ios do | |
before_all do | |
ENV["SLACK_URL"] = "https://hooks.slack.com/services/MoneyWithWings" | |
# Make sure there are no uncommitted changeds | |
ensure_git_status_clean | |
# Update cocoapods | |
cocoapods | |
end | |
desc "Build and sign the app" | |
private_lane :build_app do |options| | |
increment_build_number | |
# Build the app | |
gym( | |
workspace: "MoneyWithWings.xcworkspace", | |
scheme: "MoneyWithWings Beta", | |
configuration: "Release" | |
) | |
end | |
desc "Submit a new Beta Build to Apple TestFlight" | |
desc "This action will also do a build version bump and push it to git." | |
lane :beta do | |
build_app | |
pilot( | |
skip_submission: true | |
) | |
# Make sure our directory is clean, except for changes Fastlane has made | |
clean_build_artifacts | |
version_number = get_version_number | |
build_number = get_build_number | |
tag = "beta/#{version_number}/#{build_number}" | |
commit_version_bump( | |
message: "Version Bump to #{version_number}-#{build_number}" | |
) | |
add_git_tag(tag: tag) | |
push_to_git_remote | |
end | |
# On success, post in Slack! | |
after_all do |lane| | |
slack( | |
message: "💸💸💸 Successfully deployed new iOS App Update 💸💸💸" | |
) | |
end | |
# On failure, let us know what went wrong in Slack, and then revert the git repo to the previous state. | |
error do |lane, exception| | |
slack( | |
message: exception.message, | |
success: false | |
) | |
reset_git_repo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're incrementing the build number and tagging it after
build_app
andpilot
, doesn't that mean the uploaded build will always be one number behind what is tagged?EDIT: Nevermind, I just noticed that the incrementing is done before the build, and only the commit and tag are done after it. Nice job :)