Skip to content

Instantly share code, notes, and snippets.

@dalu93
Last active October 1, 2021 15:22
Show Gist options
  • Select an option

  • Save dalu93/361937fb393a5c24e265 to your computer and use it in GitHub Desktop.

Select an option

Save dalu93/361937fb393a5c24e265 to your computer and use it in GitHub Desktop.
Fastfile example
fastlane_version "1.49.0"
default_platform :ios
######################
slack_webhook = 'https://...' #See Slack Incoming Webhook
slack_default_channel = '#channel'
default_production_scheme = 'YOUR-PRODUCTION-SCHEME'
certificates_output_path = './certificates'
profiles_output_path = './profiles'
apple_team_id = 'YOUR-TEAM-ID'
workspace_path = 'WORKSPACE-PATH'
hockey_production_token = 'TOKEN'
platform :ios do
before_all do
ENV["SLACK_URL"] = slack_webhook
ENV["SCAN_SLACK_CHANNEL"] = slack_default_channel
end
desc "Responsible for building and signing the app"
desc "Accept parameters:"
desc "- scheme : scheme name (Optional)"
private_lane :build_app do |options|
# Download the updated profiles and certificates
cert(
development: (options[:scheme] && options[:scheme] != default_production_scheme,
output_path: certificates_output_path,
team_id: apple_team_id
)
sigh(
output_path: profiles_output_path,
team_id: apple_team_id
)
# Build using gym
gym(
scheme: options[:scheme] || default_production_scheme,
workspace: workspace_path,
export_team_id: apple_team_id
)
end
desc "Creates and uploads the ipa to TestFlight"
lane :prerelease do
# Asks to build the scheme
build_app(
scheme: default_production_scheme
)
hockey(
upload_dsym_only: true,
api_token: hockey_production_token,
notes: '',
notify: '0', # do not notify
status: '1' # do not make available for download
)
# Delivers the app to testflight
testflight(
skip_submission: true,
distribute_external: false
)
end
after_all do |lane|
# This block is called, only if the executed lane was successful
slack(
message: "Fastlane operation completed!!",
channel: slack_default_channel
)
end
error do |lane, exception|
slack(
message: exception.message,
success: false,
channel: slack_default_channel
)
end
end
@dalu93
Copy link
Copy Markdown
Author

dalu93 commented Jan 27, 2016

There are some useless constants. It's just to make people understand. It could be useful to use Appfile and Deliverfile

@johndpope-karhoo
Copy link
Copy Markdown

This looks good - you might want to check out this
https://github.com/theappbusiness/MasterFastfile

Specifically supporting multiple environments
https://github.com/theappbusiness/MasterFastfile/blob/master/setup.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment