fastlane 2.169.0 → 2.174.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 (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -76
  3. data/deliver/lib/deliver/app_screenshot.rb +5 -7
  4. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  5. data/deliver/lib/deliver/commands_generator.rb +1 -1
  6. data/deliver/lib/deliver/loader.rb +13 -29
  7. data/deliver/lib/deliver/setup.rb +8 -3
  8. data/deliver/lib/deliver/upload_metadata.rb +5 -3
  9. data/fastlane/lib/fastlane/actions/add_git_tag.rb +12 -3
  10. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -0
  11. data/fastlane/lib/fastlane/actions/appetize.rb +13 -1
  12. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  13. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +10 -2
  14. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  15. data/fastlane/lib/fastlane/actions/carthage.rb +22 -0
  16. data/fastlane/lib/fastlane/actions/cocoapods.rb +15 -1
  17. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  18. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  19. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  21. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +5 -1
  22. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  23. data/fastlane/lib/fastlane/actions/download_dsyms.rb +0 -1
  24. data/fastlane/lib/fastlane/actions/git_commit.rb +6 -2
  25. data/fastlane/lib/fastlane/actions/github_api.rb +14 -3
  26. data/fastlane/lib/fastlane/actions/nexus_upload.rb +1 -0
  27. data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
  28. data/fastlane/lib/fastlane/actions/pod_push.rb +9 -0
  29. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -1
  30. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  31. data/fastlane/lib/fastlane/actions/register_devices.rb +2 -1
  32. data/fastlane/lib/fastlane/actions/set_github_release.rb +21 -8
  33. data/fastlane/lib/fastlane/actions/slack.rb +4 -5
  34. data/fastlane/lib/fastlane/actions/spm.rb +2 -2
  35. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  36. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +291 -0
  37. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  38. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -1
  39. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
  40. data/fastlane/lib/fastlane/version.rb +1 -1
  41. data/fastlane/swift/Actions.swift +1 -1
  42. data/fastlane/swift/Appfile.swift +1 -1
  43. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  44. data/fastlane/swift/ControlCommand.swift +1 -1
  45. data/fastlane/swift/Deliverfile.swift +2 -2
  46. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  47. data/fastlane/swift/Fastlane.swift +253 -37
  48. data/fastlane/swift/Gymfile.swift +2 -2
  49. data/fastlane/swift/GymfileProtocol.swift +11 -3
  50. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  51. data/fastlane/swift/MainProcess.swift +1 -1
  52. data/fastlane/swift/Matchfile.swift +2 -2
  53. data/fastlane/swift/MatchfileProtocol.swift +2 -2
  54. data/fastlane/swift/Plugins.swift +1 -1
  55. data/fastlane/swift/Precheckfile.swift +2 -2
  56. data/fastlane/swift/PrecheckfileProtocol.swift +6 -2
  57. data/fastlane/swift/RubyCommand.swift +1 -1
  58. data/fastlane/swift/RubyCommandable.swift +1 -1
  59. data/fastlane/swift/Runner.swift +2 -2
  60. data/fastlane/swift/RunnerArgument.swift +1 -1
  61. data/fastlane/swift/Scanfile.swift +2 -2
  62. data/fastlane/swift/ScanfileProtocol.swift +14 -2
  63. data/fastlane/swift/Screengrabfile.swift +2 -2
  64. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  65. data/fastlane/swift/Snapshotfile.swift +2 -2
  66. data/fastlane/swift/SnapshotfileProtocol.swift +15 -3
  67. data/fastlane/swift/SocketClient.swift +1 -1
  68. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  69. data/fastlane/swift/SocketResponse.swift +1 -1
  70. data/fastlane/swift/formatting/Brewfile.lock.json +18 -14
  71. data/fastlane/swift/main.swift +1 -1
  72. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +7 -1
  73. data/fastlane_core/lib/fastlane_core/helper.rb +2 -2
  74. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  75. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -4
  76. data/fastlane_core/lib/fastlane_core/project.rb +41 -14
  77. data/frameit/lib/frameit/device_types.rb +7 -1
  78. data/gym/lib/gym/error_handler.rb +8 -0
  79. data/gym/lib/gym/generators/build_command_generator.rb +3 -1
  80. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  81. data/gym/lib/gym/options.rb +12 -2
  82. data/match/lib/match/encryption/openssl.rb +4 -2
  83. data/match/lib/match/runner.rb +1 -1
  84. data/match/lib/match/storage/git_storage.rb +14 -10
  85. data/precheck/lib/precheck/options.rb +6 -1
  86. data/precheck/lib/precheck/rule_processor.rb +1 -1
  87. data/precheck/lib/precheck/runner.rb +1 -1
  88. data/scan/lib/scan/options.rb +15 -0
  89. data/scan/lib/scan/runner.rb +6 -1
  90. data/scan/lib/scan/slack_poster.rb +4 -1
  91. data/scan/lib/scan/test_command_generator.rb +3 -1
  92. data/screengrab/lib/screengrab/runner.rb +2 -0
  93. data/sigh/lib/sigh/runner.rb +1 -1
  94. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  95. data/snapshot/lib/snapshot/options.rb +17 -2
  96. data/snapshot/lib/snapshot/update.rb +1 -1
  97. data/spaceship/lib/spaceship/client.rb +14 -1
  98. data/spaceship/lib/spaceship/connect_api.rb +6 -0
  99. data/spaceship/lib/spaceship/connect_api/api_client.rb +17 -2
  100. data/spaceship/lib/spaceship/connect_api/models/app.rb +6 -0
  101. data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
  102. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
  103. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
  104. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
  105. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
  106. data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
  107. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +7 -1
  108. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  109. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +24 -0
  110. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +26 -4
  111. data/spaceship/lib/spaceship/connect_api/models/device.rb +30 -0
  112. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +53 -0
  113. data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
  114. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  115. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +103 -0
  116. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +1 -0
  117. data/spaceship/lib/spaceship/upgrade_2fa_later_client.rb +91 -0
  118. metadata +45 -25
  119. data/cert/lib/cert/.options.rb.swp +0 -0
  120. data/cert/lib/cert/.runner.rb.swp +0 -0
  121. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  122. data/match/lib/match/.options.rb.swp +0 -0
  123. data/sigh/lib/sigh/.options.rb.swp +0 -0
@@ -390,7 +390,7 @@ lane :beta do
390
390
  end
391
391
  ```
392
392
 
393
- By using the `force_for_new_devices` parameter, _match_ will check if the device count has changed since the last time you ran _match_, and automatically re-generate the provisioning profile if necessary. You can also use `force: true` to re-generate the provisioning profile on each run.
393
+ By using the `force_for_new_devices` parameter, _match_ will check if the (enabled) device count has changed since the last time you ran _match_, and automatically re-generate the provisioning profile if necessary. You can also use `force: true` to re-generate the provisioning profile on each run.
394
394
 
395
395
  _**Important:** The `force_for_new_devices` parameter is ignored for App Store provisioning profiles since they don't contain any device information._
396
396
 
@@ -439,6 +439,10 @@ Use the `submission_information` parameter for additional submission specifiers,
439
439
  fastlane deliver submit_build --build_number 830 --submission_information "{\"export_compliance_uses_encryption\": false, \"add_id_info_uses_idfa\": false }"
440
440
  ```
441
441
 
442
+ ### App Privacy Details
443
+
444
+ Starting on December 8, 2020, Apple announced that developers are required to provide app privacy details that will help users understand an app's privacy practies. _deliver_ does not allow for updating of this information but this can be done with the _upload_app_privacy_details_to_app_store_ action. More information on [Uploading App Privacy Details](https://docs.fastlane.tools/uploading-app-privacy-details)
445
+
442
446
  # Credentials
443
447
 
444
448
  A detailed description about how your credentials are handled is available in a [credentials_manager](https://github.com/fastlane/fastlane/tree/master/credentials_manager).
@@ -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
@@ -285,7 +285,6 @@ module Fastlane
285
285
  short_option: "-p",
286
286
  env_name: "DOWNLOAD_DSYMS_PLATFORM",
287
287
  description: "The app platform for dSYMs you wish to download (ios, appletvos)",
288
- optional: true,
289
288
  default_value: :ios),
290
289
  FastlaneCore::ConfigItem.new(key: :version,
291
290
  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
@@ -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
 
@@ -5,6 +5,7 @@ module Fastlane
5
5
  command = []
6
6
  command << "curl"
7
7
  command << verbose(params)
8
+ command << "--fail"
8
9
  command += ssl_options(params)
9
10
  command += proxy_options(params)
10
11
  command += upload_options(params)
@@ -17,6 +17,7 @@ module Fastlane
17
17
  apns_p12_password = params[:apns_p12_password]
18
18
  android_token = params[:android_token]
19
19
  android_gcm_sender_id = params[:android_gcm_sender_id]
20
+ organization_id = params[:organization_id]
20
21
 
21
22
  has_app_id = !app_id.empty?
22
23
  has_app_name = !app_name.empty?
@@ -43,6 +44,7 @@ module Fastlane
43
44
 
44
45
  payload["gcm_key"] = android_token unless android_token.nil?
45
46
  payload["android_gcm_sender_id"] = android_gcm_sender_id unless android_gcm_sender_id.nil?
47
+ payload["organization_id"] = organization_id unless organization_id.nil?
46
48
 
47
49
  # here's the actual lifting - POST or PUT to OneSignal
48
50
 
@@ -135,7 +137,13 @@ module Fastlane
135
137
  env_name: "APNS_ENV",
136
138
  description: "APNS environment",
137
139
  optional: true,
138
- default_value: 'production')
140
+ default_value: 'production'),
141
+
142
+ FastlaneCore::ConfigItem.new(key: :organization_id,
143
+ env_name: "ONE_SIGNAL_ORGANIZATION_ID",
144
+ sensitive: true,
145
+ description: "OneSignal Organization ID",
146
+ optional: true)
139
147
  ]
140
148
  end
141
149
 
@@ -163,7 +171,8 @@ module Fastlane
163
171
  android_gcm_sender_id: "Your Android GCM Sender ID (optional)",
164
172
  apns_p12: "Path to Apple .p12 file (optional)",
165
173
  apns_p12_password: "Password for .p12 file (optional)",
166
- apns_env: "production/sandbox (defaults to production)"
174
+ apns_env: "production/sandbox (defaults to production)",
175
+ organization_id: "Onesignal organization id (optional)"
167
176
  )',
168
177
  'onesignal(
169
178
  app_id: "Your OneSignal App ID",
@@ -173,7 +182,8 @@ module Fastlane
173
182
  android_gcm_sender_id: "Your Android GCM Sender ID (optional)",
174
183
  apns_p12: "Path to Apple .p12 file (optional)",
175
184
  apns_p12_password: "Password for .p12 file (optional)",
176
- apns_env: "production/sandbox (defaults to production)"
185
+ apns_env: "production/sandbox (defaults to production)",
186
+ organization_id: "Onesignal organization id (optional)"
177
187
  )'
178
188
  ]
179
189
  end
@@ -43,6 +43,10 @@ module Fastlane
43
43
  command << "--skip-tests"
44
44
  end
45
45
 
46
+ if params[:use_json]
47
+ command << "--use-json"
48
+ end
49
+
46
50
  if params[:verbose]
