fastlane 2.140.0 → 2.141.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +81 -68
  3. data/cert/lib/cert/options.rb +12 -5
  4. data/cert/lib/cert/runner.rb +13 -0
  5. data/deliver/lib/deliver/options.rb +2 -2
  6. data/deliver/lib/deliver/runner.rb +13 -2
  7. data/fastlane/lib/fastlane/actions/build_app.rb +157 -6
  8. data/fastlane/lib/fastlane/actions/build_ios_app.rb +28 -132
  9. data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
  10. data/fastlane/lib/fastlane/actions/create_pull_request.rb +29 -0
  11. data/fastlane/lib/fastlane/actions/docs/{build_ios_app.md → build_app.md} +1 -1
  12. data/fastlane/lib/fastlane/actions/gym.rb +3 -7
  13. data/fastlane/lib/fastlane/actions/import_from_git.rb +4 -0
  14. data/fastlane/lib/fastlane/actions/set_github_release.rb +1 -1
  15. data/fastlane/lib/fastlane/actions/update_plist.rb +37 -2
  16. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +1 -0
  17. data/fastlane/lib/fastlane/fast_file.rb +13 -3
  18. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
  19. data/fastlane/lib/fastlane/version.rb +1 -1
  20. data/fastlane/swift/Deliverfile.swift +1 -1
  21. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  22. data/fastlane/swift/Fastlane.swift +239 -35
  23. data/fastlane/swift/Gymfile.swift +1 -1
  24. data/fastlane/swift/GymfileProtocol.swift +17 -1
  25. data/fastlane/swift/Matchfile.swift +1 -1
  26. data/fastlane/swift/MatchfileProtocol.swift +7 -3
  27. data/fastlane/swift/Precheckfile.swift +1 -1
  28. data/fastlane/swift/Scanfile.swift +1 -1
  29. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  30. data/fastlane/swift/Screengrabfile.swift +1 -1
  31. data/fastlane/swift/Snapshotfile.swift +1 -1
  32. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  33. data/fastlane_core/lib/fastlane_core/cert_checker.rb +28 -0
  34. data/fastlane_core/lib/fastlane_core/project.rb +23 -0
  35. data/gym/lib/gym/code_signing_mapping.rb +32 -3
  36. data/gym/lib/gym/detect_values.rb +34 -2
  37. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  38. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +47 -17
  39. data/gym/lib/gym/module.rb +8 -0
  40. data/gym/lib/gym/options.rb +25 -1
  41. data/gym/lib/gym/runner.rb +25 -4
  42. data/match/lib/match/encryption/openssl.rb +1 -1
  43. data/match/lib/match/generator.rb +17 -3
  44. data/match/lib/match/module.rb +4 -1
  45. data/match/lib/match/nuke.rb +54 -16
  46. data/match/lib/match/options.rb +20 -15
  47. data/match/lib/match/runner.rb +20 -8
  48. data/match/lib/match/spaceship_ensure.rb +19 -9
  49. data/match/lib/match/storage/git_storage.rb +5 -2
  50. data/scan/lib/scan/options.rb +6 -1
  51. data/snapshot/lib/snapshot/options.rb +12 -1
  52. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  53. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +11 -0
  54. data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +4 -0
  55. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +6 -0
  56. data/spaceship/lib/spaceship/portal/app.rb +11 -2
  57. data/spaceship/lib/spaceship/tunes/iap_status.rb +5 -1
  58. metadata +20 -25
  59. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  60. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  61. data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
  62. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  63. data/fastlane_core/lib/fastlane_core/.build_watcher.rb.swp +0 -0
  64. data/pilot/lib/pilot/.manager.rb.swp +0 -0
  65. data/spaceship/lib/spaceship/connect_api/.DS_Store +0 -0
  66. data/spaceship/lib/spaceship/portal/.certificate.rb.swp +0 -0
@@ -1,150 +1,46 @@
1
1
  module Fastlane
2
2
  module Actions
3
- module SharedValues
4
- IPA_OUTPUT_PATH ||= :IPA_OUTPUT_PATH
5
- DSYM_OUTPUT_PATH ||= :DSYM_OUTPUT_PATH
6
- XCODEBUILD_ARCHIVE ||= :XCODEBUILD_ARCHIVE # originally defined in XcodebuildAction
7
- end
8
-
9
- class BuildIosAppAction < Action
10
- def self.run(values)
11
- require 'gym'
12
-
13
- unless Actions.lane_context[SharedValues::SIGH_PROFILE_TYPE].to_s == "development"
14
- values[:export_method] ||= Actions.lane_context[SharedValues::SIGH_PROFILE_TYPE]
15
- end
16
-
17
- if Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING]
18
- # Since Xcode 9 you need to explicitly provide the provisioning profile per app target
19
- # If the user is smart and uses match and gym together with fastlane, we can do all
20
- # the heavy lifting for them
21
- values[:export_options] ||= {}
22
- # It's not always a hash, because the user might have passed a string path to a ready plist file
23
- # If that's the case, we won't set the provisioning profiles
24
- # see https://github.com/fastlane/fastlane/issues/9490
25
- if values[:export_options].kind_of?(Hash)
26
- match_mapping = (Actions.lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING] || {}).dup
27
- existing_mapping = (values[:export_options][:provisioningProfiles] || {}).dup
28
-
29
- # Be smart about how we merge those mappings in case there are conflicts
30
- mapping_object = Gym::CodeSigningMapping.new
31
- hash_to_use = mapping_object.merge_profile_mapping(primary_mapping: existing_mapping,
32
- secondary_mapping: match_mapping,
33
- export_method: values[:export_method])
34
-
35
- values[:export_options][:provisioningProfiles] = hash_to_use
36
- else
37
- self.show_xcode_9_warning
38
- end
39
- elsif Actions.lane_context[SharedValues::SIGH_PROFILE_PATHS]
40
- # Since Xcode 9 you need to explicitly provide the provisioning profile per app target
41
- # If the user used sigh we can match the profiles from sigh
42
- values[:export_options] ||= {}
43
- if values[:export_options].kind_of?(Hash)
44
- # It's not always a hash, because the user might have passed a string path to a ready plist file
45
- # If that's the case, we won't set the provisioning profiles
46
- # see https://github.com/fastlane/fastlane/issues/9684
47
- values[:export_options][:provisioningProfiles] ||= {}
48
- Actions.lane_context[SharedValues::SIGH_PROFILE_PATHS].each do |profile_path|
49
- begin
50
- profile = FastlaneCore::ProvisioningProfile.parse(profile_path)
51
- app_id_prefix = profile["ApplicationIdentifierPrefix"].first
52
- bundle_id = profile["Entitlements"]["application-identifier"].gsub("#{app_id_prefix}.", "")
53
- values[:export_options][:provisioningProfiles][bundle_id] = profile["Name"]
54
- rescue => ex
55
- UI.error("Couldn't load profile at path: #{profile_path}")
56
- UI.error(ex)
57
- UI.verbose(ex.backtrace.join("\n"))
58
- end
59
- end
60
- else
61
- self.show_xcode_9_warning
62
- end
3
+ require 'fastlane/actions/build_app'
4
+ class BuildIosAppAction < BuildAppAction
5
+ # Gym::Options.available_options keys that don't apply to ios apps.
6
+ REJECT_OPTIONS = [
7
+ :pkg,
8
+ :skip_package_pkg,
9
+ :catalyst_platform,
10
+ :installer_cert_name
11
+ ]
12
+
13
+ def self.run(params)
14
+ # Adding reject options back in so gym has everything it needs
15
+ params.available_options += Gym::Options.available_options.select do |option|
16
+ REJECT_OPTIONS.include?(option.key)
63
17
  end
64
18
 
65
- gym_output_path = Gym::Manager.new.work(values)
66
- if gym_output_path.nil?
67
- UI.important("No output path received from gym")
68
- return nil
69
- end
70
-
71
- absolute_ipa_path = File.expand_path(gym_output_path)
72
- absolute_dsym_path = absolute_ipa_path.gsub(".ipa", ".app.dSYM.zip")
73
-
74
- # This might be the mac app path, so we don't want to set it here
75
- # https://github.com/fastlane/fastlane/issues/5757
76
- if absolute_ipa_path.include?(".ipa")
77
- Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = absolute_ipa_path
78
- ENV[SharedValues::IPA_OUTPUT_PATH.to_s] = absolute_ipa_path # for deliver
79
- end
80
-
81
- Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] = absolute_dsym_path if File.exist?(absolute_dsym_path)
82
- Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] = Gym::BuildCommandGenerator.archive_path
83
- ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] = absolute_dsym_path if File.exist?(absolute_dsym_path)
84
-
85
- return absolute_ipa_path
86
- end
87
-
88
- def self.description
89
- "Easily build and sign your app (via _gym_)"
90
- end
91
-
92
- def self.details
93
- "More information: https://fastlane.tools/gym"
94
- end
95
-
96
- def self.output
97
- [
98
- ['IPA_OUTPUT_PATH', 'The path to the newly generated ipa file'],
99
- ['DSYM_OUTPUT_PATH', 'The path to the dSYM files'],
100
- ['XCODEBUILD_ARCHIVE', 'The path to the xcodebuild archive']
101
- ]
102
- end
19
+ # Defaulting to ios specific values
20
+ params[:catalyst_platform] = "ios"
103
21
 
104
- def self.return_value
105
- "The absolute path to the generated ipa file"
22
+ super(params)
106
23
  end
107
24
 
108
- def self.author
109
- "KrauseFx"
110
- end
25
+ #####################################################
26
+ # @!group Documentation
27
+ #####################################################
111
28
 
112
29
  def self.available_options
113
30
  require 'gym'
114
- Gym::Options.available_options
115
- end
116
-
117
- def self.is_supported?(platform)
118
- [:ios, :mac].include?(platform)
119
- end
31
+ require 'gym/options'
120
32
 
121
- def self.example_code
122
- [
123
- 'build_ios_app(scheme: "MyApp", workspace: "MyApp.xcworkspace")',
124
- 'build_ios_app(
125
- workspace: "MyApp.xcworkspace",
126
- configuration: "Debug",
127
- scheme: "MyApp",
128
- silent: true,
129
- clean: true,
130
- output_directory: "path/to/dir", # Destination directory. Defaults to current directory.
131
- output_name: "my-app.ipa", # specify the name of the .ipa file to generate (including file extension)
132
- sdk: "iOS 11.1" # use SDK as the name or path of the base SDK when building the project.
133
- )',
134
- 'gym # alias for "build_ios_app"',
135
- 'build_app # alias for "build_ios_app"'
136
- ]
33
+ Gym::Options.available_options.reject do |option|
34
+ REJECT_OPTIONS.include?(option.key)
35
+ end
137
36
  end
138
37
 
139
- def self.category
140
- :building
38
+ def self.is_supported?(platform)
39
+ [:ios].include?(platform)
141
40
  end
142
41
 
143
- def self.show_xcode_9_warning
144
- return unless Helper.xcode_at_least?("9.0")
145
- UI.message("You passed a path to a custom plist file for exporting the binary.")
146
- UI.message("Make sure to include information about what provisioning profiles to use with Xcode 9")
147
- UI.message("More information: https://docs.fastlane.tools/codesigning/xcode-project/#xcode-9-and-up")
42
+ def self.description
43
+ "Alias for the `build_app` action but only for iOS"
148
44
  end
149
45
  end
150
46
  end
@@ -0,0 +1,46 @@
1
+ module Fastlane
2
+ module Actions
3
+ require 'fastlane/actions/build_app'
4
+ class BuildMacAppAction < BuildAppAction
5
+ # Gym::Options.available_options keys that don't apply to mac apps.
6
+ REJECT_OPTIONS = [
7
+ :ipa,
8
+ :skip_package_ipa,
9
+ :catalyst_platform
10
+ ]
11
+
12
+ def self.run(params)
13
+ # Adding reject options back in so gym has everything it needs
14
+ params.available_options += Gym::Options.available_options.select do |option|
15
+ REJECT_OPTIONS.include?(option.key)
16
+ end
17
+
18
+ # Defaulting to mac specific values
19
+ params[:catalyst_platform] = "macos"
20
+
21
+ super(params)
22
+ end
23
+
24
+ #####################################################
25
+ # @!group Documentation
26
+ #####################################################
27
+
28
+ def self.available_options
29
+ require 'gym'
30
+ require 'gym/options'
31
+
32
+ Gym::Options.available_options.reject do |option|
33
+ REJECT_OPTIONS.include?(option.key)
34
+ end
35
+ end
36
+
37
+ def self.is_supported?(platform)
38
+ [:mac].include?(platform)
39
+ end
40
+
41
+ def self.description
42
+ "Alias for the `build_app` action but only for macOS"
43
+ end
44
+ end
45
+ end
46
+ end
@@ -43,6 +43,9 @@ module Fastlane
43
43
  # Add reviewers to pull request
44
44
  add_reviewers(params, number) if params[:reviewers] || params[:team_reviewers]
45
45
 
46
+ # Add a milestone to pull request
47
+ add_milestone(params, number) if params[:milestone]
48
+
46
49
  Actions.lane_context[SharedValues::CREATE_PULL_REQUEST_HTML_URL] = html_url
47
50
  Actions.lane_context[SharedValues::CREATE_PULL_REQUEST_NUMBER] = number
48
51
  return html_url
@@ -111,6 +114,27 @@ module Fastlane
111
114
  )
112
115
  end
113
116
 
117
+ def self.add_milestone(params, number)
118
+ payload = {}
119
+ if params[:milestone]
120
+ payload["milestone"] = params[:milestone]
121
+ end
122
+
123
+ GithubApiAction.run(
124
+ server_url: params[:api_url],
125
+ api_token: params[:api_token],
126
+ http_method: 'PATCH',
127
+ path: "repos/#{params[:repo]}/issues/#{number}",
128
+ body: payload,
129
+ error_handlers: {
130
+ '*' => proc do |result|
131
+ UI.error("GitHub responded with #{result[:status]}: #{result[:body]}")
132
+ return nil
133
+ end
134
+ }
135
+ )
136
+ end
137
+
114
138
  #####################################################
115
139
  # @!group Documentation
116
140
  #####################################################
@@ -157,6 +181,11 @@ module Fastlane
157
181
  description: "The labels for the pull request",
158
182
  type: Array,
159
183
  optional: true),
184
+ FastlaneCore::ConfigItem.new(key: :milestone,
185
+ env_name: "GITHUB_PULL_REQUEST_MILESTONE",
186
+ description: "The milestone ID (Integer) for the pull request",
187
+ type: Numeric,
188
+ optional: true),
160
189
  FastlaneCore::ConfigItem.new(key: :head,
161
190
  env_name: "GITHUB_PULL_REQUEST_HEAD",
162
191
  description: "The name of the branch where your changes are implemented (defaults to the current branch name)",
@@ -146,7 +146,7 @@ export_options({
146
146
  Optional: If _gym_ can't automatically detect the provisioning profiles to use, you can pass a mapping of bundle identifiers to provisioning profiles:
147
147
 
148
148
  ```ruby
149
- build_ios_app(
149
+ build_app(
150
150
  scheme: "Release",
151
151
  export_options: {
152
152
  method: "app-store",
@@ -1,13 +1,9 @@
1
1
  module Fastlane
2
2
  module Actions
3
- require 'fastlane/actions/build_ios_app'
4
- class GymAction < BuildIosAppAction
5
- #####################################################
6
- # @!group Documentation
7
- #####################################################
8
-
3
+ require 'fastlane/actions/build_app'
4
+ class GymAction < BuildAppAction
9
5
  def self.description
10
- "Alias for the `build_ios_app` action"
6
+ "Alias for the `build_app` action"
11
7
  end
12
8
  end
13
9
  end
@@ -26,6 +26,10 @@ module Fastlane
26
26
  description: "The branch or tag to check-out on the repository",
27
27
  default_value: 'HEAD',
28
28
  optional: true),
29
+ FastlaneCore::ConfigItem.new(key: :dependencies,
30
+ description: "The array of additional Fastfiles in the repository",
31
+ default_value: [],
32
+ optional: true),
29
33
  FastlaneCore::ConfigItem.new(key: :path,
30
34
  description: "The path of the Fastfile in the repository",
31
35
  default_value: 'fastlane/Fastfile',
@@ -241,7 +241,7 @@ module Fastlane
241
241
  end
242
242
 
243
243
  def self.return_type
244
- :hash_of_strings
244
+ :hash
245
245
  end
246
246
 
247
247
  def self.authors
@@ -39,7 +39,7 @@ module Fastlane
39
39
  end
40
40
 
41
41
  def self.details
42
- "This action allows you to modify any `plist` file."
42
+ "This action allows you to modify any value inside any `plist` file."
43
43
  end
44
44
 
45
45
  def self.available_options
@@ -57,11 +57,46 @@ module Fastlane
57
57
  end
58
58
 
59
59
  def self.author
60
- 'rishabhtayal'
60
+ ["rishabhtayal", "matthiaszarzecki"]
61
61
  end
62
62
 
63
63
  def self.example_code
64
64
  [
65
+ 'update_plist( # Updates the CLIENT_ID and GOOGLE_APP_ID string entries in the plist-file
66
+ plist_path: "path/to/your_plist_file.plist",
67
+ block: proc do |plist|
68
+ plist[:CLIENT_ID] = "new_client_id"
69
+ plist[:GOOGLE_APP_ID] = "new_google_app_id"
70
+ end
71
+ )',
72
+ 'update_plist( # Sets a boolean entry
73
+ plist_path: "path/to/your_plist_file.plist",
74
+ block: proc do |plist|
75
+ plist[:boolean_entry] = true
76
+ end
77
+ )',
78
+ 'update_plist( # Sets a number entry
79
+ plist_path: "path/to/your_plist_file.plist",
80
+ block: proc do |plist|
81
+ plist[:number_entry] = 13
82
+ end
83
+ )',
84
+ 'update_plist( # Sets an array-entry with multiple sub-types
85
+ plist_path: "path/to/your_plist_file.plist",
86
+ block: proc do |plist|
87
+ plist[:array_entry] = ["entry_01", true, 1243]
88
+ end
89
+ )',
90
+ 'update_plist( # The block can contain logic too
91
+ plist_path: "path/to/your_plist_file.plist",
92
+ block: proc do |plist|
93
+ if options[:environment] == "production"
94
+ plist[:CLIENT_ID] = "new_client_id_production"
95
+ else
96
+ plist[:CLIENT_ID] = "new_client_id_development"
97
+ end
98
+ end
99
+ )',
65
100
  'update_plist( # Advanced processing: find URL scheme for particular key and replace value
66
101
  plist_path: "path/to/Info.plist",
67
102
  block: proc do |plist|
@@ -11,6 +11,7 @@ module Fastlane
11
11
  config.load_configuration_file("Deliverfile")
12
12
  config[:screenshots_path] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] if Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
13
13
  config[:ipa] = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
14
+ config[:pkg] = Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
14
15
 
15
16
  return config if Helper.test?
16
17
  Deliver::Runner.new(config).run
@@ -263,7 +263,7 @@ module Fastlane
263
263
  # @param branch [String] The branch to checkout in the repository
264
264
  # @param path [String] The path to the Fastfile
265
265
  # @param version [String, Array] Version requirement for repo tags
266
- def import_from_git(url: nil, branch: 'HEAD', path: 'fastlane/Fastfile', version: nil)
266
+ def import_from_git(url: nil, branch: 'HEAD', path: 'fastlane/Fastfile', version: nil, dependencies: [])
267
267
  UI.user_error!("Please pass a path to the `import_from_git` action") if url.to_s.length == 0
268
268
 
269
269
  Actions.execute_action('import_from_git') do
@@ -280,6 +280,10 @@ module Fastlane
280
280
 
281
281
  branch_option = "--branch #{branch}" if branch != 'HEAD'
282
282
 
283
+ checkout_dependencies = dependencies.map(&:shellescape).join(" ")
284
+
285
+ checkout_path = "#{path.shellescape} #{checkout_dependencies}"
286
+
283
287
  UI.message("Cloning remote git repo...")
284
288
  Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
285
289
  Actions.sh("git clone #{url.shellescape} #{clone_folder.shellescape} --depth 1 -n #{branch_option}")
@@ -292,7 +296,7 @@ module Fastlane
292
296
  UI.user_error!("No tag found matching #{version.inspect}") if checkout_param.nil?
293
297
  end
294
298
 
295
- Actions.sh("cd #{clone_folder.shellescape} && git checkout #{checkout_param.shellescape} #{path.shellescape}")
299
+ Actions.sh("cd #{clone_folder.shellescape} && git checkout #{checkout_param.shellescape} #{checkout_path}")
296
300
 
297
301
  # We also want to check out all the local actions of this fastlane setup
298
302
  containing = path.split(File::SEPARATOR)[0..-2]
@@ -304,7 +308,13 @@ module Fastlane
304
308
  # We don't care about a failure here, as local actions are optional
305
309
  end
306
310
 
307
- return_value = import(File.join(clone_folder, path))
311
+ return_value = nil
312
+ if dependencies.any?
313
+ return_value = [import(File.join(clone_folder, path))]
314
+ return_value += dependencies.map { |file_path| import(File.join(clone_folder, file_path)) }
315
+ else
316
+ return_value = import(File.join(clone_folder, path))
317
+ end
308
318
 
309
319
  action_completed('import_from_git', status: FastlaneCore::ActionCompletionStatus::SUCCESS)
310
320
 
@@ -157,7 +157,9 @@ CrossPlatform/ForkUsage:
157
157
  - "**/plugins/template/**/*"
158
158
  Lint/IsStringUsage:
159
159
  Include:
160
+ - cert/**/*
160
161
  - gym/**/*
162
+ - match/**/*
161
163
  - screengrab/**/*
162
164
  - supply/**/*
163
165
  Style/MethodCallWithArgsParentheses:
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.140.0'.freeze
2
+ VERSION = '2.141.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze