| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- fastlane_version "1.37.0"
- default_platform :ios
- platform :ios do
- desc "Runs all the tests"
- lane :tests do
- test(scheme: "Kingfisher", swift_version: "5.0")
- test(scheme: "Kingfisher-macOS", swift_version: "5.0")
- test(scheme: "Kingfisher-tvOS", swift_version: "5.0")
- test(scheme: "Kingfisher", swift_version: "4.2")
- test(scheme: "Kingfisher-macOS", swift_version: "4.2")
- test(scheme: "Kingfisher-tvOS", swift_version: "4.2")
- test(scheme: "Kingfisher", swift_version: "4.0")
- test(scheme: "Kingfisher-macOS", swift_version: "4.0")
- test(scheme: "Kingfisher-tvOS", swift_version: "4.0")
- end
- lane :test do |options|
- _test(options)
- end
- private_lane :_test do |options|
- if options[:scheme].include? "macOS"
- scan(scheme: options[:scheme], clean: true, xcargs: "SWIFT_VERSION=#{options[:swift_version]}", destination: "platform=macOS")
- else
- scan(scheme: options[:scheme], clean: true, xcargs: "SWIFT_VERSION=#{options[:swift_version]}")
- end
- end
- lane :test_ci do
- test(scheme: ENV["SCHEME"], swift_version: ENV["SWIFT_VERSION"])
- end
-
- desc "Lint"
- lane :lint do
- carthage(command: "build", no_skip_current: true)
- pod_lib_lint
- end
- desc "Release new version"
- lane :release do |options|
- target_version = options[:version]
- raise "The version is missed. Use `fastlane release version:{version_number}`.`" if target_version.nil?
- ensure_git_branch
- ensure_git_status_clean
-
- tests
- lint
- carthage(command: "archive", frameworks: ["Kingfisher"])
-
- sync_build_number_to_git
- increment_version_number(version_number: target_version)
- version_bump_podspec(path: "Kingfisher.podspec", version_number: target_version)
- log = extract_current_change_log(version: target_version)
- release_log = update_change_log(log: log)
- doc(version: target_version)
- git_commit_all(message: "Bump version to #{target_version}")
-
- Actions.sh("git tag -s #{target_version} -m ''")
- push_to_git_remote
- set_github_release(
- repository_name: "onevcat/Kingfisher",
- api_token: ENV['GITHUB_TOKEN'],
- name: release_log[:title],
- tag_name: target_version,
- description: release_log[:text],
- upload_assets: ["Kingfisher.framework.zip"]
- )
- pod_push
- end
- lane :podpush do
- pod_push
- end
- lane :doc do |options|
- target_version = options[:version]
- Actions.sh("cd .. && jazzy \
- --clean \
- --author \"Wei Wang\" \
- --author_url https://onevcat.com \
- --github_url https://github.com/onevcat/Kingfisher \
- --github-file-prefix https://github.com/onevcat/Kingfisher/tree/#{target_version} \
- --module-version #{target_version} \
- --module Kingfisher \
- --root-url http://onevcat.github.io/Kingfisher/ \
- --output docs/ \
- --theme fullwidth")
- end
- after_all do |lane|
- end
- error do |lane, exception|
- end
- end
|