fastlane 2.157.3 → 2.161.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/deliver/lib/deliver/options.rb +17 -1
  4. data/deliver/lib/deliver/runner.rb +36 -5
  5. data/deliver/lib/deliver/upload_metadata.rb +36 -6
  6. data/deliver/lib/deliver/upload_price_tier.rb +7 -2
  7. data/{pilot/lib/pilot/.manager.rb.swp → fastlane/lib/fastlane/.erb_template_helper.rb.swp} +0 -0
  8. data/fastlane/lib/fastlane/actions/{.ensure_git_status_clean.rb.swp → .git_commit.rb.swp} +0 -0
  9. data/fastlane/lib/fastlane/actions/actions_helper.rb +20 -1
  10. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -0
  11. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +6 -1
  12. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +1 -0
  13. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +2 -2
  14. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -1
  16. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +3 -2
  17. data/fastlane/lib/fastlane/actions/docs/run_tests.md +2 -2
  18. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +3 -3
  19. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -2
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +2 -2
  21. data/fastlane/lib/fastlane/actions/download_dsyms.rb +34 -7
  22. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +13 -2
  23. data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -0
  24. data/fastlane/lib/fastlane/helper/git_helper.rb +2 -0
  25. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +6 -4
  26. data/fastlane/lib/fastlane/swift_fastlane_function.rb +1 -1
  27. data/fastlane/lib/fastlane/version.rb +1 -1
  28. data/fastlane/swift/Actions.swift +2 -1
  29. data/fastlane/swift/Appfile.swift +2 -4
  30. data/fastlane/swift/ArgumentProcessor.swift +2 -6
  31. data/fastlane/swift/ControlCommand.swift +2 -5
  32. data/fastlane/swift/Deliverfile.swift +5 -2
  33. data/fastlane/swift/DeliverfileProtocol.swift +15 -4
  34. data/fastlane/swift/Fastfile.swift +5 -1
  35. data/fastlane/swift/Fastlane.swift +2285 -2240
  36. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +5 -5
  37. data/fastlane/swift/Gymfile.swift +5 -2
  38. data/fastlane/swift/GymfileProtocol.swift +6 -3
  39. data/fastlane/swift/LaneFileProtocol.swift +42 -29
  40. data/fastlane/swift/MainProcess.swift +77 -0
  41. data/fastlane/swift/Matchfile.swift +5 -2
  42. data/fastlane/swift/MatchfileProtocol.swift +7 -4
  43. data/fastlane/swift/Plugins.swift +2 -1
  44. data/fastlane/swift/Precheckfile.swift +5 -2
  45. data/fastlane/swift/PrecheckfileProtocol.swift +18 -3
  46. data/fastlane/swift/RubyCommand.swift +2 -6
  47. data/fastlane/swift/RubyCommandable.swift +2 -6
  48. data/fastlane/swift/Runner.swift +5 -9
  49. data/fastlane/swift/RunnerArgument.swift +2 -6
  50. data/fastlane/swift/Scanfile.swift +5 -2
  51. data/fastlane/swift/ScanfileProtocol.swift +6 -3
  52. data/fastlane/swift/Screengrabfile.swift +5 -2
  53. data/fastlane/swift/ScreengrabfileProtocol.swift +6 -3
  54. data/fastlane/swift/Snapshotfile.swift +5 -2
  55. data/fastlane/swift/SnapshotfileProtocol.swift +6 -3
  56. data/fastlane/swift/SocketClient.swift +3 -7
  57. data/fastlane/swift/SocketClientDelegateProtocol.swift +2 -6
  58. data/fastlane/swift/SocketResponse.swift +2 -6
  59. data/fastlane/swift/formatting/Brewfile.lock.json +18 -10
  60. data/fastlane/swift/main.swift +4 -8
  61. data/fastlane/swift/upgrade_manifest.json +1 -1
  62. data/frameit/lib/frameit/editor.rb +1 -0
  63. data/match/lib/match/importer.rb +5 -2
  64. data/match/lib/match/options.rb +1 -1
  65. data/match/lib/match/spaceship_ensure.rb +3 -3
  66. data/pilot/lib/pilot/options.rb +2 -2
  67. data/precheck/lib/precheck/options.rb +25 -0
  68. data/precheck/lib/precheck/rule_processor.rb +94 -60
  69. data/precheck/lib/precheck/runner.rb +26 -5
  70. data/produce/lib/produce/itunes_connect.rb +2 -0
  71. data/sigh/lib/sigh/runner.rb +2 -0
  72. data/snapshot/lib/assets/SnapshotHelper.swift +17 -2
  73. data/spaceship/README.md +1 -1
  74. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  75. data/spaceship/lib/spaceship/connect_api/client.rb +34 -13
  76. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp} +0 -0
  77. data/spaceship/lib/spaceship/connect_api/models/app.rb +17 -9
  78. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  79. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -2
  80. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +3 -5
  81. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +3 -5
  82. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +21 -0
  83. data/spaceship/lib/spaceship/connect_api/spaceship.rb +3 -2
  84. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +29 -9
  85. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +11 -5
  86. metadata +24 -26
  87. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  88. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  89. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd1050cf89fc0ae6d56214788fb1f78af159c544bc13f70533173a99b18444e5
4
- data.tar.gz: a42063c3aee9786fd39100296898218318680e8c206a5a59dda6016ab4d0608d
3
+ metadata.gz: b04dd428b80beb70de6d4aa2f7e0348b4e0c0e1d4aa0e781c311ab18e44d0de5
4
+ data.tar.gz: fe4342a1c8d7df3e617c111e37bd3cab7c7b3675875f8bd384917f0cafb1a221
5
5
  SHA512:
6
- metadata.gz: 87560b19fb15dc19e9930d6339c49126eb7451a29d6d6bfb4bfaa896969e1e831857ce4e76956fc3e774bc17e1d4c8a9dcaf7c114aa73052284f05f228776bf5
7
- data.tar.gz: f0ffda1c6a9141737987eed86ccef7e4a305b27690e8b16c0e4720e281b44d38cd81a6d0312d804977e855450802f3358d52adeff4a1a444cc5de137581d847e
6
+ metadata.gz: 9ad358398a4033fe329a06934cee91566dd29c084a0e0e62a86148c0e2b456be46ce008de0b921a68b9d2ffbb3ec11d97a41a286d33cac395d3e4c37ac01adce
7
+ data.tar.gz: 3d5fbd2690e8dafe1efc9fd4a6d63e711b3569b071d00d39b82e078a5c038c6110df73234d0e15ecc03c7f2792253edea430d6e716c460a7d8c9d371deed0dd0
data/README.md CHANGED
@@ -34,23 +34,23 @@ 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='danielle-tomlinson'>
38
- <a href='https://github.com/endocrimes'>
39
- <img src='https://github.com/endocrimes.png?size=140'>
37
+ <td id='stefan-natchev'>
38
+ <a href='https://github.com/snatchev'>
39
+ <img src='https://github.com/snatchev.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
42
42
  </td>
43
- <td id='aaron-brager'>
44
- <a href='https://github.com/getaaron'>
45
- <img src='https://github.com/getaaron.png?size=140'>
43
+ <td id='jorge-revuelta-h'>
44
+ <a href='https://github.com/minuscorp'>
45
+ <img src='https://github.com/minuscorp.png?size=140'>
46
46
  </a>
47
- <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
47
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
48
48
  </td>
49
- <td id='helmut-januschka'>
50
- <a href='https://github.com/hjanuschka'>
51
- <img src='https://github.com/hjanuschka.png?size=140'>
49
+ <td id='olivier-halligon'>
50
+ <a href='https://github.com/AliSoftware'>
51
+ <img src='https://github.com/AliSoftware.png?size=140'>
52
52
  </a>
53
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
53
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
54
54
  </td>
55
55
  <td id='fumiya-nakamura'>
56
56
  <a href='https://github.com/nafu'>
@@ -58,37 +58,19 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
58
58
  </a>
59
59
  <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
60
60
  </td>
61
- <td id='jérôme-lacoste'>
62
- <a href='https://github.com/lacostej'>
63
- <img src='https://github.com/lacostej.png?size=140'>
61
+ <td id='matthew-ellis'>
62
+ <a href='https://github.com/matthewellis'>
63
+ <img src='https://github.com/matthewellis.png?size=140'>
64
64
  </a>
65
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
65
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
66
66
  </td>
67
67
  </tr>
68
68
  <tr>
69
- <td id='jimmy-dee'>
70
- <a href='https://github.com/jdee'>
71
- <img src='https://github.com/jdee.png?size=140'>
72
- </a>
73
- <h4 align='center'>Jimmy Dee</h4>
74
- </td>
75
- <td id='olivier-halligon'>
76
- <a href='https://github.com/AliSoftware'>
77
- <img src='https://github.com/AliSoftware.png?size=140'>
78
- </a>
79
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
80
- </td>
81
- <td id='jan-piotrowski'>
82
- <a href='https://github.com/janpio'>
83
- <img src='https://github.com/janpio.png?size=140'>
84
- </a>
85
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
86
- </td>
87
- <td id='maksym-grebenets'>
88
- <a href='https://github.com/mgrebenets'>
89
- <img src='https://github.com/mgrebenets.png?size=140'>
69
+ <td id='aaron-brager'>
70
+ <a href='https://github.com/getaaron'>
71
+ <img src='https://github.com/getaaron.png?size=140'>
90
72
  </a>
91
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
73
+ <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
92
74
  </td>
93
75
  <td id='max-ott'>
94
76
  <a href='https://github.com/max-ott'>
@@ -96,8 +78,6 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
96
78
  </a>
97
79
  <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
98
80
  </td>
99
- </tr>
100
- <tr>
101
81
  <td id='felix-krause'>
102
82
  <a href='https://github.com/KrauseFx'>
103
83
  <img src='https://github.com/KrauseFx.png?size=140'>
@@ -110,43 +90,57 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
110
90
  </a>
111
91
  <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
112
92
  </td>
113
- <td id='josh-holtz'>
114
- <a href='https://github.com/joshdholtz'>
115
- <img src='https://github.com/joshdholtz.png?size=140'>
116
- </a>
117
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
118
- </td>
119
93
  <td id='manu-wallner'>
120
94
  <a href='https://github.com/milch'>
121
95
  <img src='https://github.com/milch.png?size=140'>
122
96
  </a>
123
97
  <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
124
98
  </td>
99
+ </tr>
100
+ <tr>
125
101
  <td id='iulian-onofrei'>
126
102
  <a href='https://github.com/revolter'>
127
103
  <img src='https://github.com/revolter.png?size=140'>
128
104
  </a>
129
105
  <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
130
106
  </td>
131
- </tr>
132
- <tr>
133
- <td id='daniel-jankowski'>
134
- <a href='https://github.com/mollyIV'>
135
- <img src='https://github.com/mollyIV.png?size=140'>
107
+ <td id='jimmy-dee'>
108
+ <a href='https://github.com/jdee'>
109
+ <img src='https://github.com/jdee.png?size=140'>
136
110
  </a>
137
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
111
+ <h4 align='center'>Jimmy Dee</h4>
138
112
  </td>
139
- <td id='matthew-ellis'>
140
- <a href='https://github.com/matthewellis'>
141
- <img src='https://github.com/matthewellis.png?size=140'>
113
+ <td id='andrew-mcburney'>
114
+ <a href='https://github.com/armcburney'>
115
+ <img src='https://github.com/armcburney.png?size=140'>
142
116
  </a>
143
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
144
118
  </td>
145
- <td id='joshua-liebowitz'>
146
- <a href='https://github.com/taquitos'>
147
- <img src='https://github.com/taquitos.png?size=140'>
119
+ <td id='maksym-grebenets'>
120
+ <a href='https://github.com/mgrebenets'>
121
+ <img src='https://github.com/mgrebenets.png?size=140'>
148
122
  </a>
149
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
123
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
124
+ </td>
125
+ <td id='josh-holtz'>
126
+ <a href='https://github.com/joshdholtz'>
127
+ <img src='https://github.com/joshdholtz.png?size=140'>
128
+ </a>
129
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <td id='jan-piotrowski'>
134
+ <a href='https://github.com/janpio'>
135
+ <img src='https://github.com/janpio.png?size=140'>
136
+ </a>
137
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</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>
150
144
  </td>
151
145
  <td id='kohki-miki'>
152
146
  <a href='https://github.com/giginet'>
@@ -154,25 +148,31 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
154
148
  </a>
155
149
  <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
156
150
  </td>
157
- <td id='jorge-revuelta-h'>
158
- <a href='https://github.com/minuscorp'>
159
- <img src='https://github.com/minuscorp.png?size=140'>
151
+ <td id='helmut-januschka'>
152
+ <a href='https://github.com/hjanuschka'>
153
+ <img src='https://github.com/hjanuschka.png?size=140'>
160
154
  </a>
161
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
156
+ </td>
157
+ <td id='jérôme-lacoste'>
158
+ <a href='https://github.com/lacostej'>
159
+ <img src='https://github.com/lacostej.png?size=140'>
160
+ </a>
161
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
162
162
  </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='andrew-mcburney'>
166
- <a href='https://github.com/armcburney'>
167
- <img src='https://github.com/armcburney.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/armcburney'>Andrew McBurney</a></h4>
169
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
170
170
  </td>
171
- <td id='stefan-natchev'>
172
- <a href='https://github.com/snatchev'>
173
- <img src='https://github.com/snatchev.png?size=140'>
171
+ <td id='joshua-liebowitz'>
172
+ <a href='https://github.com/taquitos'>
173
+ <img src='https://github.com/taquitos.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -12,6 +12,22 @@ module Deliver
12
12
  user ||= ENV["DELIVER_USER"]
13
13
 
14
14
  [
15
+ FastlaneCore::ConfigItem.new(key: :api_key_path,
16
+ env_name: "DELIVER_API_KEY_PATH",
17
+ description: "Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)",
18
+ optional: true,
19
+ conflicting_options: [:username],
20
+ verify_block: proc do |value|
21
+ UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
22
+ end),
23
+ FastlaneCore::ConfigItem.new(key: :api_key,
24
+ env_name: "DELIVER_API_KEY",
25
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
26
+ type: Hash,
27
+ optional: true,
28
+ sensitive: true,
29
+ conflicting_options: [:api_key_path, :username]),
30
+
15
31
  FastlaneCore::ConfigItem.new(key: :username,
16
32
  short_option: "-u",
17
33
  env_name: "DELIVER_USERNAME",
@@ -129,7 +145,7 @@ module Deliver
129
145
  default_value: false),
130
146
  FastlaneCore::ConfigItem.new(key: :skip_app_version_update,
131
147
  env_name: "DELIVER_SKIP_APP_VERSION_UPDATE",
132
- description: "Don't update app version for submission",
148
+ description: "Dont create or update the app version that is being prepared for submission",
133
149
  is_string: false,
134
150
  default_value: false),
135
151
 
@@ -26,9 +26,22 @@ module Deliver
26
26
  end
27
27
 
28
28
  def login
29
- UI.message("Login to App Store Connect (#{options[:username]})")
30
- Spaceship::ConnectAPI.login(options[:username], nil, use_portal: false, use_tunes: true)
31
- UI.message("Login successful")
29
+ if api_token
30
+ UI.message("Creating authorization token for App Store Connect API")
31
+ Spaceship::ConnectAPI.token = api_token
32
+ else
33
+ # Team selection passed though FASTLANE_TEAM_ID and FASTLANE_TEAM_NAME environment variables
34
+ # Prompts select team if multiple teams and none specified
35
+ UI.message("Login to App Store Connect (#{options[:username]})")
36
+ Spaceship::ConnectAPI.login(options[:username], nil, use_portal: false, use_tunes: true)
37
+ UI.message("Login successful")
38
+ end
39
+ end
40
+
41
+ def api_token
42
+ @api_token ||= Spaceship::ConnectAPI::Token.create(options[:api_key]) if options[:api_key]
43
+ @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(options[:api_key_path]) if options[:api_key_path]
44
+ return @api_token
32
45
  end
33
46
 
34
47
  def run
@@ -65,10 +78,21 @@ module Deliver
65
78
  precheck_options = {
66
79
  default_rule_level: options[:precheck_default_rule_level],
67
80
  include_in_app_purchases: options[:precheck_include_in_app_purchases],
68
- app_identifier: options[:app_identifier],
69
- username: options[:username]
81
+ app_identifier: options[:app_identifier]
70
82
  }
71
83
 
84
+ if options[:api_key] || options[:api_key_path]
85
+ if options[:precheck_include_in_app_purchases]
86
+ UI.user_error!("Precheck cannot check In-app purchases with the App Store Connect API Key (yet). Exclude In-app purchases from precheck or use Apple ID login")
87
+ end
88
+
89
+ precheck_options[:api_key] = options[:api_key]
90
+ precheck_options[:api_key_path] = options[:api_key_path]
91
+ else
92
+ precheck_options[:username] = options[:username]
93
+ precheck_options[:platform] = options[:platform]
94
+ end
95
+
72
96
  precheck_config = FastlaneCore::Configuration.create(Precheck::Options.available_options, precheck_options)
73
97
  Precheck.config = precheck_config
74
98
 
@@ -172,10 +196,17 @@ module Deliver
172
196
 
173
197
  private
174
198
 
199
+ # If App Store Connect API token, use token.
175
200
  # If itc_provider was explicitly specified, use it.
176
201
  # If there are multiple teams, infer the provider from the selected team name.
177
202
  # If there are fewer than two teams, don't infer the provider.
178
203
  def transporter_for_selected_team
204
+ # Use JWT auth
205
+ unless api_token.nil?
206
+ api_token.refresh! if api_token.expired?
207
+ return FastlaneCore::ItunesTransporter.new(nil, nil, false, nil, api_token.text)
208
+ end
209
+
179
210
  tunes_client = Spaceship::ConnectAPI.client.tunes_client
180
211
 
181
212
  generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider])
@@ -96,7 +96,7 @@ module Deliver
96
96
 
97
97
  if v.nil?
98
98
  UI.message("Couldn't find live version, editing the current version on App Store Connect instead")
99
- version = app.get_edit_app_store_version(platform: platform)
99
+ version = fetch_edit_app_store_version(app, platform)
100
100
  # we don't want to update the localised_options and non_localised_options
101
101
  # as we also check for `options[:edit_live]` at other areas in the code
102
102
  # by not touching those 2 variables, deliver is more consistent with what the option says
@@ -105,13 +105,17 @@ module Deliver
105
105
  UI.message("Found live version")
106
106
  end
107
107
  else
108
- version = app.get_edit_app_store_version(platform: platform)
108
+ version = fetch_edit_app_store_version(app, platform)
109
109
  localised_options = (LOCALISED_VERSION_VALUES.keys + LOCALISED_APP_VALUES.keys)
110
110
  non_localised_options = NON_LOCALISED_VERSION_VALUES.keys
111
111
  end
112
112
 
113
113
  # Needed for to filter out release notes from being sent up
114
- number_of_versions = app.get_app_store_versions(filter: { platform: platform }, limit: 2).size
114
+ number_of_versions = Spaceship::ConnectAPI.get_app_store_versions(
115
+ app_id: app.id,
116
+ filter: { platform: platform },
117
+ limit: 2
118
+ ).count
115
119
  is_first_version = number_of_versions == 1
116
120
  UI.verbose("Version '#{version.version_string}' is the first version on App Store Connect") if is_first_version
117
121
 
@@ -202,7 +206,7 @@ module Deliver
202
206
  end
203
207
 
204
208
  # Update categories
205
- app_info = app.fetch_edit_app_info
209
+ app_info = fetch_edit_app_info(app)
206
210
  if app_info
207
211
  category_id_map = {}
208
212
 
@@ -410,9 +414,35 @@ module Deliver
410
414
  .uniq
411
415
  end
412
416
 
417
+ def fetch_edit_app_store_version(app, platform, wait_time: 10)
418
+ retry_if_nil("Cannot find edit app store version", wait_time: wait_time) do
419
+ app.get_edit_app_store_version(platform: platform)
420
+ end
421
+ end
422
+
423
+ def fetch_edit_app_info(app, wait_time: 10)
424
+ retry_if_nil("Cannot find edit app info", wait_time: wait_time) do
425
+ app.fetch_edit_app_info
426
+ end
427
+ end
428
+
429
+ def retry_if_nil(message, tries: 5, wait_time: 10)
430
+ loop do
431
+ tries -= 1
432
+
433
+ value = yield
434
+ return value if value
435
+
436
+ UI.message("#{message}... Retrying after #{wait_time} seconds (remaining: #{tries})")
437
+ sleep(wait_time)
438
+
439
+ return nil if tries.zero?
440
+ end
441
+ end
442
+
413
443
  # Finding languages to enable
414
444
  def verify_available_info_languages!(options, app, languages)
415
- app_info = app.fetch_edit_app_info
445
+ app_info = fetch_edit_app_info(app)
416
446
 
417
447
  unless app_info
418
448
  UI.user_error!("Cannot update languages - could not find an editable info")
@@ -447,7 +477,7 @@ module Deliver
447
477
  # Finding languages to enable
448
478
  def verify_available_version_languages!(options, app, languages)
449
479
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
450
- version = app.get_edit_app_store_version(platform: platform)
480
+ version = fetch_edit_app_store_version(app, platform)
451
481
 
452
482
  unless version
453
483
  UI.user_error!("Cannot update languages - could not find an editable version for '#{platform}'")
@@ -14,9 +14,14 @@ module Deliver
14
14
  attributes = {}
15
15
  territory_ids = []
16
16
 
17
- app_prices = app.fetch_app_prices
17
+ # As of 2020-09-14:
18
+ # Official App Store Connect does not have an endpoint to get app prices for an app
19
+ # Need to get prices from the app's relationships
20
+ # Prices from app's relationship doess not have price tier so need to fetch app price with price tier relationship
21
+ app_prices = app.prices
18
22
  if app_prices.first
19
- old_price = app_prices.first.price_tier.id
23
+ app_price = Spaceship::ConnectAPI.get_app_price(app_price_id: app_prices.first.id, includes: "priceTier").first
24
+ old_price = app_price.price_tier.id
20
25
  else
21
26
  UI.message("App has no prices yet... Enabling all countries in App Store Connect")
22
27
  territory_ids = Spaceship::ConnectAPI::Territory.all.map(&:id)
@@ -4,6 +4,25 @@ module Fastlane
4
4
  LANE_NAME = :LANE_NAME
5
5
  PLATFORM_NAME = :PLATFORM_NAME
6
6
  ENVIRONMENT = :ENVIRONMENT
7
+
8
+ # A slighly decorated hash that will store and fetch sensitive data
9
+ # but not display it while iterating keys and values
10
+ class LaneContextValues < Hash
11
+ def initialize
12
+ @sensitive_context = {}
13
+ end
14
+
15
+ def set_sensitive(key, value)
16
+ @sensitive_context[key] = value
17
+ end
18
+
19
+ def [](key)
20
+ if @sensitive_context.key?(key)
21
+ return @sensitive_context[key]
22
+ end
23
+ super
24
+ end
25
+ end
7
26
  end
8
27
 
9
28
  def self.reset_aliases
@@ -27,7 +46,7 @@ module Fastlane
27
46
 
28
47
  # The shared hash can be accessed by any action and contains information like the screenshots path or beta URL
29
48
  def self.lane_context
30
- @lane_context ||= {}
49
+ @lane_context ||= SharedValues::LaneContextValues.new
31
50
  end
32
51
 
33
52
  # Used in tests to get a clear lane before every test