Skip to content

Instantly share code, notes, and snippets.

@anhtuank7c
Forked from JagCesar/Fastfile
Created January 2, 2019 09:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anhtuank7c/63e799e2cbc9ccc1dcb84709f618f1d9 to your computer and use it in GitHub Desktop.
Cookin Fastfile
# 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/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.81.0"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
end
lane :version do
get_version_number
end
desc "Bumps version. Type: patch"
lane :version_patch do
increment_version_number(bump_type: "patch")
end
desc "Bumps version. Type: minor"
lane :version_minor do
increment_version_number(bump_type: "minor")
end
desc "Bumps version. Type: major"
lane :version_major do
increment_version_number(bump_type: "major")
end
lane :certs do
match(type: "development")
match(type: "appstore")
end
lane :screens do
# snapshot
frameit(silver: true)
deliver(app: 1102236212, app_identifier: "se.jagcesar.mat", skip_metadata: true, skip_binary_upload: true, force: true)
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Submits a new Beta Build to Fabric Beta"
lane :beta do |options|
notifications = true
if options[:notifications] != nil
notifications = options[:notifications]
end
register_devices(devices_file: "./devices.txt")
match(type: "adhoc", force_for_new_devices: true)
sh "cd .. && git apply adhoc.patch"
gym(use_legacy_build_api: true) # Build your app - more options available
sh "cd .. && git apply -R adhoc.patch"
changelog = File.read("metadata/en-US/release_notes.txt")
crashlytics(
emails: "email@icloud.com",
api_token: "token",
build_secret: "secret",
notes: changelog,
groups: "group-name",
notifications: notifications
)
end
lane :silent_beta do
beta(notifications: false)
end
lane :testflight_beta do
disable_ipad
gym(use_legacy_build_api: true) # Build your app - more options available
enable_ipad
changelog = File.read("metadata/en-US/release_notes.txt")
pilot(changelog: changelog, distribute_external: true)
end
lane :meta do
deliver(app: 1102236212, app_identifier: "se.jagcesar.mat", skip_screenshots: true, skip_binary_upload: true, force: true)
end
lane :dependencies do
carthage(command: "bootstrap", use_ssh: true, use_binaries: false, platform: "ios")
end
desc "Deploy a new version to the App Store"
lane :deploy do
ensure_git_branch(branch: "master")
disable_ipad
gym(use_legacy_build_api: true) # Build your app - more options available
enable_ipad
deliver(force: true, skip_screenshots: true, submit_for_review: true, automatic_release: true)
add_git_tag(tag: "v#{get_version_number}")
push_git_tags
end
lane :disable_ipad do
sh "sed -i '' 's/TARGETED_DEVICE_FAMILY = \"1,2\";/TARGETED_DEVICE_FAMILY = 1;/g' ../cookin.xcodeproj/project.pbxproj"
end
lane :enable_ipad do
sh "sed -i '' 's/TARGETED_DEVICE_FAMILY = 1;/TARGETED_DEVICE_FAMILY = \"1,2\";/g' ../cookin.xcodeproj/project.pbxproj"
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
notification(
title: "Fastlane",
# subtitle: "subtitle",
message: "#{lane} finished successfully",
# sound: "Pop",
activate: "com.apple.terminal",
app_icon: "/Users/jagcesar/code/fastlane.png",
content_image: "/Users/jagcesar/code/jagcesar/cookin-ios/Cookin/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png"
)
# slack(
# message: "Successfully deployed new App Update."
# )
end
error do |lane, exception|
notification(
title: "Fastlane",
# subtitle: "subtitle",
message: "#{lane} failed",
# sound: "Basso",
activate: "com.apple.terminal",
app_icon: "/Users/jagcesar/code/fastlane.png",
content_image: "/Users/jagcesar/code/jagcesar/cookin-ios/Cookin/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png"
)
# slack(
# message: exception.message,
# success: false
# )
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/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