47
51
  command << "--verbose"
48
52
  end
@@ -121,6 +125,11 @@ module Fastlane
121
125
  optional: true,
122
126
  type: Boolean,
123
127
  env_name: "FL_POD_PUSH_SKIP_TESTS"),
128
+ FastlaneCore::ConfigItem.new(key: :use_json,
129
+ description: "Convert the podspec to JSON before pushing it to the repo",
130
+ optional: true,
131
+ type: Boolean,
132
+ env_name: "FL_POD_PUSH_USE_JSON"),
124
133
  FastlaneCore::ConfigItem.new(key: :verbose,
125
134
  description: "Show more debugging information",
126
135
  optional: true,
@@ -32,6 +32,9 @@ module Fastlane
32
32
  # optionally add the set-upstream component
33
33
  command << '--set-upstream' if params[:set_upstream]
34
34
 
35
+ # optionally add the --push_options components
36
+ params[:push_options].each { |push_option| command << "--push-option=#{push_option}" } if params[:push_options]
37
+
35
38
  # execute our command
36
39
  Actions.sh('pwd')
37
40
  return command.join(' ') if Helper.test?
@@ -84,7 +87,12 @@ module Fastlane
84
87
  env_name: "FL_GIT_PUSH_USE_SET_UPSTREAM",
85
88
  description: "Whether or not to use --set-upstream",
86
89
  type: Boolean,
87
- default_value: false)
90
+ default_value: false),
91
+ FastlaneCore::ConfigItem.new(key: :push_options,
92
+ env_name: "FL_GIT_PUSH_PUSH_OPTION",
93
+ description: "Array of strings to be passed using the '--push-option' option",
94
+ type: Array,
95
+ default_value: [])
88
96
  ]
