Skip to content

Instantly share code, notes, and snippets.

@mattpetrie
Last active June 5, 2018 20:14
Show Gist options
  • Save mattpetrie/95754161a856327a36270c849cc0f18b to your computer and use it in GitHub Desktop.
Save mattpetrie/95754161a856327a36270c849cc0f18b to your computer and use it in GitHub Desktop.
Example iOS Fastfile
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
# You can replace the automatically generated Fastfile with this one
# The Android version with the same setup can be found at:
# https://gist.github.com/mattpetrie/7c1f76469f694a35386c63f026368dd0
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
desc "Submit a new dev Build to HockeyApp"
lane :dev do
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
add_to_search_list: true
)
match(
type: "adhoc",
force_for_new_devices: true,
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_PASSWORD"]
)
increment_build_number(build_number: "#{get_build_number}.0")
build_app(scheme: "kcm_rider", configuration: "Release")
commit_sha = get_build_number_repository
notes = "DEV BUILD (#{commit_sha})\n\n#{last_git_commit[:message]}"
# Create an "Alpha" version of your app in HockeyApp with an identical package name (ex: com.my_app
# to your "Beta" app, dev builds will be deployed to the Alpha app and set to immediate availability
# for download without notifying users.
hockey(
api_token: ENV["HOCKEYAPP_TOKEN"],
teams: "124637",
release_type: "2", # alpha channel
notify: "0", # do not notify
status: "2", # available for download
strategy: "replace",
commit_sha: commit_sha,
notes: notes
)
end
desc "Submit a new beta Build to HockeyApp"
lane :beta do
create_keychain(
name: ENV["MATCH_KEYCHAIN_NAME"],
password: ENV["MATCH_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
add_to_search_list: true
)
match(
type: "adhoc",
force_for_new_devices: true,
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_PASSWORD"]
)
build_app(scheme: "kcm_rider", configuration: "Release")
commit_sha = get_build_number_repository
# Beta builds will be deployed to the beta version of the app on HockeyApp these are not set for
# immediate release or notification so you can verify the build and edit the release notes before releasing
hockey(
api_token: ENV["HOCKEYAPP_TOKEN"],
teams: "124637",
notify: "0", # do not notify
status: "1", # not available for download
strategy: "replace",
commit_sha: commit_sha,
notes: last_git_commit[:message]
)
end
desc "prepare release"
lane :prepare_release do
increment_build_number
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment