fastlane 2.171.0 → 2.172.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/deliver/lib/deliver/commands_generator.rb +1 -1
  4. data/deliver/lib/deliver/setup.rb +8 -3
  5. data/fastlane/lib/fastlane/actions/{.github_api.rb.swp → .update_fastlane.rb.swp} +0 -0
  6. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  7. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  8. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  9. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  10. data/fastlane/lib/fastlane/actions/download_dsyms.rb +0 -1
  11. data/fastlane/lib/fastlane/actions/git_commit.rb +8 -4
  12. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/register_devices.rb +2 -1
  14. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  15. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  16. data/fastlane/lib/fastlane/version.rb +1 -1
  17. data/fastlane/swift/Deliverfile.swift +2 -2
  18. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  19. data/fastlane/swift/Fastlane.swift +125 -18
  20. data/fastlane/swift/Gymfile.swift +2 -2
  21. data/fastlane/swift/GymfileProtocol.swift +11 -3
  22. data/fastlane/swift/Matchfile.swift +2 -2
  23. data/fastlane/swift/MatchfileProtocol.swift +2 -2
  24. data/fastlane/swift/Precheckfile.swift +2 -2
  25. data/fastlane/swift/PrecheckfileProtocol.swift +2 -2
  26. data/fastlane/swift/Scanfile.swift +2 -2
  27. data/fastlane/swift/ScanfileProtocol.swift +10 -2
  28. data/fastlane/swift/Screengrabfile.swift +2 -2
  29. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  30. data/fastlane/swift/Snapshotfile.swift +2 -2
  31. data/fastlane/swift/SnapshotfileProtocol.swift +14 -2
  32. data/fastlane_core/lib/fastlane_core/helper.rb +1 -1
  33. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  34. data/fastlane_core/lib/fastlane_core/project.rb +18 -5
  35. data/frameit/lib/frameit/device_types.rb +7 -1
  36. data/gym/lib/gym/generators/build_command_generator.rb +3 -1
  37. data/gym/lib/gym/options.rb +12 -2
  38. data/scan/lib/scan/options.rb +10 -0
  39. data/scan/lib/scan/runner.rb +6 -1
  40. data/scan/lib/scan/slack_poster.rb +3 -1
  41. data/scan/lib/scan/test_command_generator.rb +3 -1
  42. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  43. data/snapshot/lib/snapshot/options.rb +16 -1
  44. data/snapshot/lib/snapshot/update.rb +1 -1
  45. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -1
  46. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  47. data/spaceship/lib/spaceship/connect_api/models/device.rb +26 -0
  48. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  49. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +1 -0
  50. metadata +36 -23
  51. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  52. data/fastlane/lib/fastlane/actions/.set_github_release.rb.swp +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9c960e8f4391fa08e3b301c5f7718c118ee0031fb399e2582febb9b8b9860f8
4
- data.tar.gz: 418236b3a2ab2b68f22e33858a5edf71af122e50e69b24824dd2186fa5a1db8f
3
+ metadata.gz: d25e374341a7acedcadc6a1861a3f047f4e6f71312d68e6b770e083cfa527e7a
4
+ data.tar.gz: 01eac07e1ca532f1baf5bb23722927b87fc10d5aeb867db86d18d60eddc87f09
5
5
  SHA512:
6
- metadata.gz: d50a705046c0a22b2ab825556ca0fb22ed4b550e91eb44aaca92fcbf007fefd163dd8a7ee1dd91100db22caaf1a35f2e9af81b043bc074e58bfe195349dbdb9f
7
- data.tar.gz: 65fd003a7c37db205744c3120b034b0de0339ed02db507a2f8346b0979d1aff0f980df152a7cf8d430ca5ce9baa4efe32edb3a491c7009211680c44ebd143038
6
+ metadata.gz: 2ccfbd1a683d17b27384030f99fb4e8db51feccdcca7bc959efb1b0455ded32efa4470b1082710388d6e6444e6c02e7c7ef1e7d8b8f0e6c88746ccb984246a70
7
+ data.tar.gz: 59e9908175276ce658cf959c647a3426d55688bfa0f181f4d1c8554d1a6a7f64f36926d55b730255c3156411259f0f8a25f5e166e8d0d8652f2f6059fba1d78a
data/README.md CHANGED
@@ -34,11 +34,17 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
34
34
  <!-- This table is regenerated and resorted on each release -->
35
35
  <table id='team'>
36
36
  <tr>
37
- <td id='fumiya-nakamura'>
38
- <a href='https://github.com/nafu'>
39
- <img src='https://github.com/nafu.png?size=140'>
37
+ <td id='iulian-onofrei'>
38
+ <a href='https://github.com/revolter'>
39
+ <img src='https://github.com/revolter.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
42
+ </td>
43
+ <td id='stefan-natchev'>
44
+ <a href='https://github.com/snatchev'>
45
+ <img src='https://github.com/snatchev.png?size=140'>
46
+ </a>
47
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
42
48
  </td>
43
49
  <td id='aaron-brager'>
44
50
  <a href='https://github.com/getaaron'>
@@ -46,43 +52,43 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
46
52
  </a>
47
53
  <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
48
54
  </td>
49
- <td id='luka-mirosevic'>
50
- <a href='https://github.com/lmirosevic'>
51
- <img src='https://github.com/lmirosevic.png?size=140'>
55
+ <td id='andrew-mcburney'>
56
+ <a href='https://github.com/armcburney'>
57
+ <img src='https://github.com/armcburney.png?size=140'>
52
58
  </a>
53
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
59
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
54
60
  </td>
55
- <td id='maksym-grebenets'>
56
- <a href='https://github.com/mgrebenets'>
57
- <img src='https://github.com/mgrebenets.png?size=140'>
61
+ <td id='fumiya-nakamura'>
62
+ <a href='https://github.com/nafu'>
63
+ <img src='https://github.com/nafu.png?size=140'>
58
64
  </a>
59
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
65
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
60
66
  </td>
67
+ </tr>
68
+ <tr>
61
69
  <td id='olivier-halligon'>
62
70
  <a href='https://github.com/AliSoftware'>
63
71
  <img src='https://github.com/AliSoftware.png?size=140'>
64
72
  </a>
65
73
  <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
66
74
  </td>
67
- </tr>
68
- <tr>
69
- <td id='jérôme-lacoste'>
70
- <a href='https://github.com/lacostej'>
71
- <img src='https://github.com/lacostej.png?size=140'>
75
+ <td id='kohki-miki'>
76
+ <a href='https://github.com/giginet'>
77
+ <img src='https://github.com/giginet.png?size=140'>
72
78
  </a>
73
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
79
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
74
80
  </td>
75
- <td id='helmut-januschka'>
76
- <a href='https://github.com/hjanuschka'>
77
- <img src='https://github.com/hjanuschka.png?size=140'>
81
+ <td id='jimmy-dee'>
82
+ <a href='https://github.com/jdee'>
83
+ <img src='https://github.com/jdee.png?size=140'>
78
84
  </a>
79
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
85
+ <h4 align='center'>Jimmy Dee</h4>
80
86
  </td>
81
- <td id='daniel-jankowski'>
82
- <a href='https://github.com/mollyIV'>
83
- <img src='https://github.com/mollyIV.png?size=140'>
87
+ <td id='felix-krause'>
88
+ <a href='https://github.com/KrauseFx'>
89
+ <img src='https://github.com/KrauseFx.png?size=140'>
84
90
  </a>
85
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
86
92
  </td>
87
93
  <td id='manu-wallner'>
88
94
  <a href='https://github.com/milch'>
@@ -90,57 +96,51 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
90
96
  </a>
91
97
  <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
92
98
  </td>
93
- <td id='jimmy-dee'>
94
- <a href='https://github.com/jdee'>
95
- <img src='https://github.com/jdee.png?size=140'>
96
- </a>
97
- <h4 align='center'>Jimmy Dee</h4>
98
- </td>
99
99
  </tr>
100
100
  <tr>
101
- <td id='danielle-tomlinson'>
102
- <a href='https://github.com/endocrimes'>
103
- <img src='https://github.com/endocrimes.png?size=140'>
104
- </a>
105
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
106
- </td>
107
- <td id='matthew-ellis'>
108
- <a href='https://github.com/matthewellis'>
109
- <img src='https://github.com/matthewellis.png?size=140'>
110
- </a>
111
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
112
- </td>
113
101
  <td id='jan-piotrowski'>
114
102
  <a href='https://github.com/janpio'>
115
103
  <img src='https://github.com/janpio.png?size=140'>
116
104
  </a>
117
105
  <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
118
106
  </td>
