Skip to content

Instantly share code, notes, and snippets.

@MateusDeSousa
Last active March 20, 2020 01:45
Show Gist options
  • Save MateusDeSousa/bbb4801ba043ef6bfb9df4259d487cc2 to your computer and use it in GitHub Desktop.
Save MateusDeSousa/bbb4801ba043ef6bfb9df4259d487cc2 to your computer and use it in GitHub Desktop.
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "meuapp.xcodeproj"
)
build_app(workspace: "meuapp.xcworkspace", scheme: "meuapp")
upload_to_testflight
end
desc "Push a new release build to AppStore"
lane :release do
version = get_version_number(xcodeproj: "meu-app.xcodeproj")
if UI.confirm("Use latest testFlight build?")
submit_review(build_number: latest_testflight_build_number)
tag_and_push(tag: version)
elsif UI.confirm("Confirm uploading version #{version} for app store?")
increment_build_number(
build_number: latest_testflight_build_number + 1,
xcodeproj: "meu-app.xcodeproj"
)
build_app(workspace: "meuapp.xcworkspace", scheme: "meuapp")
upload_to_app_store
submit_review(build_number: get_build_number(xcodeproj: "meuapp.xcodeproj"))
commit_and_push(type_binary: "release", build_version: version, build_number: get_build_number(xcodeproj: "meuapp.xcodeproj"))
tag_and_push(tag: version)
else
UI.success("Verify version and try again")
end
end
desc "Submit app for review"
lane :submit_review do |options|
deliver(
build_number: options[:build_number].to_s,
submit_for_review: true,
automatic_release: true,
phased_release: true,
force: true,
metadata_path: "./fastlane/metadata",
screenshots_path: "./fastlane/screenshots",
skip_metadata: false,
skip_screenshots: false,
skip_binary_upload: true,
overwrite_screenshots: true,
submission_information: {
add_id_info_serves_ads: false,
add_id_info_tracks_action: true,
add_id_info_tracks_install: true,
add_id_info_uses_idfa: true,
content_rights_has_rights: true,
content_rights_contains_third_party_content: true,
export_compliance_platform: 'ios',
export_compliance_compliance_required: false,
export_compliance_encryption_updated: false,
export_compliance_app_type: nil,
export_compliance_uses_encryption: false,
export_compliance_is_exempt: false,
export_compliance_contains_third_party_cryptography: false,
export_compliance_contains_proprietary_cryptography: false,
export_compliance_available_on_french_store: false
}
)
upload_symbols_to_crashlytics(gsp_path: "./meuapp/resources/GoogleService-Info.plist")
end
#function git
lane :tag_and_push do |options|
tag = options[:tag]
add_git_tag tag: tag
`git push --tags`
end
lane :commit_and_push do |options|
message = "#{options[:typeBinary]} versão #{options[:build_version]} build #{options[:build_number]}"
git_commit(
path: "./*",
message: message
)
`git push`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment