Skip to content

Instantly share code, notes, and snippets.

@swift2geek
Last active December 13, 2018 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swift2geek/81f5d1075e065acb0f7d4885af00558b to your computer and use it in GitHub Desktop.
Save swift2geek/81f5d1075e065acb0f7d4885af00558b to your computer and use it in GitHub Desktop.
fastlane that Walter uses
apple_id "xxxxxx@gmail.com"
for_lane :testtf do
app_identifier "ru.xxxxx.mobile.test"
end
for_lane :testfa do
app_identifier "ru.xxxxx.mobile.test"
end
for_lane :uattf do
app_identifier "ru.xxxxx.mobile.stage"
end
for_lane :uatfa do
app_identifier "ru.xxxx.mobile.stage"
end
for_lane :release do
app_identifier "ru.xxxxx.mobile"
end
# More documentation about how to customize your build
# can be found here:
# https://docs.fastlane.tools
fastlane_version "2.101.0"
default_platform :ios
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/xxx/xxxxx/xxxxxxx"
end
# Fastfile actions accept additional configuration, but
# don't worry, fastlane will prompt you for required
# info which you can add here later
lane :release do
id1 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
id2 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + ".widget"
match(type: "appstore", readonly: false, force: false, force_for_new_devices: true, app_identifier: [id1, id2])
build_app(
scheme: "Myxxxxxx",
workspace: "Myxxxxx.xcworkspace",
configuration: "Store",
clean: true,
export_method: "app-store",
export_xcargs: "-allowProvisioningUpdates"
)
deliver(
force: true,
skip_metadata: true,
skip_screenshots: true
)
slack(
message: "New version of our beautiful app has been released to App Store 🎉",
success: true)
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
end
lane :renew do
register_devices(devices_file: "./fastlane/devices.txt")
register_devices(
devices: {
'iPhone Xs' => 'xxxxx-000869a00c28002e',
'iPhone Xs Max' => 'xxxxx-0004556e2198002e',
'iPhone 5s' => '8xxxxx5b68607d9ea4a11784eed3e2a9648'
}
)
end
lane :testtf do
id1 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
id2 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + ".widget"
match(type: "appstore", readonly: false, force: false, force_for_new_devices: true, app_identifier: [id1, id2])
build_app(
scheme: "Myxxxxe-Test",
workspace: "Myxxxx.xcworkspace",
configuration: "Test-Appstore",
clean: true,
include_bitcode: false,
export_method: "app-store",
export_xcargs: "-allowProvisioningUpdates"
)
deliver(
force: true,
skip_metadata: true,
skip_screenshots: true,
submit_for_review: false,
skip_binary_upload: true
)
testflight(
skip_submission: true,
skip_waiting_for_build_processing:true
)
slack(
message: "New build for test successfully deployed in Testflight",
success: true
)
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
end
lane :testfa do
id1 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
id2 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + ".widget"
match(type: "adhoc", readonly: false, force: false, force_for_new_devices: true, app_identifier: [id1, id2])
# build your iOS app
build_app(
scheme: "Myxxxxx-Test",
workspace: "Myxxxxx.xcworkspace",
configuration: "Test-Adhoc",
clean: true,
include_bitcode: false,
export_method: "ad-hoc"
)
change_log = changelog_from_git_commits(commits_count: 10)
# upload to Beta by Crashlytics
crashlytics(
api_token: "ef56943c915ac881e4510f4f0740ca3f3e980b5c",
build_secret: "cc60b829aeea2fd960285d6a7b7312872aab3964b3803168866c5457c7d5ca0a",
groups:"myXxxx",
notes: change_log,
notifications: true
)
slack(
message: "New TEST (dev) build for test successfully deployed in Fabric",
success: true
)
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
end
lane :uatfa do
id1 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
id2 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + ".widget"
new_number = ENV['BUILD_NUMBER'].to_i + 1
ENV['BUILD_NUMBER'] = increment_build_number(
build_number: new_number # set a specific number
)
match(type: "adhoc", readonly: false, force: false, force_for_new_devices: true, app_identifier: [id1, id2])
# build your iOS app
build_app(
scheme: "Myxxxxx",
workspace: "Myxxxx.xcworkspace",
configuration: "Stage-Adhoc",
clean: true,
include_bitcode: false,
export_method: "ad-hoc"
)
change_log = changelog_from_git_commits(commits_count: 10)
# upload to Beta by Crashlytics
crashlytics(
api_token: "xxxxxxxx",
build_secret: "cxxxxxx",
groups:"mxxxxx",
notes: change_log,
notifications: true
)
slack(
message: "New UAT build for test successfully deployed in Fabric",
success: true
)
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
end
lane :uattf do
id1 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
id2 = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + ".widget"
new_number = ENV['BUILD_NUMBER'].to_i + 1
ENV['BUILD_NUMBER'] = increment_build_number(
build_number: new_number # set a specific number
)
match(type: "appstore", readonly: false, force: false, force_for_new_devices: true, app_identifier: [id1, id2])
build_app(
scheme: "Myxxxxx",
workspace: "Myxxxxx.xcworkspace",
configuration: "Stage-Appstore",
clean: true,
include_bitcode: false,
export_method: "app-store",
export_xcargs: "-allowProvisioningUpdates"
)
deliver(
force: true,
skip_metadata: true,
skip_screenshots: true,
submit_for_review: false,
skip_binary_upload: true
)
testflight(
skip_submission: true,
skip_waiting_for_build_processing:true
)
slack(
message: "New UAT build for test successfully deployed in Testflight",
success: true
)
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
end
bundles_ids = [
"ru.xxxx.mobile.test",
"ru.xxxx.mobile.stage",
"ru.xxxx.mobile.prod",
"ru.xxxx.mobile.test.widget",
"ru.xxxx.mobile.stage.widget",
"ru.xxxx.mobile.prod.widget"]
distribution_types = [
"adhoc",
"development",
"appstore"]
lane :regen do
distribution_types.each { |type|
match(app_identifier: bundles_ids,
type: type,
readonly: true)
}
end
lane :forceregen do
match(app_identifier: bundles_ids,
type: "adhoc",
force: true)
match(app_identifier: bundles_ids,
type: "development",
force: true)
match(app_identifier: bundles_ids,
type: "appstore",
force: true)
end
git_url("git@bitbucket.org:xxxx-xxxx/certificates.git")
type("adhoc") # The default type, can be: appstore, adhoc, enterprise or development
#app_identifier("ru.xxxx.mobile.dev")
username("xxxx.appleid.1@gmail.com") # Your Apple Developer Portal username
# For all available options run `fastlane match --help`
# Remove the # in the beginning of the line to enable the other options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment