Skip to content

Instantly share code, notes, and snippets.

@gbasile
Created February 13, 2017 17:29
Show Gist options
  • Save gbasile/8be33dbbef7b1d04474ba5b5089358c0 to your computer and use it in GitHub Desktop.
Save gbasile/8be33dbbef7b1d04474ba5b5089358c0 to your computer and use it in GitHub Desktop.
Fastfile Example Novoda
fastlane_version "2.14.2"
default_platform :ios
platform :ios do
desc "Runs all the tests"
lane :test do
scan
end
desc "Runs all the UI tests"
lane :ui_tests do
scan(scheme: 'UITests')
end
desc "Build and send the release to Crashlytics for internal testing"
lane :release_dev do
ensure_git_status_clean
match(type: 'development')
increment_build_number
increment_version_number
commit_version_bump
custom_overlay
gym(configuration: 'Debug')
crashlytics(notes: release_notes)
reset_git_repo
end
desc "Test, Build and send a release to Testflight"
lane :release_testflight do
gym(configuration: 'Release')
testflight
end
desc "Generate Unit Test Code Coverage"
lane :code_coverage do
scan
xcov(scheme: 'OddscheckerMobile', only_project_targets: true)
end
desc "Update the version number for a new sprint"
lane :new_sprint do
ensure_git_status_clean
get_version_number
current_version = lane_context[SharedValues::VERSION_NUMBER]
version_array = current_version.split(".").map(&:to_i)
new_sprint_number = version_array[1] + 1
version_array[1] = new_sprint_number
version_array[2] = 0
new_version = version_array.join(".")
increment_version_number(
version_number: new_version
)
commit_version_bump
end
desc "Install developer certificates and provisioning profiles"
lane :install_certificates do
match(type: 'development')
end
desc "Generate a custom icon overlay"
private_lane :custom_overlay do
git_commit = last_git_commit[:abbreviated_commit_hash]
get_version_number
version_number = lane_context[SharedValues::VERSION_NUMBER]
badge(
shield: "#{version_number}-#{git_commit}-blue",
alpha: true
)
end
desc "Generate release notes"
private_lane :release_notes do
get_version_number
changelog = changelog_from_git_commits
version_number = lane_context[SharedValues::VERSION_NUMBER]
"Release notes #{version_number} Automatic build (Last 5 PR):\n#{changelog}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment