fastlane 2.170.0 → 2.175.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +74 -74
  3. data/cert/lib/cert/options.rb +2 -2
  4. data/deliver/lib/deliver/app_screenshot.rb +5 -7
  5. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  6. data/deliver/lib/deliver/commands_generator.rb +1 -1
  7. data/deliver/lib/deliver/loader.rb +13 -29
  8. data/deliver/lib/deliver/options.rb +2 -2
  9. data/deliver/lib/deliver/setup.rb +8 -3
  10. data/deliver/lib/deliver/upload_metadata.rb +2 -0
  11. data/deliver/lib/deliver/upload_screenshots.rb +2 -1
  12. data/fastlane/lib/fastlane/actions/adb.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/add_git_tag.rb +12 -3
  14. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +2 -2
  15. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -0
  16. data/fastlane/lib/fastlane/actions/appetize.rb +13 -1
  17. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  18. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +10 -2
  19. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  20. data/fastlane/lib/fastlane/actions/carthage.rb +22 -0
  21. data/fastlane/lib/fastlane/actions/cocoapods.rb +15 -1
  22. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  23. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  24. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +1 -1
  25. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  26. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +8 -2
  27. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +5 -1
  28. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  29. data/fastlane/lib/fastlane/actions/download_dsyms.rb +5 -16
  30. data/fastlane/lib/fastlane/actions/git_commit.rb +7 -3
  31. data/fastlane/lib/fastlane/actions/github_api.rb +14 -3
  32. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -2
  33. data/fastlane/lib/fastlane/actions/nexus_upload.rb +1 -0
  34. data/fastlane/lib/fastlane/actions/pod_push.rb +9 -0
  35. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -1
  36. data/fastlane/lib/fastlane/actions/register_device.rb +3 -3
  37. data/fastlane/lib/fastlane/actions/register_devices.rb +4 -3
  38. data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -2
  39. data/fastlane/lib/fastlane/actions/set_github_release.rb +21 -8
  40. data/fastlane/lib/fastlane/actions/slack.rb +4 -5
  41. data/fastlane/lib/fastlane/actions/spm.rb +2 -2
  42. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  43. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +1 -1
  44. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +4 -2
  45. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  46. data/fastlane/lib/fastlane/documentation/actions_list.rb +2 -2
  47. data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
  48. data/fastlane/lib/fastlane/helper/gem_helper.rb +2 -2
  49. data/fastlane/lib/fastlane/version.rb +1 -1
  50. data/fastlane/swift/Actions.swift +1 -1
  51. data/fastlane/swift/Appfile.swift +1 -1
  52. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  53. data/fastlane/swift/ControlCommand.swift +1 -1
  54. data/fastlane/swift/Deliverfile.swift +2 -2
  55. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  56. data/fastlane/swift/Fastlane.swift +213 -38
  57. data/fastlane/swift/Gymfile.swift +2 -2
  58. data/fastlane/swift/GymfileProtocol.swift +11 -3
  59. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  60. data/fastlane/swift/MainProcess.swift +1 -1
  61. data/fastlane/swift/Matchfile.swift +2 -2
  62. data/fastlane/swift/MatchfileProtocol.swift +2 -2
  63. data/fastlane/swift/Plugins.swift +1 -1
  64. data/fastlane/swift/Precheckfile.swift +2 -2
  65. data/fastlane/swift/PrecheckfileProtocol.swift +6 -2
  66. data/fastlane/swift/RubyCommand.swift +1 -1
  67. data/fastlane/swift/RubyCommandable.swift +1 -1
  68. data/fastlane/swift/Runner.swift +2 -2
  69. data/fastlane/swift/RunnerArgument.swift +1 -1
  70. data/fastlane/swift/Scanfile.swift +2 -2
  71. data/fastlane/swift/ScanfileProtocol.swift +14 -2
  72. data/fastlane/swift/Screengrabfile.swift +2 -2
  73. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  74. data/fastlane/swift/Snapshotfile.swift +2 -2
  75. data/fastlane/swift/SnapshotfileProtocol.swift +15 -3
  76. data/fastlane/swift/SocketClient.swift +1 -1
  77. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  78. data/fastlane/swift/SocketResponse.swift +1 -1
  79. data/fastlane/swift/formatting/Brewfile.lock.json +20 -14
  80. data/fastlane/swift/main.swift +1 -1
  81. data/fastlane_core/lib/fastlane_core/command_executor.rb +3 -9
  82. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +1 -1
  83. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +23 -0
  84. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +9 -5
  85. data/fastlane_core/lib/fastlane_core/helper.rb +28 -7
  86. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  87. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -4
  88. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +1 -1
  89. data/fastlane_core/lib/fastlane_core/project.rb +41 -14
  90. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +2 -2
  91. data/frameit/lib/frameit/device_types.rb +7 -1
  92. data/gym/lib/gym/error_handler.rb +8 -0
  93. data/gym/lib/gym/generators/build_command_generator.rb +3 -1
  94. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  95. data/gym/lib/gym/options.rb +12 -2
  96. data/match/lib/match/encryption/openssl.rb +4 -2
  97. data/match/lib/match/nuke.rb +5 -0
  98. data/match/lib/match/options.rb +2 -2
  99. data/match/lib/match/storage/git_storage.rb +14 -10
  100. data/pilot/lib/pilot/options.rb +2 -2
  101. data/precheck/lib/precheck/options.rb +8 -3
  102. data/precheck/lib/precheck/rule_processor.rb +1 -1
  103. data/precheck/lib/precheck/runner.rb +1 -1
  104. data/scan/lib/scan/options.rb +15 -0
  105. data/scan/lib/scan/runner.rb +6 -1
  106. data/scan/lib/scan/slack_poster.rb +4 -1
  107. data/scan/lib/scan/test_command_generator.rb +3 -1
  108. data/screengrab/lib/screengrab/android_environment.rb +2 -2
  109. data/screengrab/lib/screengrab/runner.rb +2 -0
  110. data/sigh/lib/sigh/options.rb +2 -2
  111. data/sigh/lib/sigh/runner.rb +1 -1
  112. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  113. data/snapshot/lib/snapshot/options.rb +17 -2
  114. data/snapshot/lib/snapshot/update.rb +1 -1
  115. data/spaceship/README.md +2 -2
  116. data/spaceship/lib/spaceship/client.rb +14 -1
  117. data/spaceship/lib/spaceship/connect_api/api_client.rb +17 -2
  118. data/spaceship/lib/spaceship/connect_api/models/app.rb +6 -0
  119. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +7 -1
  120. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  121. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +24 -0
  122. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +26 -4
  123. data/spaceship/lib/spaceship/connect_api/models/device.rb +26 -0
  124. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +53 -0
  125. data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
  126. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  127. data/spaceship/lib/spaceship/connect_api/token.rb +1 -1
  128. data/spaceship/lib/spaceship/playground.rb +2 -2
  129. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  130. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +1 -0
  131. data/spaceship/lib/spaceship/upgrade_2fa_later_client.rb +91 -0
  132. metadata +51 -21
  133. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  134. data/spaceship/lib/spaceship/connect_api/models/.app_data_usage_data_protection.rb.swp +0 -0
@@ -0,0 +1,118 @@
1
+ module Fastlane
2
+ module Actions
3
+ module SharedValues
4
+ XCFRAMEWORK_PATH ||= :XCFRAMEWORK_PATH
5
+ end
6
+
7
+ class CreateXcframeworkAction < Action
8
+ def self.run(params)
9
+ UI.user_error!("Please provide either :frameworks or :libraries to be packaged into the xcframework") unless params[:frameworks] || params[:libraries]
10
+
11
+ create_command = ['xcodebuild', '-create-xcframework']
12
+ create_command << params[:frameworks].map { |framework| ['-framework', "\"#{framework}\""] }.flatten if params[:frameworks]
13
+ create_command << params[:libraries].map { |library, headers| ['-library', "\"#{library}\""] + (headers.empty? ? [] : ['-headers', "\"#{headers}\""]) } if params[:libraries]
14
+ create_command << ['-output', "\"#{params[:output]}\""]
15
+ create_command << ['-allow-internal-distribution'] if params[:allow_internal_distribution]
16
+
17
+ Actions.lane_context[SharedValues::XCFRAMEWORK_PATH] = params[:output]
18
+
19
+ sh(create_command)
20
+ end
21
+
22
+ #####################################################
23
+ # @!group Documentation
24
+ #####################################################
25
+
26
+ def self.description
27
+ "Package multiple build configs of a library/framework into a single xcframework"
28
+ end
29
+
30
+ def self.details
31
+ <<~DETAILS
32
+ Utility for packaging multiple build configurations of a given library
33
+ or framework into a single xcframework.
34
+
35
+ If you want to package several frameworks just provide an array containing
36
+ the list of frameworks to be packaged using the :frameworks parameter.
37
+
38
+ If you want to package several libraries with their corresponding headers
39
+ provide a hash containing the library as the key and the directory containing
40
+ its headers as the value (or an empty string if there are no headers associated
41
+ with the provided library).
42
+
43
+ Finally specify the location of the xcframework to be generated using the :output
44
+ parameter.
45
+ DETAILS
46
+ end
47
+
48
+ def self.available_options
49
+ [
50
+ FastlaneCore::ConfigItem.new(key: :frameworks,
51
+ env_name: "FL_CREATE_XCFRAMEWORK_FRAMEWORKS",
52
+ description: "Frameworks to add to the target xcframework",
53
+ type: Array,
54
+ optional: true,
55
+ conflicting_options: [:libraries],
56
+ verify_block: proc do |value|
57
+ value.each do |framework|
58
+ UI.user_error!("#{framework} doesn't end with '.framework'. Is this really a framework?") unless framework.end_with?('.framework')
59
+ UI.user_error!("Couldn't find framework at #{framework}") unless File.exist?(framework)
60
+ UI.user_error!("#{framework} doesn't seem to be a framework") unless File.directory?(framework)
61
+ end
62
+ end),
63
+ FastlaneCore::ConfigItem.new(key: :libraries,
64
+ env_name: "FL_CREATE_XCFRAMEWORK_LIBRARIES",
65
+ description: "Libraries to add to the target xcframework, with their corresponding headers",
66
+ type: Hash,
67
+ optional: true,
68
+ conflicting_options: [:frameworks],
69
+ verify_block: proc do |value|
70
+ value.each do |library, headers|
71
+ UI.user_error!("Couldn't find library at #{library}") unless File.exist?(library)
72
+ UI.user_error!("#{headers} doesn't exist or is not a directory") unless headers.empty? || File.directory?(headers)
73
+ end
74
+ end),
75
+ FastlaneCore::ConfigItem.new(key: :output,
76
+ env_name: "FL_CREATE_XCFRAMEWORK_OUTPUT",
77
+ description: "The path to write the xcframework to",
78
+ type: String,
79
+ optional: false),
80
+ FastlaneCore::ConfigItem.new(key: :allow_internal_distribution,
81
+ env_name: "FL_CREATE_XCFRAMEWORK_ALLOW_INTERNAL_DISTRIBUTION",
82
+ description: "Specifies that the created xcframework contains information not suitable for public distribution",
83
+ type: Boolean,
84
+ optional: true,
85
+ default_value: false)
86
+ ]
87
+ end
88
+
89
+ def self.output
90
+ [
91
+ ['XCFRAMEWORK_PATH', 'Location of the generated xcframework']
92
+ ]
93
+ end
94
+
95
+ def self.return_value
96
+ end
97
+
98
+ def self.example_code
99
+ [
100
+ "create_xcframework(frameworks: ['FrameworkA.framework', 'FrameworkB.framework'], output: 'UniversalFramework.xcframework')",
101
+ "create_xcframework(libraries: { 'LibraryA.so' => '', 'LibraryB.so' => 'LibraryBHeaders'}, output: 'UniversalFramework.xcframework')"
102
+ ]
103
+ end
104
+
105
+ def self.category
106
+ :building
107
+ end
108
+
109
+ def self.authors
110
+ ["jgongo"]
111
+ end
112
+
113
+ def self.is_supported?(platform)
114
+ [:ios, :mac].include?(platform)
115
+ end
116
+ end
117
+ end
118
+ end
@@ -21,7 +21,7 @@ _screengrab_ generates localized screenshots of your Android app for different d
21
21
  Install the gem
22
22
 
23
23
  ```no-highlight
24
- sudo gem install fastlane
24
+ gem install fastlane
25
25
  ```
26
26
 
27
27
  ##### Gradle dependency
@@ -345,5 +345,5 @@ brew install imagemagick
345
345
 
346
346
  ## Uninstall
347
347
 
348
- - `sudo gem uninstall fastlane`
348
+ - `gem uninstall fastlane`
349
349
  - `rm -rf ~/.frameit`
@@ -99,16 +99,22 @@ If your machine is currently using SSH to authenticate with GitHub, you'll want
99
99
  Using parameter:
100
100
 
101
101
  ```
102
- match(git_basic_authorization: '<YOUR KEY>')
102
+ match(git_basic_authorization: '<YOUR BASE64 KEY>')
103
103
  ```
104
104
 
105
105
  Using environment variable:
106
106
 
107
107
  ```
108
- ENV['MATCH_GIT_BASIC_AUTHORIZATION'] = '<YOUR KEY>'
108
+ ENV['MATCH_GIT_BASIC_AUTHORIZATION'] = '<YOUR BASE64 KEY>'
109
109
  match
110
110
  ```
111
111
 
112
+ To generate your base64 key [according to RFC 7617](https://tools.ietf.org/html/rfc7617), run this:
113
+
114
+ ```
115
+ echo -n your_github_username:your_personal_access_token | base64
116
+ ```
117
+
112
118
  You can find more information about GitHub basic authentication and personal token generation here: [https://developer.github.com/v3/auth/#basic-authentication](https://developer.github.com/v3/auth/#basic-authentication)
113
119
 
114
120
  ##### Git Storage on GitHub - Deploy keys
@@ -218,7 +218,7 @@ fastlane pilot upload --verbose
218
218
 
219
219
  ## Firewall Issues
220
220
 
221
- _pilot_ uses the iTunes Transporter to upload metadata and binaries. In case you are behind a firewall, you can specify a different transporter protocol from the command line using
221
+ _pilot_ uses the iTunes [Transporter](https://help.apple.com/itc/transporteruserguide/#/apdATD1E1288-D1E1A1303-D1E1288A1126) to upload metadata and binaries. In case you are behind a firewall, you can specify a different transporter protocol from the command line using
222
222
 
223
223
  ```no-highlight
224
224
  DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="-t DAV" pilot ...
@@ -231,6 +231,10 @@ ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-t DAV"
231
231
  pilot...
232
232
  ```
233
233
 
234
+ Note, however, that Apple recommends you don’t specify the `-t transport` and instead allow Transporter to use automatic transport discovery to determine the best transport mode for your packages. For this reason, if the `t` option is passed, we will raise a warning.
235
+
236
+ Also note that `-t` is not the only additional parameter that can be used. The string specified in the `DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS` environment variable will be forwarded to Transporter. For all the available options, check [Apple's Transporter User Guide](https://help.apple.com/itc/transporteruserguide/#/apdATD1E1288-D1E1A1303-D1E1288A1126).
237
+
234
238
  ## Credentials Issues
235
239
 
236
240
  If your password contains special characters, _pilot_ may throw a confusing error saying your "Your Apple ID or password was entered incorrectly". The easiest way to fix this error is to change your password to something that **does not** contains special characters.
@@ -0,0 +1,142 @@
1
+ module Fastlane
2
+ module Actions
3
+ class DownloadAppPrivacyDetailsFromAppStoreAction < Action
4
+ DEFAULT_PATH = Fastlane::Helper.fastlane_enabled_folder_path
5
+ DEFAULT_FILE_NAME = "app_privacy_details.json"
6
+
7
+ def self.run(params)
8
+ require 'spaceship'
9
+
10
+ # Prompts select team if multiple teams and none specified
11
+ UI.message("Login to App Store Connect (#{params[:username]})")
12
+ Spaceship::ConnectAPI.login(params[:username], use_portal: false, use_tunes: true, tunes_team_id: params[:team_id], team_name: params[:team_name])
13
+ UI.message("Login successful")
14
+
15
+ # Get App
16
+ app = Spaceship::ConnectAPI::App.find(params[:app_identifier])
17
+ unless app
18
+ UI.user_error!("Could not find app with bundle identifier '#{params[:app_identifier]}' on account #{params[:username]}")
19
+ end
20
+
21
+ # Download usages and return a config
22
+ raw_usages = download_app_data_usages(params, app)
23
+
24
+ usages_config = []
25
+ if raw_usages.count == 1 && raw_usages.first.data_protection.id == Spaceship::ConnectAPI::AppDataUsageDataProtection::ID::DATA_NOT_COLLECTED
26
+ usages_config << {
27
+ "data_protections" => [Spaceship::ConnectAPI::AppDataUsageDataProtection::ID::DATA_NOT_COLLECTED]
28
+ }
29
+ else
30
+ grouped_usages = raw_usages.group_by do |usage|
31
+ usage.category.id
32
+ end
33
+ grouped_usages.sort_by(&:first).each do |key, usage_group|
34
+ purposes = usage_group.map(&:purpose).compact || []
35
+ data_protections = usage_group.map(&:data_protection).compact || []
36
+ usages_config << {
37
+ "category" => key,
38
+ "purposes" => purposes.map(&:id).sort.uniq,
39
+ "data_protections" => data_protections.map(&:id).sort.uniq
40
+ }
41
+ end
42
+ end
43
+
44
+ # Save to JSON file
45
+ json = JSON.pretty_generate(usages_config)
46
+ path = output_path(params)
47
+
48
+ UI.message("Writing file to #{path}")
49
+ File.write(path, json)
50
+ end
51
+
52
+ def self.output_path(params)
53
+ path = params[:output_json_path]
54
+ return File.absolute_path(path)
55
+ end
56
+
57
+ def self.download_app_data_usages(params, app)
58
+ UI.message("Downloading App Data Usage")
59
+
60
+ # Delete all existing usages for new ones
61
+ Spaceship::ConnectAPI::AppDataUsage.all(app_id: app.id, includes: "category,grouping,purpose,dataProtection", limit: 500)
62
+ end
63
+
64
+ def self.description
65
+ "Download App Privacy Details from an app in App Store Connect"
66
+ end
67
+
68
+ def self.available_options
69
+ user = CredentialsManager::AppfileConfig.try_fetch_value(:itunes_connect_id)
70
+ user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
71
+
72
+ [
73
+ FastlaneCore::ConfigItem.new(key: :username,
74
+ env_name: "FASTLANE_USER",
75
+ description: "Your Apple ID Username for App Store Connect",
76
+ default_value: user,
77
+ default_value_dynamic: true),
78
+ FastlaneCore::ConfigItem.new(key: :app_identifier,
79
+ env_name: "UPLOAD_APP_PRIVACY_DETAILS_TO_APP_STORE_APP_IDENTIFIER",
80
+ description: "The bundle identifier of your app",
81
+ code_gen_sensitive: true,
82
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
83
+ default_value_dynamic: true),
84
+ FastlaneCore::ConfigItem.new(key: :team_id,
85
+ env_name: "FASTLANE_ITC_TEAM_ID",
86
+ description: "The ID of your App Store Connect team if you're in multiple teams",
87
+ optional: true,
88
+ is_string: false, # as we also allow integers, which we convert to strings anyway
89
+ code_gen_sensitive: true,
90
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
91
+ default_value_dynamic: true),
92
+ FastlaneCore::ConfigItem.new(key: :team_name,
93
+ env_name: "FASTLANE_ITC_TEAM_NAME",
94
+ description: "The name of your App Store Connect team if you're in multiple teams",
95
+ optional: true,
96
+ code_gen_sensitive: true,
97
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
98
+ default_value_dynamic: true),
99
+
100
+ # JSON paths
101
+ FastlaneCore::ConfigItem.new(key: :output_json_path,
102
+ env_name: "UPLOAD_APP_PRIVACY_DETAILS_TO_APP_STORE_OUTPUT_JSON_PATH",
103
+ description: "Path to the app usage data JSON file generated by interactive questions",
104
+ conflicting_options: [:skip_json_file_saving],
105
+ default_value: File.join(DEFAULT_PATH, DEFAULT_FILE_NAME))
106
+ ]
107
+ end
108
+
109
+ def self.author
110
+ "igor-makarov"
111
+ end
112
+
113
+ def self.is_supported?(platform)
114
+ [:ios, :mac, :tvos].include?(platform)
115
+ end
116
+
117
+ def self.details
118
+ "Download App Privacy Details from an app in App Store Connect. For more detail information, view https://docs.fastlane.tools/uploading-app-privacy-details"
119
+ end
120
+
121
+ def self.example_code
122
+ [
123
+ 'download_app_privacy_details_from_app_store(
124
+ username: "your@email.com",
125
+ team_name: "Your Team",
126
+ app_identifier: "com.your.bundle"
127
+ )',
128
+ 'download_app_privacy_details_from_app_store(
129
+ username: "your@email.com",
130
+ team_name: "Your Team",
131
+ app_identifier: "com.your.bundle",
132
+ output_json_path: "fastlane/app_data_usages.json"
133
+ )'
134
+ ]
135
+ end
136
+
137
+ def self.category
138
+ :production
139
+ end
140
+ end
141
+ end
142
+ end
@@ -39,13 +39,8 @@ module Fastlane
39
39
  # Set version if it is latest
40
40
  if version == 'latest'
41
41
  # Try to grab the edit version first, else fallback to live version
42
- UI.message("Looking for latest version...")
43
- latest_version = app.get_edit_app_store_version(platform: platform) || app.get_live_app_store_version(platform: platform)
44
-
45
- UI.user_error!("Could not find latest version for your app, please try setting a specific version") if latest_version.nil?
46
-
47
- latest_build = get_latest_build!(app_id: app.id, version: latest_version.version_string, platform: platform)
48
-
42
+ UI.message("Looking for latest build...")
43
+ latest_build = get_latest_build!(app_id: app.id, platform: platform)
49
44
  version = latest_build.app_version
50
45
  build_number = latest_build.version
51
46
  elsif version == 'live'
@@ -59,11 +54,6 @@ module Fastlane
59
54
  build_number = live_version.build.version
60
55
  end
61
56
 
62
- # Remove leading zeros from version string (eg. 1.02 -> 1.2)
63
- if version
64
- version = version.split(".").map(&:to_i).join(".")
65
- end
66
-
67
57
  # Make sure output_directory has a slash on the end
68
58
  if output_directory && !output_directory.end_with?('/')
69
59
  output_directory += '/'
@@ -161,14 +151,14 @@ module Fastlane
161
151
  end
162
152
  # rubocop:enable Metrics/PerceivedComplexity
163
153
 
164
- def self.get_latest_build!(app_id: nil, version: nil, platform: nil)
154
+ def self.get_latest_build!(app_id: nil, platform: nil)
165
155
  filter = { app: app_id }
166
- filter["preReleaseVersion.version"] = version
167
156
  filter["preReleaseVersion.platform"] = platform
168
157
  latest_build = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion").first
169
158
 
170
159
  if latest_build.nil?
171
- UI.user_error!("Could not find latest build for version #{version}")
160
+ UI.user_error!("Could not find any build for platform #{platform}") if platform
161
+ UI.user_error!("Could not find any build")
172
162
  end
173
163
 
174
164
  return latest_build
@@ -285,7 +275,6 @@ module Fastlane
285
275
  short_option: "-p",
286
276
  env_name: "DOWNLOAD_DSYMS_PLATFORM",
287
277
  description: "The app platform for dSYMs you wish to download (ios, appletvos)",
288
- optional: true,
289
278
  default_value: :ios),
290
279
  FastlaneCore::ConfigItem.new(key: :version,
291
280
  short_option: "-v",
@@ -11,7 +11,11 @@ module Fastlane
11
11
  skip_git_hooks = params[:skip_git_hooks] ? '--no-verify' : ''
12
12
 
13
13
  if params[:allow_nothing_to_commit]
14
- repo_clean = Actions.sh("git status --porcelain").empty?
14
+ # Here we check if the path passed in parameter contains any modification
15
+ # and we skip the `git commit` command if there is none.
16
+ # That means you can have other files modified that are not in the path parameter
17
+ # and still make use of allow_nothing_to_commit.
18
+ repo_clean = Actions.sh("git status #{paths} --porcelain").empty?
15
19
  UI.success("Nothing to commit, working tree clean ✅.") if repo_clean
16
20
  return if repo_clean
17
21
  end
@@ -33,7 +37,7 @@ module Fastlane
33
37
  def self.available_options
34
38
  [
35
39
  FastlaneCore::ConfigItem.new(key: :path,
36
- description: "The file you want to commit",
40
+ description: "The file(s) or directory(ies) you want to commit. You can pass an array of multiple file-paths or fileglobs \"*.txt\" to commit all matching files. The files already staged but not specified and untracked files won't be committed",
37
41
  is_string: false),
38
42
  FastlaneCore::ConfigItem.new(key: :message,
39
43
  description: "The commit message that should be used"),
@@ -42,7 +46,7 @@ module Fastlane
42
46
  type: Boolean,
43
47
  optional: true),
44
48
  FastlaneCore::ConfigItem.new(key: :allow_nothing_to_commit,
45
- description: "Set to true to allow commit without any git changes",
49
+ description: "Set to true to allow commit without any git changes in the files you want to commit",
46
50
  type: Boolean,
47
51
  optional: true)
48
52
  ]
@@ -13,7 +13,7 @@ module Fastlane
13
13
 
14
14
  http_method = (params[:http_method] || 'GET').to_s.upcase
15
15
  url = construct_url(params[:server_url], params[:path], params[:url])
16
- headers = construct_headers(params[:api_token], params[:headers])
16
+ headers = construct_headers(params[:api_token], params[:api_bearer], params[:headers])
17
17
  payload = construct_body(params[:body], params[:raw_body])
18
18
  error_handlers = params[:error_handlers] || {}
19
19
  secure = params[:secure]
@@ -89,12 +89,22 @@ module Fastlane
89
89
  FastlaneCore::ConfigItem.new(key: :api_token,
90
90
  env_name: "FL_GITHUB_API_TOKEN",
91
91
  description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens",
92
+ conflicting_options: [:api_bearer],
92
93
  sensitive: true,
93
94
  code_gen_sensitive: true,
94
95
  is_string: true,
95
96
  default_value: ENV["GITHUB_API_TOKEN"],
96
97
  default_value_dynamic: true,
97
- optional: false),
98
+ optional: true),
99
+ FastlaneCore::ConfigItem.new(key: :api_bearer,
100
+ env_name: "FL_GITHUB_API_BEARER",
101
+ sensitive: true,
102
+ code_gen_sensitive: true,
103
+ is_string: true,
104
+ description: "Use a Bearer authorization token. Usually generated by Github Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable",
105
+ conflicting_options: [:api_token],
106
+ optional: true,
107
+ default_value: nil),
98
108
  FastlaneCore::ConfigItem.new(key: :http_method,
99
109
  env_name: "FL_GITHUB_API_HTTP_METHOD",
100
110
  description: "The HTTP method. e.g. GET / POST",
@@ -202,10 +212,11 @@ module Fastlane
202
212
 
203
213
  private
204
214
 
205
- def construct_headers(api_token, overrides)
215
+ def construct_headers(api_token, api_bearer, overrides)
206
216
  require 'base64'
207
217
  headers = { 'User-Agent' => 'fastlane-github_api' }
208
218
  headers['Authorization'] = "Basic #{Base64.strict_encode64(api_token)}" if api_token
219
+ headers['Authorization'] = "Bearer #{api_bearer}" if api_bearer
209
220
  headers.merge(overrides || {})
210
221
  end
211
222