Skip to content

Instantly share code, notes, and snippets.

@thecb4
Last active June 4, 2016 19:56
Show Gist options
  • Save thecb4/4f181b2b9dd322899a014878818dc4ef to your computer and use it in GitHub Desktop.
Save thecb4/4f181b2b9dd322899a014878818dc4ef to your computer and use it in GitHub Desktop.
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.93.0"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
end
desc "Post Fastlane init"
desc "Add COMMIT_MSG, CHANGELOG, README, gitignore files to project"
lane :post_fastlane_init do
sh("wget -O ../.gitignore https://gist.github.com/thecb4/d497cf1a67a66f7633fc9bbc4f3afce6/raw")
sh("wget -O ../README.md https://gist.github.com/thecb4/eae350c66d315f60f0a92b393630ec47/raw")
sh("wget -O ../COMMIT_MSG.md https://gist.github.com/thecb4/08448f68b831d92e6f12c9b1cb99082e/raw")
sh("wget -O ../CHANGELOG.md https://gist.github.com/thecb4/c53dcec8ae11f6b55f54ffec4d006088/raw")
sh("wget -O ../Cartfile https://gist.github.com/thecb4/23828a43afdb6321d97b44c6ee14c1c5/raw")
sh("wget -O ./actions/git_documented_commit.rb https://gist.github.com/thecb4/005f0deb4f9d959410b24b25a7beb01b/raw")
end
desc "Carthage bootstrap"
desc "Remove Cartfile.resolved if it exists"
desc "Remove Carthage directory if it exists"
lane :carthage_bootstrap do
sh "[[ -f ../Cartfile.resolved ]] && rm -f ../Cartfile.resolved"
sh "[[ -d ../Carthage ]] && rm -rf ../Carthage"
carthage(command: "bootstrap", platform: "iOS")
end
desc "Runs all the tests"
lane :test_commit_push do
# gym(scheme: "audire") # Build your app - more options available
ensure_git_branch
increment_build_number
scan
xcov
git_documented_commit
git_build_number = get_build_number_repository
update_info_plist(
xcodeproj: "TheProject.xcodeproj",
plist_path: "TheProject/Info.plist",
block: lambda { |plist|
plist['GIT_COMMIT'] = git_build_number
}
)
push_to_git_remote
changelog_from_git_commits
end
# You can define as many lanes as you want
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# fastlane reports which actions are used
# No personal data is recorded. Learn more at https://github.com/fastlane/enhancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment