fastlane 1.42.0 → 1.43.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/actions/create_pull_request.rb +96 -0
- data/lib/fastlane/actions/push_to_git_remote.rb +1 -1
- data/lib/fastlane/actions/slather.rb +16 -3
- data/lib/fastlane/actions/update_app_identifier.rb +86 -0
- data/lib/fastlane/helper/sh_helper.rb +2 -0
- data/lib/fastlane/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95994f49466294aa1e7ef950d47a5a9788e59617
|
4
|
+
data.tar.gz: d6adab25fe8157c89a419147fbd77ba2c91c740e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea9c34530dd8289efae9ee733ba0f0d59286956088bf058564c8371cb1108cf41ff7bf64f06b0fef1e0d129ae29758f64179b2abaa8d5e3be509c87950b39f3c
|
7
|
+
data.tar.gz: 80aad4ac9589e98c826a0ac1382f8a026fab6550d8259e495dc967c55e6321780c9a4af1581c6149cf8f0dfe051dd978fa29fede661ae943b2aa26c63b00f038
|
@@ -0,0 +1,96 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
CREATE_PULL_REQUEST_HTML_URL = :CREATE_PULL_REQUEST_HTML_URL
|
5
|
+
end
|
6
|
+
|
7
|
+
class CreatePullRequestAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
require 'excon'
|
10
|
+
require 'base64'
|
11
|
+
|
12
|
+
Helper.log.info "Creating new pull request from '#{params[:head]}' to branch '#{params[:base]}' of '#{params[:repo]}'"
|
13
|
+
|
14
|
+
url = "https://api.github.com/repos/#{params[:repo]}/pulls"
|
15
|
+
headers = { 'User-Agent' => 'fastlane-create_pull_request' }
|
16
|
+
headers['Authorization'] = "Basic #{Base64.strict_encode64(params[:api_token])}" if params[:api_token]
|
17
|
+
|
18
|
+
data = {
|
19
|
+
'title' => params[:title],
|
20
|
+
'head' => params[:head],
|
21
|
+
'base' => params[:base]
|
22
|
+
}
|
23
|
+
|
24
|
+
data['body'] = params[:body] if params[:body]
|
25
|
+
|
26
|
+
response = Excon.post(url, headers: headers, body: data.to_json)
|
27
|
+
|
28
|
+
if response[:status] == 201
|
29
|
+
body = JSON.parse(response.body)
|
30
|
+
number = body['number']
|
31
|
+
html_url = body['html_url']
|
32
|
+
Helper.log.info "Successfully created pull request ##{number}. You can see it at '#{html_url}'".green
|
33
|
+
|
34
|
+
Actions.lane_context[SharedValues::CREATE_PULL_REQUEST_HTML_URL] = html_url
|
35
|
+
else
|
36
|
+
if response[:status] != 200
|
37
|
+
Helper.log.error "GitHub responded with #{response[:status]}: #{response[:body]}".red
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
#####################################################
|
43
|
+
# @!group Documentation
|
44
|
+
#####################################################
|
45
|
+
|
46
|
+
def self.description
|
47
|
+
"This will create a new pull request on GitHub"
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.available_options
|
51
|
+
[
|
52
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
53
|
+
env_name: "GITHUB_PULL_REQUEST_API_TOKEN",
|
54
|
+
description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens",
|
55
|
+
is_string: true,
|
56
|
+
optional: false),
|
57
|
+
FastlaneCore::ConfigItem.new(key: :repo,
|
58
|
+
env_name: "GITHUB_PULL_REQUEST_REPO",
|
59
|
+
description: "The name of the repository you want to submit the pull request to",
|
60
|
+
is_string: true,
|
61
|
+
optional: false),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :title,
|
63
|
+
env_name: "GITHUB_PULL_REQUEST_TITLE",
|
64
|
+
description: "The title of the pull request",
|
65
|
+
is_string: true,
|
66
|
+
optional: false),
|
67
|
+
FastlaneCore::ConfigItem.new(key: :body,
|
68
|
+
env_name: "GITHUB_PULL_REQUEST_BODY",
|
69
|
+
description: "The contents of the pull request",
|
70
|
+
is_string: true,
|
71
|
+
optional: true),
|
72
|
+
FastlaneCore::ConfigItem.new(key: :head,
|
73
|
+
env_name: "GITHUB_PULL_REQUEST_HEAD",
|
74
|
+
description: "The name of the branch where your changes are implemented (defaults to the current branch name)",
|
75
|
+
is_string: true,
|
76
|
+
default_value: Actions.git_branch,
|
77
|
+
optional: true),
|
78
|
+
FastlaneCore::ConfigItem.new(key: :base,
|
79
|
+
env_name: "GITHUB_PULL_REQUEST_BASE",
|
80
|
+
description: "The name of the branch you want your changes pulled into (defaults to `master`)",
|
81
|
+
is_string: true,
|
82
|
+
default_value: 'master',
|
83
|
+
optional: true)
|
84
|
+
]
|
85
|
+
end
|
86
|
+
|
87
|
+
def self.author
|
88
|
+
["seei"]
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.is_supported?(platform)
|
92
|
+
return true
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -5,10 +5,18 @@ module Fastlane
|
|
5
5
|
end
|
6
6
|
|
7
7
|
class SlatherAction < Action
|
8
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
9
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
8
10
|
def self.run(params)
|
9
|
-
|
11
|
+
# This will fail if using Bundler. Skip the check rather than needing to
|
12
|
+
# require bundler
|
13
|
+
unless params[:use_bundle_exec]
|
14
|
+
Actions.verify_gem!('slather')
|
15
|
+
end
|
10
16
|
|
11
|
-
command = "
|
17
|
+
command = ""
|
18
|
+
command += "bundle exec " if params[:use_bundle_exec]
|
19
|
+
command += "slather coverage "
|
12
20
|
command += " --build-directory #{params[:build_directory]}" if params[:build_directory]
|
13
21
|
command += " --input-format #{params[:input_format]}" if params[:input_format]
|
14
22
|
command += " --scheme #{params[:scheme]}" if params[:scheme]
|
@@ -128,7 +136,12 @@ Slather is available at https://github.com/venmo/slather
|
|
128
136
|
FastlaneCore::ConfigItem.new(key: :ignore,
|
129
137
|
env_name: "FL_SLATHER_IGNORE",
|
130
138
|
description: "Tell slather to ignore files matching a path",
|
131
|
-
optional: true)
|
139
|
+
optional: true),
|
140
|
+
FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
|
141
|
+
env_name: "FL_SLATHER_USE_BUNDLE_EXEC",
|
142
|
+
description: "Use bundle exec to execute slather. Make sure it is in the Gemfile",
|
143
|
+
is_string: false,
|
144
|
+
default_value: false)
|
132
145
|
]
|
133
146
|
end
|
134
147
|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class UpdateAppIdentifierAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'plist'
|
6
|
+
require 'xcodeproj'
|
7
|
+
|
8
|
+
identifier_key = 'PRODUCT_BUNDLE_IDENTIFIER'
|
9
|
+
|
10
|
+
# Read existing plist file
|
11
|
+
info_plist_path = File.join(params[:xcodeproj], '..', params[:plist_path])
|
12
|
+
raise "Couldn't find info plist file at path '#{params[:plist_path]}'".red unless File.exist?(info_plist_path)
|
13
|
+
plist = Plist.parse_xml(info_plist_path)
|
14
|
+
|
15
|
+
# Check if current app identifier product bundle identifier
|
16
|
+
if plist['CFBundleIdentifier'] == "$(#{identifier_key})"
|
17
|
+
# Load .xcodeproj
|
18
|
+
project_path = params[:xcodeproj]
|
19
|
+
project = Xcodeproj::Project.open(project_path)
|
20
|
+
|
21
|
+
# Fetch the build configuration objects
|
22
|
+
configs = project.objects.select { |obj| obj.isa == 'XCBuildConfiguration' && !obj.build_settings[identifier_key].nil? }
|
23
|
+
raise "Info plist uses $(#{identifier_key}), but xcodeproj does not".red unless configs.count > 0
|
24
|
+
|
25
|
+
# For each of the build configurations, set app identifier
|
26
|
+
configs.each do |c|
|
27
|
+
c.build_settings[identifier_key] = params[:app_identifier]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Write changes to the file
|
31
|
+
project.save
|
32
|
+
|
33
|
+
Helper.log.info "Updated #{params[:xcodeproj]} 💾.".green
|
34
|
+
else
|
35
|
+
# Update plist value
|
36
|
+
plist['CFBundleIdentifier'] = params[:app_identifier]
|
37
|
+
|
38
|
+
# Write changes to file
|
39
|
+
plist_string = Plist::Emit.dump(plist)
|
40
|
+
File.write(info_plist_path, plist_string)
|
41
|
+
|
42
|
+
Helper.log.info "Updated #{params[:plist_path]} 💾.".green
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
#####################################################
|
47
|
+
# @!group Documentation
|
48
|
+
#####################################################
|
49
|
+
|
50
|
+
def self.is_supported?(platform)
|
51
|
+
[:ios].include?(platform)
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.description
|
55
|
+
"Update the project's bundle identifier"
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.available_options
|
59
|
+
[
|
60
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
61
|
+
env_name: "FL_UPDATE_APP_IDENTIFIER_PROJECT_PATH",
|
62
|
+
description: "Path to your Xcode project",
|
63
|
+
default_value: Dir['*.xcodeproj'].first,
|
64
|
+
verify_block: proc do |value|
|
65
|
+
raise "Please pass the path to the project, not the workspace".red if value.include? "workspace"
|
66
|
+
raise "Could not find Xcode project".red unless File.exist?(value)
|
67
|
+
end),
|
68
|
+
FastlaneCore::ConfigItem.new(key: :plist_path,
|
69
|
+
env_name: "FL_UPDATE_APP_IDENTIFIER_PLIST_PATH",
|
70
|
+
description: "Path to info plist, relative to your Xcode project",
|
71
|
+
verify_block: proc do |value|
|
72
|
+
raise "Invalid plist file".red unless value[-6..-1].downcase == ".plist"
|
73
|
+
end),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :app_identifier,
|
75
|
+
env_name: 'FL_UPDATE_APP_IDENTIFIER',
|
76
|
+
description: 'The app Identifier you want to set',
|
77
|
+
default_value: ENV['PRODUCE_APP_IDENTIFIER'])
|
78
|
+
]
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.authors
|
82
|
+
['squarefrog', 'tobiasstrebitzer']
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -3,6 +3,7 @@ module Fastlane
|
|
3
3
|
# Execute a shell command
|
4
4
|
# This method will output the string and execute it
|
5
5
|
# Just an alias for sh_no_action
|
6
|
+
# When running this in tests, it will return the actual command instead of executing it
|
6
7
|
# @param log [boolean] should fastlane print out the executed command
|
7
8
|
def self.sh(command, log: true)
|
8
9
|
sh_no_action(command, log: log)
|
@@ -25,6 +26,7 @@ module Fastlane
|
|
25
26
|
IO.popen(command, err: [:child, :out]) do |io|
|
26
27
|
io.sync = true
|
27
28
|
io.each do |line|
|
29
|
+
next unless log
|
28
30
|
Helper.log.info ['[SHELL]', line.strip].join(': ')
|
29
31
|
result << line
|
30
32
|
end
|
data/lib/fastlane/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: krausefx-shenzhen
|
@@ -580,6 +580,7 @@ files:
|
|
580
580
|
- lib/fastlane/actions/copy_artifacts.rb
|
581
581
|
- lib/fastlane/actions/crashlytics.rb
|
582
582
|
- lib/fastlane/actions/create_keychain.rb
|
583
|
+
- lib/fastlane/actions/create_pull_request.rb
|
583
584
|
- lib/fastlane/actions/debug.rb
|
584
585
|
- lib/fastlane/actions/default_platform.rb
|
585
586
|
- lib/fastlane/actions/delete_keychain.rb
|
@@ -663,6 +664,7 @@ files:
|
|
663
664
|
- lib/fastlane/actions/typetalk.rb
|
664
665
|
- lib/fastlane/actions/unlock_keychain.rb
|
665
666
|
- lib/fastlane/actions/update_app_group_identifiers.rb
|
667
|
+
- lib/fastlane/actions/update_app_identifier.rb
|
666
668
|
- lib/fastlane/actions/update_fastlane.rb
|
667
669
|
- lib/fastlane/actions/update_info_plist.rb
|
668
670
|
- lib/fastlane/actions/update_project_code_signing.rb
|