119
- <td id='stefan-natchev'>
120
- <a href='https://github.com/snatchev'>
121
- <img src='https://github.com/snatchev.png?size=140'>
107
+ <td id='jérôme-lacoste'>
108
+ <a href='https://github.com/lacostej'>
109
+ <img src='https://github.com/lacostej.png?size=140'>
122
110
  </a>
123
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
111
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
124
112
  </td>
125
- <td id='andrew-mcburney'>
126
- <a href='https://github.com/armcburney'>
127
- <img src='https://github.com/armcburney.png?size=140'>
113
+ <td id='maksym-grebenets'>
114
+ <a href='https://github.com/mgrebenets'>
115
+ <img src='https://github.com/mgrebenets.png?size=140'>
128
116
  </a>
129
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
130
118
  </td>
131
- </tr>
132
- <tr>
133
119
  <td id='max-ott'>
134
120
  <a href='https://github.com/max-ott'>
135
121
  <img src='https://github.com/max-ott.png?size=140'>
136
122
  </a>
137
123
  <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
138
124
  </td>
139
- <td id='iulian-onofrei'>
140
- <a href='https://github.com/revolter'>
141
- <img src='https://github.com/revolter.png?size=140'>
125
+ <td id='josh-holtz'>
126
+ <a href='https://github.com/joshdholtz'>
127
+ <img src='https://github.com/joshdholtz.png?size=140'>
142
128
  </a>
143
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
129
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <td id='luka-mirosevic'>
134
+ <a href='https://github.com/lmirosevic'>
135
+ <img src='https://github.com/lmirosevic.png?size=140'>
136
+ </a>
137
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
138
+ </td>
139
+ <td id='danielle-tomlinson'>
140
+ <a href='https://github.com/endocrimes'>
141
+ <img src='https://github.com/endocrimes.png?size=140'>
142
+ </a>
143
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
144
144
  </td>
145
145
  <td id='jorge-revuelta-h'>
146
146
  <a href='https://github.com/minuscorp'>
@@ -148,31 +148,31 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
148
148
  </a>
149
149
  <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
150
150
  </td>
151
+ <td id='matthew-ellis'>
152
+ <a href='https://github.com/matthewellis'>
153
+ <img src='https://github.com/matthewellis.png?size=140'>
154
+ </a>
155
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
156
+ </td>
151
157
  <td id='joshua-liebowitz'>
152
158
  <a href='https://github.com/taquitos'>
153
159
  <img src='https://github.com/taquitos.png?size=140'>
154
160
  </a>
155
161
  <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
156
162
  </td>
157
- <td id='josh-holtz'>
158
- <a href='https://github.com/joshdholtz'>
159
- <img src='https://github.com/joshdholtz.png?size=140'>
160
- </a>
161
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
162
- </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='felix-krause'>
166
- <a href='https://github.com/KrauseFx'>
167
- <img src='https://github.com/KrauseFx.png?size=140'>
165
+ <td id='daniel-jankowski'>
166
+ <a href='https://github.com/mollyIV'>
167
+ <img src='https://github.com/mollyIV.png?size=140'>
168
168
  </a>
169
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
169
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
170
170
  </td>
171
- <td id='kohki-miki'>
172
- <a href='https://github.com/giginet'>
173
- <img src='https://github.com/giginet.png?size=140'>
171
+ <td id='helmut-januschka'>
172
+ <a href='https://github.com/hjanuschka'>
173
+ <img src='https://github.com/hjanuschka.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -177,7 +177,7 @@ module Deliver
177
177
  end
178
178
  end
179
179
 
180
- Deliver::Setup.new.generate_metadata_files(app, v, path)
180
+ Deliver::Setup.new.generate_metadata_files(app, v, path, options)
181
181
  end
182
182
  end
183
183
 
@@ -46,7 +46,7 @@ module Deliver
46
46
  v = app.get_latest_app_store_version(platform: platform)
47
47
 
48
48
  metadata_path = options[:metadata_path] || File.join(deliver_path, 'metadata')
49
- generate_metadata_files(app, v, metadata_path)
49
+ generate_metadata_files(app, v, metadata_path, options)
50
50
 
51
51
  # Generate the final Deliverfile here
52
52
  return File.read(deliverfile_path)
@@ -60,9 +60,14 @@ module Deliver
60
60
  end
61
61
  end
62
62
 
63
- def generate_metadata_files(app, version, path)
63
+ def generate_metadata_files(app, version, path, options)
64
64
  # App info localizations
65
- app_info = app.fetch_live_app_info || app.fetch_edit_app_info
65
+ if options[:use_live_version]
66
+ app_info = app.fetch_live_app_info
67
+ UI.user_error!("The option `use_live_version` was set to `true`, however no live app was found on App Store Connect.") unless app_info
68
+ else
69
+ app_info = app.fetch_edit_app_info || app.fetch_live_app_info
70
+ end
66
71
  app_info_localizations = app_info.get_app_info_localizations
67
72
  app_info_localizations.each do |localization|
68
73
  language = localization.locale
@@ -10,7 +10,12 @@ module Fastlane
10
10
  Actions.verify_gem!('artifactory')
11
11
 
12
12
  require 'artifactory'
13
+
14
+ UI.user_error!("Cannot connect to Artifactory - 'username' was provided but it's missing 'password'") if params[:username] && !params[:password]
15
+ UI.user_error!("Cannot connect to Artifactory - 'password' was provided but it's missing 'username'") if !params[:username] && params[:password]
16
+ UI.user_error!("Cannot connect to Artifactory - either 'api_key', or 'username' and 'password' must be provided") if !params[:api_key] && !params[:username]
13
17
  file_path = File.absolute_path(params[:file])
18
+
14
19
  if File.exist?(file_path)
15
20
  client = connect_to_artifactory(params)
16
21
  artifact = Artifactory::Resource::Artifact.new
@@ -37,7 +42,7 @@ module Fastlane
37
42
  end
38
43
 
39
44
  def self.connect_to_artifactory(params)
40
- config_keys = [:endpoint, :username, :password, :ssl_pem_file, :ssl_verify, :proxy_username, :proxy_password, :proxy_address, :proxy_port, :read_timeout]
45
+ config_keys = [:endpoint, :username, :password, :api_key, :ssl_pem_file, :ssl_verify, :proxy_username, :proxy_password, :proxy_address, :proxy_port, :read_timeout]
41
46
  config = params.values.select do |key|
42
47
  config_keys.include?(key)
43
48
  end
@@ -48,6 +53,10 @@ module Fastlane
48
53
  'This action uploads an artifact to artifactory'
49
54
  end
50
55
 
56
+ def self.details
57
+ 'Connect to the artifactory server using either a username/password or an api_key'
58
+ end
59
+
51
60
  def self.is_supported?(platform)
52
61
  true
53
62
  end
@@ -72,6 +81,13 @@ module Fastlane
72
81
  file: "example.ipa", # File to upload
73
82
  repo: "mobile_artifacts", # Artifactory repo
74
83
  repo_path: "/ios/appname/example-major.minor.ipa" # Path to place the artifact including its filename
84
+ )',
85
+ 'artifactory(
86
+ api_key: "api_key",
87
+ endpoint: "https://artifactory.example.com/artifactory/",
88
+ file: "example.ipa", # File to upload
89
+ repo: "mobile_artifacts", # Artifactory repo
90
+ repo_path: "/ios/appname/example-major.minor.ipa" # Path to place the artifact including its filename
75
91
  )'
76
92
  ]
77
93
  end
