Commit 0e03d480 authored by Thierry's avatar Thierry

update fastlane

parent 5a525dfa
...@@ -33,20 +33,21 @@ platform :ios do ...@@ -33,20 +33,21 @@ platform :ios do
desc "Release new version" desc "Release new version"
lane :release do |options| lane :release do |options|
target_version = options[:version] target_version = options[:version]
raise "The version is missed." if target_version.nil? #pod_install
ensure_git_branch # 确认 master 分支 #pod_lint(verbose: true, allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"])
ensure_git_status_clean # 确认没有未提交的文件 #raise "The version is missed." if target_version.nil?
#ensure_git_branch # 确认 master 分支
#ensure_git_status_clean # 确认没有未提交的文件
#scan # 运行测试 #scan # 运行测试
sync_build_number_to_git # 将 build 号设为 git commit 数 #sync_build_number_to_git # 将 build 号设为 git commit 数
increment_version_number(version_number: target_version) # 设置版本号 increment_version_number(version_number: target_version) # 设置版本号
version_bump_podspec(path: "GMPhobos.podspec", #version_bump_podspec(path: "GMPhobos.podspec", version_number: target_version) # 更新 podspec
version_number: target_version) # 更新 podspec #git_commit_all(message: "Bump version to #{target_version}") # 提交版本号修改
git_commit_all(message: "Bump version to #{target_version}") # 提交版本号修改 #add_git_tag tag: target_version # 设置 tag
add_git_tag tag: target_version # 设置 tag #push_to_git_remote # 推送到 git 仓库
push_to_git_remote # 推送到 git 仓库 #pod_push(path: "GMPhobos.podspec", repo: "GMSpecs", allow_warnings: true, sources: ["git@git.gengmei.cc:gengmeiios/GMSpecs.git","https://github.com/CocoaPods/Specs"]) # 提交到 CocoaPods
pod_push # 提交到 CocoaPods
end end
end end
......
module Fastlane
module Actions
class PodInstallAction < Action
def self.run(params)
Actions.sh "cd Example && pod install"
Helper.log.info "Successfully pod install ⬆️ ".green
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Update all pods"
end
def self.details
"Update all pods"
end
def self.authors
["thierry"]
end
def self.is_supported?(platform)
true
end
end
end
end
module Fastlane
module Actions
class PodLintAction < Action
def self.run(params)
command = "pod lib lint"
if params[:verbose]
command << " --verbose"
end
if params[:sources]
sources = params[:sources].join(",")
command << " --sources='#{sources}'"
end
if params[:allow_warnings]
command << " --allow-warnings"
end
result = Actions.sh("#{command}")
Helper.log.info "Successfully pod lint ⬆️ ".green
return result
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Pod lint"
end
def self.details
""
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :verbose,
description: "Allow ouput detail in console",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :allow_warnings,
description: "Allow warnings during pod push",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :sources,
description: "The sources of repos you want the pod spec to lint with, separated by commas",
optional: true,
is_string: false,
verify_block: proc do |value|
raise "Sources must be an array.".red unless value.kind_of?(Array)
end)
]
end
def self.output
end
def self.return_value
nil
end
def self.authors
["thierry"]
end
def self.is_supported?(platform)
true
end
end
end
end
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<testsuite name="fastlane.lanes"> <testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.000473"> <testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.000441">
</testcase> </testcase>
...@@ -13,12 +13,7 @@ ...@@ -13,12 +13,7 @@
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="2: ensure_git_branch" time="0.006711"> <testcase classname="fastlane.lanes" name="2: increment_version_number" time="1.457714">
</testcase>
<testcase classname="fastlane.lanes" name="3: ensure_git_status_clean" time="0.008395">
</testcase> </testcase>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment