Fastfile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 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 "Lint"
  13. lane :lint do
  14. carthage(command: "build", no_skip_current: true)
  15. pod_lib_lint
  16. end
  17. desc "Release new version"
  18. lane :release do |options|
  19. target_version = options[:version]
  20. raise "The version is missed. Use `fastlane release version:{version_number}`.`" if target_version.nil?
  21. ensure_git_branch
  22. ensure_git_status_clean
  23. test
  24. lint
  25. sync_build_number_to_git
  26. increment_version_number(version_number: target_version)
  27. version_bump_podspec(path: "Kingfisher.podspec", version_number: target_version)
  28. log = extract_current_change_log(version: target_version)
  29. release_log = update_change_log(log: log)
  30. doc(version: target_version)
  31. git_commit_all(message: "Bump version to #{target_version}")
  32. Actions.sh("git tag -s #{target_version} -m ''")
  33. push_to_git_remote
  34. set_github_release(
  35. repository_name: "onevcat/Kingfisher",
  36. api_token: ENV['GITHUB_TOKEN'],
  37. name: release_log[:title],
  38. tag_name: target_version,
  39. description: release_log[:text]
  40. )
  41. pod_push
  42. end
  43. lane :podpush do
  44. pod_push
  45. end
  46. lane :doc do |options|
  47. target_version = options[:version]
  48. Actions.sh("cd .. && jazzy \
  49. --clean \
  50. --author \"Wei Wang\" \
  51. --author_url https://onevcat.com \
  52. --github_url https://github.com/onevcat/Kingfisher \
  53. --github-file-prefix https://github.com/onevcat/Kingfisher/tree/#{target_version} \
  54. --module-version #{target_version} \
  55. --module Kingfisher \
  56. --root-url http://onevcat.github.io/Kingfisher/ \
  57. --output docs/")
  58. end
  59. after_all do |lane|
  60. end
  61. error do |lane, exception|
  62. end
  63. end