89
97
  end
90
98
 
@@ -27,7 +27,7 @@ module Fastlane
27
27
  end
28
28
 
29
29
  begin
30
- Spaceship::ConnectAPI::Device.create(name: name, platform: platform, udid: udid)
30
+ Spaceship::ConnectAPI::Device.find_or_create(udid, name: name, platform: platform)
31
31
  rescue => ex
32
32
  UI.error(ex.to_s)
33
33
  UI.crash!("Failed to register new device (name: #{name}, platform: #{platform}, UDID: #{udid})")
@@ -77,7 +77,7 @@ module Fastlane
77
77
  end
78
78
 
79
79
  def self.try_create_device(name: nil, platform: nil, udid: nil)
80
- Spaceship::ConnectAPI::Device.create(name: name, platform: platform, udid: udid)
80
+ Spaceship::ConnectAPI::Device.find_or_create(udid, name: name, platform: platform)
81
81
  rescue => ex
82
82
  UI.error(ex.to_s)
83
83
  UI.crash!("Failed to register new device (name: #{name}, UDID: #{udid})")
@@ -155,6 +155,7 @@ module Fastlane
155
155
  FastlaneCore::ConfigItem.new(key: :username,
156
156
  env_name: "DELIVER_USER",
157
157
  description: "Optional: Your Apple ID",
158
+ optional: true,
158
159
  default_value: user,
159
160
  default_value_dynamic: true),
160
161
  FastlaneCore::ConfigItem.new(key: :platform,
@@ -13,6 +13,7 @@ module Fastlane
13
13
 
14
14
  repo_name = params[:repository_name]
15
15
  api_token = params[:api_token]
16
+ api_bearer = params[:api_bearer]
16
17
  server_url = params[:server_url]
17
18
  tag_name = params[:tag_name]
18
19
 
@@ -28,6 +29,7 @@ module Fastlane
28
29
  GithubApiAction.run(
29
30
  server_url: server_url,
30
31
  api_token: api_token,
32
+ api_bearer: api_bearer,
31
33
  http_method: 'POST',
32
34
  path: "repos/#{repo_name}/releases",
33
35
  body: payload,
@@ -65,12 +67,13 @@ module Fastlane
65
67
  assets = params[:upload_assets]
66
68
  if assets && assets.count > 0
67
69
  # upload assets
68
- self.upload_assets(assets, json['upload_url'], api_token)
70
+ self.upload_assets(assets, json['upload_url'], api_token, api_bearer)
69
71
 
70
72
  # fetch the release again, so that it contains the uploaded assets
71
73
  GithubApiAction.run(
72
74
  server_url: server_url,
73
75
  api_token: api_token,
76
+ api_bearer: api_bearer,
74
77
  http_method: 'GET',
75
78
  path: "repos/#{repo_name}/releases/#{release_id}",
76
79
  error_handlers: {
@@ -90,13 +93,13 @@ module Fastlane
90
93
  end
91
94
  end
92
95
 
93
- def self.upload_assets(assets, upload_url_template, api_token)
96
+ def self.upload_assets(assets, upload_url_template, api_token, api_bearer)
94
97
  assets.each do |asset|
95
- self.upload(asset, upload_url_template, api_token)
98
+ self.upload(asset, upload_url_template, api_token, api_bearer)
96
99
  end
97
100
  end
98
101
 
99
- def self.upload(asset_path, upload_url_template, api_token)
102
+ def self.upload(asset_path, upload_url_template, api_token, api_bearer)
100
103
  # if it's a directory, zip it first in a temp directory, because we can only upload binary files
101
104
  absolute_path = File.absolute_path(asset_path)
102
105
 
@@ -107,14 +110,14 @@ module Fastlane
107
110
  Dir.mktmpdir do |dir|
108
111
  tmpzip = File.join(dir, File.basename(absolute_path) + '.zip')
109
112
  sh("cd \"#{File.dirname(absolute_path)}\"; zip -r --symlinks \"#{tmpzip}\" \"#{File.basename(absolute_path)}\" 2>&1 >/dev/null")
110
- self.upload_file(tmpzip, upload_url_template, api_token)
113
+ self.upload_file(tmpzip, upload_url_template, api_token, api_bearer)
111
114
  end
112
115
  else
113
- self.upload_file(absolute_path, upload_url_template, api_token)
116
+ self.upload_file(absolute_path, upload_url_template, api_token, api_bearer)
114
117
  end
115
118
  end
116
119
 
117
- def self.upload_file(file, url_template, api_token)
120
+ def self.upload_file(file, url_template, api_token, api_bearer)
118
121
  require 'addressable/template'
119
122
  file_name = File.basename(file)
120
123
  expanded_url = Addressable::Template.new(url_template).expand(name: file_name).to_s
@@ -122,6 +125,7 @@ module Fastlane
122
125
  UI.important("Uploading #{file_name}")
123
126
  GithubApiAction.run(
124
127
  api_token: api_token,
128
+ api_bearer: api_bearer,
125
129
  http_method: 'POST',
126
130
  headers: headers,
127
131
  url: expanded_url,
@@ -173,12 +177,21 @@ module Fastlane
173
177
  FastlaneCore::ConfigItem.new(key: :api_token,
174
178
  env_name: "FL_GITHUB_RELEASE_API_TOKEN",
175
179
  description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens",
180
+ conflicting_options: [:api_bearer],
176
181
  sensitive: true,
177
182
  code_gen_sensitive: true,
178
183
  is_string: true,
179
184
  default_value: ENV["GITHUB_API_TOKEN"],
180
185
  default_value_dynamic: true,
181
- optional: false),
186
+ optional: true),
187
+ FastlaneCore::ConfigItem.new(key: :api_bearer,
188
+ env_name: "FL_GITHUB_RELEASE_API_BEARER",
189
+ sensitive: true,
190
+ code_gen_sensitive: true,
191
+ description: "Use a Bearer authorization token. Usually generated by Github Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable",
192
+ conflicting_options: [:api_token],
193
+ optional: true,
194
+ default_value: nil),
182
195
  FastlaneCore::ConfigItem.new(key: :tag_name,
183
196
  env_name: "FL_SET_GITHUB_RELEASE_TAG_NAME",
184
197
  description: "Pass in the tag name",