Skip to content

Instantly share code, notes, and snippets.

@RudyB
Created March 8, 2018 22:50
Show Gist options
  • Save RudyB/4cbbc6af091ec2e9b7055e2270945d19 to your computer and use it in GitHub Desktop.
Save RudyB/4cbbc6af091ec2e9b7055e2270945d19 to your computer and use it in GitHub Desktop.
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# 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
setup_travis
desc "Push a new beta build to TestFlight"
lane :beta do
test
ensure_git_status_clean
# Increment the build number (not the version number)
build_number = increment_build_number(xcodeproj: "Tempo.xcodeproj")
# Commit the version bump, skipping CI Build
commit_version_bump(xcodeproj: "Tempo.xcodeproj",
message:"[ci skip] Version Bump to #{build_number}")
# Push new build number
push_to_git_remote(
remote: "origin", # optional, default: "origin"
remote_branch: "develop", # optional, default is set to local_branch
tags: false # optional, default: true
)
cocoapods(clean: true, repo_update: true)
sync_code_signing(type: "appstore")
build_app
upload_to_testflight( demo_account_required: true, groups: "Tempo Testers",
distribute_external: true, changelog: "Here is what's new with Tempo:" )
slack(message: "Successfully distributed a new beta build")
end
desc "Automate Screenshots for iTunes Connect"
lane :screenshots do
cocoapods(repo_update: true)
capture_screenshots(skip_open_summary: true, erase_simulator: true)
frame_screenshots(white: true)
upload_to_app_store(force: true,
skip_binary_upload: true,
ignore_language_directory_validation: true,
skip_metadata: true,
overwrite_screenshots: true);
slack(message: "Successfully uploaded screenshots to iTunes Connect")
end
desc "Deploy release to iTunes Connect"
lane :release do
# Ensure that your git status is not dirty
ensure_git_status_clean
# Increment Version Number
increment_version_number
# Commit the version bump
commit_version_bump(xcodeproj: "Tempo.xcodeproj")
# Add a git tag for this build. This will automatically
# use an appropriate git tag name
add_git_tag
# Push the new commit and tag back to your git remote
push_to_git_remote
screenshots # generate new screenshots for the App Store
sync_code_signing(type: "appstore") # see code signing guide for more information
# Install Pods
cocoapods(clean: true, repo_update: true)
# Build App
build_app(scheme: "Tempo",
workspace: "Tempo.xcworkspace",
include_bitcode: true)
upload_to_app_store # upload your app to iTunes Connect
jazzy
slack(message: "Successfully uploaded a new App Store build")
end
lane :test do
desc "Run Tempo Tests"
# Install Pods
cocoapods(clean: true, repo_update: true )
run_tests(workspace: "Tempo.xcworkspace",
devices: ["iPhone 6s"],
scheme: "Tempo",
slack_channel: "#general")
# Compute the code coverage
slather(cobertura_xml: true,
scheme: "Tempo",
simple_output: true,
travis_pro: true,
workspace: "Tempo.xcworkspace"
)
# Report Coverage to Codecov.io
codecov_reporter(token: "$CODECOV_TOKEN")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment