Commit 25a7b97c authored by 段英荣's avatar 段英荣

update fastlane

parent 972ff0b4
app_identifier "org.cocoapods.demo.GMPhobos-Example" # The bundle identifier of your app
app_identifier "" # The bundle identifier of your app
apple_id "wanmeizhensuo@gmail.com" # Your Apple email address
team_id "86R4V3XFLU" # Developer Portal Team ID
# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/docs/Appfile.md
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md
import_from_git(url: 'git@git.gengmei.cc:mobile/JaguarTemplate.git',
path: 'fastlane/ios_fastfile')
fastlane_version "2.85.0"
default_platform :ios
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "30"
ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "20"
platform :ios do
MASTER_PATH = "https://github.com/CocoaPods/Specs"
PRIVATE_PATH = "git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git"
PRIVATE_SPEC = "wanmeizhensuo-gmspecs"
SOURCES = [MASTER_PATH, PRIVATE_PATH]
desc 'Deploy a new version to the App Store'
lane :do_publish_prod do |options|
app_identifier = options[:ios_app_identifier]
scheme = options[:ios_scheme]
version = options[:version]
build = options[:build_number] || Time.now.strftime('%Y%m%d%H%M')
output_directory = options[:ios_output_directory]
output_name = options[:ios_output_name]
plist = options[:ios_plist_file]
branch = options[:git_branch]
git_pull_and_pod
update_build_number(version: build, plist: plist)
gym(scheme: scheme, configuration:'AppStore', clean: true, output_directory: output_directory, output_name: output_name, export_method: 'app-store', silent: true, suppress_xcode_output:true,
export_options: {
provisioningProfiles: {
"com.wanmeizhensuo.ZhengXing" => "user-appstore"
}
})
deliver(force: false, skip_screenshots: true, skip_metadata: true)
git_add(path: '.')
git_commit(path: '.', message: "Update build number to #{build} and upload to itunesconnect")
git_pull
git_push(branch: branch)
end
desc "Release new private pod version"
lane :do_publish_lib do |options|
target_version = options[:version]
podspec_path = options[:ios_podspec_path]
git_pull
pod_repo_update(repo: PRIVATE_SPEC)
#pod_install(repo: PRIVATE_SPEC)
pod_lib_lint(verbose: false, allow_warnings: true, sources: SOURCES, use_bundle_exec: true, fail_fast: true)
version_bump_podspec(path: podspec_path, version_number: target_version) # 更新 podspec
git_commit_all(message: "Bump version to #{target_version}") # 提交版本号修改
add_git_tag(tag: target_version) # 设置 tag
push_to_git_remote # 推送到 git 仓库
pod_push(path: podspec_path, repo: PRIVATE_SPEC, allow_warnings: true, sources: SOURCES) # 提交到 CocoaPods
pod_repo_update(repo: PRIVATE_SPEC)
end
desc 'Publish a beta version'
lane :do_publish_beta do |options|
scheme = options[:ios_scheme]
output_directory = options[:ios_output_directory]
output_name = options[:ios_output_name]
sh('USE_APPSTORE_PODS=true pod install')
gym(scheme: scheme, configuration:'Release', output_directory: output_directory, output_name: output_name, export_method: 'ad-hoc', silent: true, suppress_xcode_output:true, clean: true)
end
desc 'Publish a test version'
lane :do_publish_test do |options|
scheme = options[:ios_scheme]
bundle_identifier = options[:ios_bundle_identifier]
output_directory = options[:ios_output_directory]
output_name = options[:ios_output_name]
version = options[:version]
#git_pull_and_pod
sh('pwd')
sh('git fetch')
sh('git status')
sh('git merge origin/test')
pod_repo_update(repo: PRIVATE_SPEC)
pod_repo_update(repo: "gengmei-gmspecs")
pod_repo_update(repo: "gengmei-gengmeiios-gmspecs")
sh('USE_APPSTORE_PODS=true pod install')
sigh(adhoc: true, username: ENV['FASTLANE_USER'], app_identifier: bundle_identifier)
gym(scheme: scheme, configuration:'Release', output_directory: output_directory, output_name: output_name, export_method: 'ad-hoc', silent: true, suppress_xcode_output:true)
end
private_lane :git_pull_and_pod do |options|
sh('git pull')
pod_repo_update(repo: PRIVATE_SPEC)
pod_repo_update(repo: "gengmei-gmspecs")
pod_repo_update(repo: "gengmei-gengmeiios-gmspecs")
#cocoapods
sh('USE_APPSTORE_PODS=true pod install')
end
error do |lane, exception|
UI.message(exception.message)
end
end
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
Install _fastlane_ using
```
sudo gem install fastlane
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`
# Available Actions
## iOS
### ios do_deliver_app
### ios do_publish_prod
```
fastlane ios do_deliver_app
fastlane ios do_publish_prod
```
Deploy a new version to the App Store
### ios do_release_lib
### ios do_publish_lib
```
fastlane ios do_release_lib
fastlane ios do_publish_lib
```
Release new private pod version
### ios do_monkey_test
### ios do_publish_beta
```
fastlane ios do_publish_beta
```
Publish a beta version
### ios do_publish_test
```
fastlane ios do_monkey_test
fastlane ios do_publish_test
```
UI automation test
Publish a test version
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane).
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
module Fastlane
module Actions
class GitCommitAllAction < Action
def self.run(params)
Actions.sh "git commit -am \"#{params[:message]}\""
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Commit all unsaved changes to git."
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :message,
env_name: "FL_GIT_COMMIT_ALL",
description: "The git message for the commit",
is_string: true)
]
end
def self.authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
["thierry"]
end
def self.is_supported?(platform)
true
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
# Updates the local clone of the spec-repo
class PodRepoUpdateAction < Action
def self.run(params)
cmd = []
repo = params[:repo]
result = Actions.sh("pod repo update #{repo}")
UI.success("Successfully pod repo update 💾.")
return result
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Updates the local clone of the spec-repo `NAME`. If `NAME` is omitted this will update all spec-repos in `~/.cocoapods/repos`."
end
def self.details
# Optional:
# this is your chance to provide a more detailed description of this action
"You can use this action to do cool things..."
end
def self.available_options
# Define all options your action supports.
[
FastlaneCore::ConfigItem.new(key: :repo,
description: "Repo",
is_string: false,
verify_block: proc do |value|
end),
]
end
def self.output
# Define the shared values you are going to provide
# Example
[
['POD_REPO_UPDATE_CUSTOM_VALUE', 'A description of what this value contains']
]
end
def self.return_value
# If you method provides a return value, you can describe here what it does
end
def self.authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
["thierryxing"]
end
def self.is_supported?(platform)
platform == :ios
end
end
end
end
module Fastlane
module Actions
module SharedValues
BUILD_NUMBER = :BUILD_NUMBER
end
class SyncBuildNumberToGitAction < Action
def self.is_git?
Actions.sh 'git rev-parse HEAD'
return true
rescue
return false
end
def self.run(params)
if is_git?
command = 'git rev-list HEAD --count'
else
raise "Not in a git repository."
end
build_number = (Actions.sh command).strip
Fastlane::Actions::IncrementBuildNumberAction.run(build_number: build_number)
Actions.lane_context[SharedValues::BUILD_NUMBER] = build_number
end
def self.output
[
['BUILD_NUMBER', 'The new build number']
]
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Set the build version of your project to the same number of your total git commit count"
end
def self.authors
["thierry"]
end
def self.is_supported?(platform)
[:ios].include? platform
end
end
end
end
......@@ -2,50 +2,32 @@
<testsuites>
<testsuite name="fastlane.lanes">
<testcase classname="fastlane.lanes" name="0: Verifying required fastlane version" time="0.000486">
</testcase>
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.000349">
</testcase>
<testcase classname="fastlane.lanes" name="2: import_from_git" time="0.517528">
</testcase>
<testcase classname="fastlane.lanes" name="3: hipchat" time="0.053086">
<testcase classname="fastlane.lanes" name="0: Verifying fastlane version" time="0.009454">
</testcase>
<testcase classname="fastlane.lanes" name="4: git_pull" time="0.91196">
<testcase classname="fastlane.lanes" name="1: default_platform" time="0.001502">
</testcase>
<testcase classname="fastlane.lanes" name="5: ensure_git_branch" time="0.008307">
<testcase classname="fastlane.lanes" name="2: git_pull" time="1.074435">
</testcase>
<testcase classname="fastlane.lanes" name="6: pod_install" time="6.611039">
<testcase classname="fastlane.lanes" name="3: pod_repo_update" time="1.282599">
</testcase>
<testcase classname="fastlane.lanes" name="7: pod_lib_lint" time="0.001266">
<failure message="/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/actions/actions_helper.rb:33:in `execute_action'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:187:in `block in execute_action'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:186:in `chdir'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:186:in `execute_action'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:112:in `trigger_action_by_name'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/fast_file.rb:140:in `method_missing'&#10;../../../../../../var/folders/j6/yvgnw4_n0x74mjp36j7h7bjw0000gn/T/fl_clone20161031-46367-1w18qfj/JaguarTemplate.git/fastlane/ios_fastfile:66:in `block (2 levels) in parsing_binding'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/lane.rb:33:in `call'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:49:in `block in execute'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:45:in `chdir'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/runner.rb:45:in `execute'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/lane_manager.rb:52:in `cruise_lane'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/command_line_handler.rb:30:in `handle'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:49:in `block (2 levels) in run'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane_core-0.53.0/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:244:in `run'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:20:in `start'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/gems/fastlane-1.105.3/bin/fastlane:5:in `&lt;top (required)&gt;'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/bin/fastlane:23:in `load'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/bin/fastlane:23:in `&lt;main&gt;'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'&#10;/Users/gengmei/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `&lt;main&gt;'&#10;&#10;Could not find option 'fail_fast' in the list of available options: use_bundle_exec, verbose, allow_warnings, sources" />
<testcase classname="fastlane.lanes" name="4: pod_install" time="8.091993">
</testcase>
<testcase classname="fastlane.lanes" name="8: hipchat" time="0.047389">
<failure message="/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/actions/actions_helper.rb:48:in `execute_action'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:232:in `block in execute_action'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/fast_file.rb:154:in `method_missing'&#10;Fastfile:50:in `block (2 levels) in parsing_binding'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/lane.rb:33:in `call'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/runner.rb:45:in `execute'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'&#10;/Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'&#10;/Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'&#10;/Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'&#10;/Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'&#10;/Library/Ruby/Gems/2.3.0/gems/fastlane-2.111.0/bin/fastlane:23:in `&lt;top (required)&gt;'&#10;/usr/bin/fastlane:23:in `load'&#10;/usr/bin/fastlane:23:in `&lt;main&gt;'&#10;&#10;Unknown method 'current', supported [:select, :message, :verbose, :error, :password, :input, :header, :command, :success, :important, :user_error!, :command_output, :deprecated, :content_error, :interactive?, :confirm, :crash!, :not_implemented, :shell_error!, :build_failure!, :test_failure!, :abort_with_message!]" />
</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