@@ -101,12 +117,29 @@ module Fastlane
101
117
  FastlaneCore::ConfigItem.new(key: :username,
102
118
  env_name: "FL_ARTIFACTORY_USERNAME",
103
119
  description: "Artifactory username",
104
- optional: false),
120
+ optional: true,
121
+ conflicting_options: [:api_key],
122
+ conflict_block: proc do |value|
123
+ UI.user_error!("You can't use option '#{value.key}' along with 'username'")
124
+ end),
105
125
  FastlaneCore::ConfigItem.new(key: :password,
106
126
  env_name: "FL_ARTIFACTORY_PASSWORD",
107
127
  description: "Artifactory password",
108
128
  sensitive: true,
109
- optional: false),
129
+ optional: true,
130
+ conflicting_options: [:api_key],
131
+ conflict_block: proc do |value|
132
+ UI.user_error!("You can't use option '#{value.key}' along with 'password'")
133
+ end),
134
+ FastlaneCore::ConfigItem.new(key: :api_key,
135
+ env_name: "FL_ARTIFACTORY_API_KEY",
136
+ description: "Artifactory API key",
137
+ sensitive: true,
138
+ optional: true,
139
+ conflicting_options: [:username, :password],
140
+ conflict_block: proc do |value|
141
+ UI.user_error!("You can't use option '#{value.key}' along with 'api_key'")
142
+ end),
110
143
  FastlaneCore::ConfigItem.new(key: :properties,
111
144
  env_name: "FL_ARTIFACTORY_PROPERTIES",
112
145
  description: "Artifact properties hash",
@@ -8,6 +8,7 @@ module Fastlane
8
8
  end
9
9
 
10
10
  class BuildAppAction < Action
11
+ # rubocop:disable Metrics/PerceivedComplexity
11
12
  def self.run(values)
12
13
  require 'gym'
13
14
 
@@ -50,7 +51,8 @@ module Fastlane
50
51
  begin
51
52
  profile = FastlaneCore::ProvisioningProfile.parse(profile_path)
52
53
  app_id_prefix = profile["ApplicationIdentifierPrefix"].first
53
- bundle_id = profile["Entitlements"]["application-identifier"].gsub("#{app_id_prefix}.", "")
54
+ entitlements = profile["Entitlements"]
55
+ bundle_id = (entitlements["application-identifier"] || entitlements["com.apple.application-identifier"]).gsub("#{app_id_prefix}.", "")
54
56
  values[:export_options][:provisioningProfiles][bundle_id] = profile["Name"]
55
57
  rescue => ex
56
58
  UI.error("Couldn't load profile at path: #{profile_path}")
@@ -20,6 +20,7 @@ module Fastlane
20
20
  GithubApiAction.run(
21
21
  server_url: params[:api_url],
22
22
  api_token: params[:api_token],
23
+ api_bearer: params[:api_bearer],
23
24
  http_method: 'POST',
24
25
  path: "repos/#{params[:repo]}/pulls",
25
26
  body: payload,
@@ -60,6 +61,7 @@ module Fastlane
60
61
  GithubApiAction.run(
61
62
  server_url: params[:api_url],
62
63
  api_token: params[:api_token],
64
+ api_bearer: params[:api_bearer],
63
65
  http_method: 'PATCH',
64
66
  path: "repos/#{params[:repo]}/issues/#{number}",
65
67
  body: payload,
@@ -79,6 +81,7 @@ module Fastlane
79
81
  GithubApiAction.run(
80
82
  server_url: params[:api_url],
81
83
  api_token: params[:api_token],
84
+ api_bearer: params[:api_bearer],
82
85
  http_method: 'POST',
83
86
  path: "repos/#{params[:repo]}/issues/#{number}/assignees",
84
87
  body: payload,
@@ -103,6 +106,7 @@ module Fastlane
103
106
  GithubApiAction.run(
104
107
  server_url: params[:api_url],
105
108
  api_token: params[:api_token],
109
+ api_bearer: params[:api_bearer],
106
110
  http_method: 'POST',
107
111
  path: "repos/#{params[:repo]}/pulls/#{number}/requested_reviewers",
108
112
  body: payload,
@@ -124,6 +128,7 @@ module Fastlane
124
128
  GithubApiAction.run(
125
129
  server_url: params[:api_url],
126
130
  api_token: params[:api_token],
131
+ api_bearer: params[:api_bearer],
127
132
  http_method: 'PATCH',
128
133
  path: "repos/#{params[:repo]}/issues/#{number}",
129
134
  body: payload,
@@ -161,7 +166,17 @@ module Fastlane
161
166
  default_value: ENV["GITHUB_API_TOKEN"],
162
167
  default_value_dynamic: true,
163
168
  is_string: true,
164
- optional: false),
169
+ conflicting_options: [:api_bearer],
170
+ optional: true),
171
+ FastlaneCore::ConfigItem.new(key: :api_bearer,
172
+ env_name: "GITHUB_PULL_REQUEST_API_BEARER",
173
+ description: "Use a Bearer authorization token. Usually generated by Github Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable",
174
+ sensitive: true,
175
+ code_gen_sensitive: true,
176
+ is_string: true,
177
+ conflicting_options: [:api_token],
178
+ optional: true,
179
+ default_value: nil),
165
180
  FastlaneCore::ConfigItem.new(key: :repo,
166
181
  env_name: "GITHUB_PULL_REQUEST_REPO",
167
182
  description: "The name of the repository you want to submit the pull request to",
@@ -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