Fastfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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-OSX", clean: true)
  10. scan(scheme: "Kingfisher-tvOS", clean: true)
  11. end
  12. desc "Swift Lint"
  13. lane :upgrade_swift_lint do
  14. Actions.sh("brew update")
  15. Actions.sh("brew install swiftlint")
  16. end
  17. desc "Build for Carthage"
  18. lane :carthage_lint do
  19. Actions.sh("cd .. && carthage build --no-skip-current && cd fastlane")
  20. end
  21. desc "Lint for Cocoapod"
  22. lane :pod_lint do
  23. Actions.sh("cd .. && pod lib lint && cd fastlane")
  24. end
  25. desc "Lint"
  26. lane :lint do
  27. carthage_lint
  28. pod_lint
  29. end
  30. desc "Release new version"
  31. lane :release do |options|
  32. target_version = options[:version]
  33. raise "The version is missed. Use `fastlane release version:{version_number}`.`" if target_version.nil?
  34. upgrade_swift_lint
  35. ensure_git_branch
  36. ensure_git_status_clean
  37. test_all_schemes
  38. carthage_lint
  39. sync_build_number_to_git
  40. increment_version_number(version_number: target_version)
  41. version_bump_podspec(path: "Kingfisher.podspec", version_number: target_version)
  42. log = extract_current_change_log(version: target_version)
  43. release_log = update_change_log(log: log)
  44. git_commit_all(message: "Bump version to #{target_version}")
  45. add_git_tag tag: target_version
  46. push_to_git_remote
  47. set_github_release(
  48. repository_name: "onevcat/Kingfisher",
  49. api_token: ENV['GITHUB_TOKEN'],
  50. name: release_log[:title],
  51. tag_name: target_version,
  52. description: release_log[:text]
  53. )
  54. pod_push
  55. end
  56. lane :podpush do
  57. pod_push
  58. end
  59. after_all do |lane|
  60. end
  61. error do |lane, exception|
  62. end
  63. end