Fastfile 1.9 KB

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