Skip to content

Instantly share code, notes, and snippets.

@Baza207
Last active April 7, 2016 14:19
Show Gist options
  • Save Baza207/e49bb7e8c66a77e39fbb to your computer and use it in GitHub Desktop.
Save Baza207/e49bb7e8c66a77e39fbb to your computer and use it in GitHub Desktop.
Default Fastfile setup.
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/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`
# By default, fastlane will send which actions are used
# No personal data is shared, more information on https://github.com/fastlane/enhancer
# Uncomment the following line to opt out
# opt_out_usage
# 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.80.0"
# Set keys used accress lanes
ENV["CRASHLYTICS_API_TOKEN"] = ""
ENV["CRASHLYTICS_BUILD_SECRET"] = ""
default_platform :ios
desc "Run this after creating the Xcode project"
lane :setup do
verify_xcode
gitignore_data = download(url: "https://api.github.com/gists/658e81d08afbfe2de683")
raw_url = gitignore_data['files'][".gitignore"]["raw_url"]
`curl -o ../.gitignore #{raw_url}` # Downloads a default Xcode .gitignore file
gitignore_data = download(url: "https://api.github.com/gists/137fe9ad787f24bfec63")
raw_url = gitignore_data['files'][".swiftlint.yml"]["raw_url"]
`curl -o ../.swiftlint.yml #{raw_url}` # Downloads a default SwiftLint config file
end
desc "Run by an Xcode Server instance via a Bot"
lane :xcsbuild do
sh "export PATH=\"/usr/local/bin:$PATH\""
carthage(
use_submodules: true # Add dependencies as Git submodules.
)
end
platform :ios do
before_all do |lane|
if "#{lane}" != "alpha"
carthage(
use_submodules: true # Add dependencies as Git submodules.
)
end
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Run on a normal build locally to create an alpha"
lane :alpha do
# Do something
end
desc "Submit a new Beta Build to Fabric Crashlytics Beta"
lane :fabric do
increment_build_number
gym # Build your app - more options available
crashlytics
end
desc "Submit a new Beta Build to Apple TestFlight"
desc "This will also make sure the profile is up to date"
lane :beta do
increment_build_number
gym # Build your app - more options available
pilot
end
desc "Deploy a new version to the App Store"
lane :appstore do
increment_build_number
gym # Build your app - more options available
deliver(force: true)
end
after_all do |lane|
# This block is called, only if the executed lane was successful
end
error do |lane, exception|
notification(subtitle: "Fastlane Error", message: exception.message)
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/docs/Actions.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment