Fastfile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. fastlane_version "1.37.0"
  2. default_platform :ios
  3. platform :ios do
  4. before_all do
  5. end
  6. desc "Runs all the tests"
  7. lane :test_all_schemes do
  8. scan(scheme: "Kingfisher", clean: true)
  9. scan(scheme: "Kingfisher-macOS", clean: true, destination: 'platform=macOS')
  10. scan(scheme: "Kingfisher-tvOS", clean: true)
  11. end
  12. desc "Build for Carthage"
  13. lane :carthage_lint do
  14. Actions.sh("cd .. && carthage build --no-skip-current && cd fastlane")
  15. end
  16. desc "Lint for Cocoapod"
  17. lane :pod_lint do
  18. Actions.sh("cd .. && pod lib lint && cd fastlane")
  19. end
  20. desc "Lint"
  21. lane :lint do
  22. carthage_lint
  23. pod_lint
  24. end
  25. desc "Release new version"
  26. lane :release do |options|
  27. target_version = options[:version]
  28. raise "The version is missed. Use `fastlane release version:{version_number}`.`" if target_version.nil?
  29. ensure_git_branch
  30. ensure_git_status_clean
  31. test_all_schemes
  32. carthage_lint
  33. sync_build_number_to_git
  34. increment_version_number(version_number: target_version)
  35. version_bump_podspec(path: "Kingfisher.podspec", version_number: target_version)
  36. log = extract_current_change_log(version: target_version)
  37. release_log = update_change_log(log: log)
  38. git_commit_all(message: "Bump version to #{target_version}")
  39. Actions.sh("git tag -s #{target_version} -m ''")
  40. push_to_git_remote
  41. set_github_release(
  42. repository_name: "onevcat/Kingfisher",
  43. api_token: ENV['GITHUB_TOKEN'],
  44. name: release_log[:title],
  45. tag_name: target_version,
  46. description: release_log[:text]
  47. )
  48. pod_push
  49. end
  50. lane :podpush do
  51. pod_push
  52. end
  53. after_all do |lane|
  54. end
  55. error do |lane, exception|
  56. end
  57. end