fastlane-plugin-polidea 1.0.0.pre → 2.2.0.pre.1

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 (42) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +1 -3
  3. data/lib/fastlane/plugin/polidea.rb +7 -0
  4. data/lib/fastlane/plugin/polidea/actions/add_prefix_schema.rb +3 -0
  5. data/lib/fastlane/plugin/polidea/actions/extract_app_icon.rb +4 -0
  6. data/lib/fastlane/plugin/polidea/actions/extract_app_info.rb +11 -8
  7. data/lib/fastlane/plugin/polidea/actions/extract_app_name.rb +3 -0
  8. data/lib/fastlane/plugin/polidea/actions/extract_version.rb +4 -0
  9. data/lib/fastlane/plugin/polidea/actions/fota_mail.rb +14 -16
  10. data/lib/fastlane/plugin/polidea/actions/fota_s3.rb +28 -33
  11. data/lib/fastlane/plugin/polidea/actions/get_binary_size.rb +4 -0
  12. data/lib/fastlane/plugin/polidea/actions/import_provisioning.rb +5 -0
  13. data/lib/fastlane/plugin/polidea/actions/release_notes.rb +5 -0
  14. data/lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb +54 -0
  15. data/lib/fastlane/plugin/polidea/actions/shuttle.rb +6 -38
  16. data/lib/fastlane/plugin/polidea/helper/analytics.rb +43 -0
  17. data/lib/fastlane/plugin/polidea/helper/mime.rb +22 -0
  18. data/lib/fastlane/plugin/polidea/helper/page_generator.rb +39 -3
  19. data/lib/fastlane/plugin/polidea/helper/qr_generator.rb +7 -7
  20. data/lib/fastlane/plugin/polidea/helper/shuttle.rb +39 -0
  21. data/lib/fastlane/plugin/polidea/templates/download.erb +481 -0
  22. data/lib/fastlane/plugin/polidea/templates/images/cover-shuttle.jpg +0 -0
  23. data/lib/fastlane/plugin/polidea/templates/images/icon-placeholder.png +0 -0
  24. data/lib/fastlane/plugin/polidea/templates/images/polidea-logo.png +0 -0
  25. data/lib/fastlane/plugin/polidea/templates/images/social-behance.png +0 -0
  26. data/lib/fastlane/plugin/polidea/templates/images/social-dribbble.png +0 -0
  27. data/lib/fastlane/plugin/polidea/templates/images/social-facebook.png +0 -0
  28. data/lib/fastlane/plugin/polidea/templates/images/social-github.png +0 -0
  29. data/lib/fastlane/plugin/polidea/templates/images/social-instagram.png +0 -0
  30. data/lib/fastlane/plugin/polidea/templates/images/social-linkedin.png +0 -0
  31. data/lib/fastlane/plugin/polidea/templates/images/social-twitter.png +0 -0
  32. data/lib/fastlane/plugin/polidea/templates/installation-page/css/installation-page.css +2835 -1082
  33. data/lib/fastlane/plugin/polidea/templates/installation_template.erb +3 -7
  34. data/lib/fastlane/plugin/polidea/templates/mailgun_template.erb +56 -24
  35. data/lib/fastlane/plugin/polidea/templates/secure_installation_template.erb +6 -10
  36. data/lib/fastlane/plugin/polidea/version.rb +1 -1
  37. metadata +97 -20
  38. data/lib/fastlane/plugin/polidea/actions/polidea_store.rb +0 -255
  39. data/lib/fastlane/plugin/polidea/templates/images/logo.png +0 -0
  40. data/lib/fastlane/plugin/polidea/templates/images/polidea-facebook-icon.png +0 -0
  41. data/lib/fastlane/plugin/polidea/templates/images/polidea-github-icon.png +0 -0
  42. data/lib/fastlane/plugin/polidea/templates/images/polidea-twitter-icon.png +0 -0
@@ -42,15 +42,11 @@
42
42
  </div>
43
43
  </div>
44
44
 
45
- <% if release_notes && release_notes.count > 0 %>
46
- <div class="row section">
45
+ <% if !release_notes.nil? %>
46
+ <div class="row section release-notes">
47
47
  <div class="small-12 columns">
48
48
  <span class="whats-new">What's new:</span>
49
- <ul>
50
- <% for @item in release_notes %>
51
- <li><%= @item %></li>
52
- <% end %>
53
- </ul>
49
+ <%= release_notes %>
54
50
  </div>
55
51
  </div>
56
52
  <% end %>
@@ -586,11 +586,6 @@ table.radius td {
586
586
  border-radius: 3px;
587
587
  }
588
588
 
589
- table.round td {
590
- -webkit-border-radius: 500px;
591
- -moz-border-radius: 500px;
592
- border-radius: 500px;
593
- }
594
589
 
595
590
  /* Outlook First */
596
591
 
@@ -832,12 +827,6 @@ body.outlook p {
832
827
  max-height: 50px;
833
828
  }
834
829
 
835
- .logo-decoration {
836
- border-radius: 5px;
837
- -moz-border-radius: 5px;
838
- -webkit-border-radius: 5px;
839
- }
840
-
841
830
  .container-margin {
842
831
  margin-top: 10px !important;
843
832
  margin-bottom: 10px !important;
@@ -918,12 +907,61 @@ td.whats-new-wrapper {
918
907
  color: #666666;
919
908
  }
920
909
 
921
- li.release-note {
922
- color: #666666;
910
+ .release-notes {
911
+ color: #666666;
912
+ }
913
+
914
+ .release-notes ul {
915
+ padding-left: 14px !important;
916
+ }
917
+
918
+ .release-notes li {
923
919
  padding: 0;
924
920
  margin: 0;
925
921
  }
926
922
 
923
+ .release-notes h1,
924
+ .release-notes h2,
925
+ .release-notes h3,
926
+ .release-notes h4,
927
+ .release-notes h5,
928
+ .release-notes h6 {
929
+ margin-top: 24px;
930
+ margin-bottom: 16px;
931
+ font-weight: 600;
932
+ line-height: 1.25;
933
+ }
934
+
935
+ .release-notes h1 {
936
+ color: #666666;
937
+ font-size: 1.625em;
938
+ }
939
+
940
+ .release-notes h2 {
941
+ color: #666666;
942
+ font-size: 1.5em;
943
+ }
944
+
945
+ .release-notes h3 {
946
+ color: #666666;
947
+ font-size: 1.25em;
948
+ }
949
+
950
+ .release-notes h4 {
951
+ color: #666666;
952
+ font-size: 1em;
953
+ }
954
+
955
+ .release-notes h5 {
956
+ color: #666666;
957
+ font-size: 0.875em;
958
+ }
959
+
960
+ .release-notes h6 {
961
+ color: #666666;
962
+ font-size: 0.85em;
963
+ }
964
+
927
965
  li.detailed-info {
928
966
  list-style: none;
929
967
  color: #666666;
@@ -1021,7 +1059,7 @@ img.polidea-logo {
1021
1059
  <% if app_icon %>
1022
1060
  <img src="cid:<%= app_icon %>" class="app-icon"/>
1023
1061
  <% else %>
1024
- <img src="cid:icon-placeholder.png" class="app-icon logo-decoration"/>
1062
+ <img src="cid:icon-placeholder.png" class="app-icon"/>
1025
1063
  <% end %>
1026
1064
  </td>
1027
1065
  <td class="expander"></td>
@@ -1072,21 +1110,15 @@ img.polidea-logo {
1072
1110
  </tr>
1073
1111
  </table>
1074
1112
 
1075
- <% if !release_notes.nil? && release_notes.count > 0 %>
1076
- <table class="row section">
1113
+ <% if !release_notes.nil? %>
1114
+ <table class="row section release-notes">
1077
1115
  <tr>
1078
1116
  <td class="wrapper last whats-new-wrapper">
1079
1117
  <table class="twelve columns">
1080
1118
  <tr>
1081
1119
  <td>
1082
-
1083
- <span class="whats-new">What's new:</span>
1084
- <ul class="list">
1085
- <% for @item in release_notes %>
1086
- <li class="release-note"><%= @item %></li>
1087
- <% end %>
1088
- </ul>
1089
-
1120
+ <span class="whats-new">What's new:</span>
1121
+ <%= release_notes %>
1090
1122
  </td>
1091
1123
  </tr>
1092
1124
  </table>
@@ -57,17 +57,13 @@
57
57
  </div>
58
58
  </div>
59
59
 
60
- <% if release_notes && release_notes.count > 0 %>
61
- <div class="row section">
62
- <div class="small-12 columns">
63
- <span class="whats-new">What's new:</span>
64
- <ul>
65
- <% for @item in release_notes %>
66
- <li><%= @item %></li>
67
- <% end %>
68
- </ul>
60
+ <% if !release_notes.nil? %>
61
+ <div class="row section release-notes">
62
+ <div class="small-12 columns">
63
+ <span class="whats-new">What's new:</span>
64
+ <%= release_notes %>
65
+ </div>
69
66
  </div>
70
- </div>
71
67
  <% end %>
72
68
 
73
69
  <script src="installation-page/js/vendor/pbkdf2.js"></script>
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Polidea
3
- VERSION = "1.0.0.pre"
3
+ VERSION = "2.2.0.pre.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-polidea
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 2.2.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek Dubiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-18 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.17.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.17.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: plist
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,19 +39,19 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: 3.1.0
27
41
  - !ruby/object:Gem::Dependency
28
- name: aws-sdk
42
+ name: aws-sdk-s3
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "<"
45
+ - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '2'
47
+ version: '1.61'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "<"
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '2'
54
+ version: '1.61'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: premailer
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +72,34 @@ dependencies:
58
72
  - - ">="
59
73
  - !ruby/object:Gem::Version
60
74
  version: 1.8.7
75
+ - !ruby/object:Gem::Dependency
76
+ name: json
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 1.8.0
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 1.8.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: nokogiri
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.10'
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.10'
61
103
  - !ruby/object:Gem::Dependency
62
104
  name: rqrcode_png
63
105
  requirement: !ruby/object:Gem::Requirement
@@ -87,19 +129,33 @@ dependencies:
87
129
  - !ruby/object:Gem::Version
88
130
  version: '0.7'
89
131
  - !ruby/object:Gem::Dependency
90
- name: bundler
132
+ name: redcarpet
91
133
  requirement: !ruby/object:Gem::Requirement
92
134
  requirements:
93
135
  - - ">="
94
136
  - !ruby/object:Gem::Version
95
137
  version: '0'
96
- type: :development
138
+ type: :runtime
97
139
  prerelease: false
98
140
  version_requirements: !ruby/object:Gem::Requirement
99
141
  requirements:
100
142
  - - ">="
101
143
  - !ruby/object:Gem::Version
102
144
  version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: bundler
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '2.0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '2.0'
103
159
  - !ruby/object:Gem::Dependency
104
160
  name: rspec
105
161
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +198,20 @@ dependencies:
142
198
  - - ">="
143
199
  - !ruby/object:Gem::Version
144
200
  version: '0'
201
+ - !ruby/object:Gem::Dependency
202
+ name: rb-readline
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ type: :development
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
145
215
  - !ruby/object:Gem::Dependency
146
216
  name: rubocop
147
217
  requirement: !ruby/object:Gem::Requirement
@@ -174,16 +244,16 @@ dependencies:
174
244
  name: fastlane
175
245
  requirement: !ruby/object:Gem::Requirement
176
246
  requirements:
177
- - - ">="
247
+ - - "~>"
178
248
  - !ruby/object:Gem::Version
179
- version: 1.100.0
249
+ version: '2.0'
180
250
  type: :development
181
251
  prerelease: false
182
252
  version_requirements: !ruby/object:Gem::Requirement
183
253
  requirements:
184
- - - ">="
254
+ - - "~>"
185
255
  - !ruby/object:Gem::Version
186
- version: 1.100.0
256
+ version: '2.0'
187
257
  description:
188
258
  email: piotr.dubiel@polidea.com
189
259
  executables: []
@@ -202,17 +272,25 @@ files:
202
272
  - lib/fastlane/plugin/polidea/actions/fota_s3.rb
203
273
  - lib/fastlane/plugin/polidea/actions/get_binary_size.rb
204
274
  - lib/fastlane/plugin/polidea/actions/import_provisioning.rb
205
- - lib/fastlane/plugin/polidea/actions/polidea_store.rb
206
275
  - lib/fastlane/plugin/polidea/actions/release_notes.rb
276
+ - lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb
207
277
  - lib/fastlane/plugin/polidea/actions/shuttle.rb
278
+ - lib/fastlane/plugin/polidea/helper/analytics.rb
279
+ - lib/fastlane/plugin/polidea/helper/mime.rb
208
280
  - lib/fastlane/plugin/polidea/helper/page_generator.rb
209
281
  - lib/fastlane/plugin/polidea/helper/qr_generator.rb
282
+ - lib/fastlane/plugin/polidea/helper/shuttle.rb
283
+ - lib/fastlane/plugin/polidea/templates/download.erb
284
+ - lib/fastlane/plugin/polidea/templates/images/cover-shuttle.jpg
210
285
  - lib/fastlane/plugin/polidea/templates/images/icon-placeholder.png
211
- - lib/fastlane/plugin/polidea/templates/images/logo.png
212
- - lib/fastlane/plugin/polidea/templates/images/polidea-facebook-icon.png
213
- - lib/fastlane/plugin/polidea/templates/images/polidea-github-icon.png
214
286
  - lib/fastlane/plugin/polidea/templates/images/polidea-logo.png
215
- - lib/fastlane/plugin/polidea/templates/images/polidea-twitter-icon.png
287
+ - lib/fastlane/plugin/polidea/templates/images/social-behance.png
288
+ - lib/fastlane/plugin/polidea/templates/images/social-dribbble.png
289
+ - lib/fastlane/plugin/polidea/templates/images/social-facebook.png
290
+ - lib/fastlane/plugin/polidea/templates/images/social-github.png
291
+ - lib/fastlane/plugin/polidea/templates/images/social-instagram.png
292
+ - lib/fastlane/plugin/polidea/templates/images/social-linkedin.png
293
+ - lib/fastlane/plugin/polidea/templates/images/social-twitter.png
216
294
  - lib/fastlane/plugin/polidea/templates/installation-page/css/installation-page.css
217
295
  - lib/fastlane/plugin/polidea/templates/installation-page/css/installation-page.css.map
218
296
  - lib/fastlane/plugin/polidea/templates/installation-page/img/bg.png
@@ -321,8 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
399
  - !ruby/object:Gem::Version
322
400
  version: 1.3.1
323
401
  requirements: []
324
- rubyforge_project:
325
- rubygems_version: 2.6.8
402
+ rubygems_version: 3.0.1
326
403
  signing_key:
327
404
  specification_version: 4
328
405
  summary: Polidea's fastlane action
@@ -1,255 +0,0 @@
1
- # rubocop:disable Metrics/MethodLength
2
-
3
- require 'net/http'
4
- require 'uri'
5
- require 'json'
6
-
7
- module Fastlane
8
- module Actions
9
- class PolideaStoreAction < Action
10
- def self.run(params)
11
- platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME].to_sym
12
- validate(platform, params)
13
- config = get_config(platform, params)
14
- app_name, app_identifier, version = notify(platform, config)
15
-
16
- UI.success("Successfully uploaded #{app_name} (#{app_identifier})")
17
- UI.success("version: #{version}")
18
- UI.success("using icon from #{params[:icon_url]}") if params[:icon_url]
19
- UI.success("using plist from #{params[:plist_url]}") if platform == :ios
20
- UI.success("with release notes: #{params[:release_notes]}") if params[:release_notes]
21
- end
22
-
23
- #####################################################
24
- # @!group Documentation
25
- #####################################################
26
-
27
- def self.description
28
- "Polidea Store upload action"
29
- end
30
-
31
- def self.details
32
- "Notify Polidea Store about new app version"
33
- end
34
-
35
- def self.author
36
- ["Piotrek Dubiel"]
37
- end
38
-
39
- def self.available_options
40
- [
41
- FastlaneCore::ConfigItem.new(key: :api_token,
42
- env_name: "POLIDEA_STORE_API_TOKEN",
43
- description: "API Token for Polidea Store",
44
- verify_block: proc do |value|
45
- UI.user_error!("No API token for Polidea Store given, pass using `api_token: 'token'`") unless value and !value.empty?
46
- end),
47
- FastlaneCore::ConfigItem.new(key: :ipa,
48
- env_name: "",
49
- description: ".ipa file for the build ",
50
- optional: true,
51
- default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]),
52
- FastlaneCore::ConfigItem.new(key: :apk,
53
- env_name: "",
54
- description: ".apk file for the build ",
55
- optional: true,
56
- default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]),
57
- FastlaneCore::ConfigItem.new(key: :plist_url,
58
- env_name: "POLIDEA_STORE_PLIST_URL",
59
- description: "Url to uploaded plist",
60
- default_value: Actions.lane_context[SharedValues::S3_PLIST_OUTPUT_PATH],
61
- verify_block: proc do |value|
62
- UI.user_error!("No plist url given, pass using `plist_url: 'url'` or make sure s3 action succeded and exposed S3_PLIST_OUTPUT_PATH shared value") unless value and !value.empty?
63
- end),
64
- FastlaneCore::ConfigItem.new(key: :apk_url,
65
- env_name: "POLIDEA_STORE_APK_URL",
66
- description: "Url to uploaded apk",
67
- default_value: Actions.lane_context[SharedValues::S3_APK_OUTPUT_PATH],
68
- verify_block: proc do |value|
69
- UI.user_error!("No apk url given, pass using `apk_url: 'url'` or make sure s3 action succeded and exposed S3_APK_OUTPUT_PATH shared value") unless value and !value.empty?
70
- end),
71
- FastlaneCore::ConfigItem.new(key: :icon_url,
72
- env_name: "POLIDEA_STORE_ICON_URL",
73
- description: "Url to uploaded app icon",
74
- default_value: Actions.lane_context[SharedValues::S3_ICON_OUTPUT_PATH],
75
- optional: true),
76
- FastlaneCore::ConfigItem.new(key: :release_notes,
77
- env_name: "",
78
- description: "Release notes to be attached to uploaded version",
79
- is_string: true,
80
- optional: true,
81
- default_value: Actions.lane_context[SharedValues::RELEASE_NOTES]),
82
- FastlaneCore::ConfigItem.new(key: :app_name,
83
- env_name: "",
84
- description: "Application name (defaults to results of extract_app_name action)",
85
- is_string: true,
86
- optional: true),
87
- FastlaneCore::ConfigItem.new(key: :bundle_id,
88
- env_name: "",
89
- description: "Bundle id, used if platform equals :ios",
90
- is_string: true,
91
- optional: true),
92
- FastlaneCore::ConfigItem.new(key: :bundle_version,
93
- env_name: "",
94
- description: "Bundle version, used if platform equals :ios",
95
- is_string: true,
96
- optional: true),
97
- FastlaneCore::ConfigItem.new(key: :package_name,
98
- env_name: "",
99
- description: "Package name, used if platform equals :android",
100
- is_string: true,
101
- optional: true),
102
- FastlaneCore::ConfigItem.new(key: :version_name,
103
- env_name: "",
104
- description: "Version name, used if platform equals :android",
105
- is_string: true,
106
- optional: true),
107
- FastlaneCore::ConfigItem.new(key: :version_code,
108
- env_name: "",
109
- description: "Version code, used if platform equals :android",
110
- type: Integer,
111
- optional: true),
112
- FastlaneCore::ConfigItem.new(key: :binary_size,
113
- env_name: "",
114
- description: ".ipa/.apk binary size in bytes",
115
- type: Integer,
116
- optional: true)
117
- ]
118
- end
119
-
120
- def self.is_supported?(platform)
121
- [:ios, :android].include? platform
122
- end
123
-
124
- def self.category
125
- :deprecated
126
- end
127
-
128
- def self.validate(platform, params)
129
- binary_size = params[:binary_size] || Actions.lane_context[Actions::SharedValues::BINARY_SIZE]
130
- UI.user_error!("No binary size given, pass using `binary_size: bytes` or make sure get_binary_size action succeded and exposed BINARY_SIZE shared value") unless binary_size and !binary_size.nil?
131
-
132
- case platform
133
- when :android
134
- UI.user_error!("No .apk file given, pass using `apk: 'apk path'` or make sure gradle action succeded and exposed GRADLE_APK_OUTPUT_PATH shared value") unless params[:apk] and !params[:apk].empty?
135
- when :ios
136
- UI.user_error!("No .ipa file given, pass using `ipa: 'ipa path'` or make sure gym action succeded and exposed IPA_OUTPUT_PATH shared value") unless params[:ipa] and !params[:ipa].empty?
137
- end
138
- end
139
-
140
- def self.get_config(platform, params)
141
- binary_size = params[:binary_size] || Actions.lane_context[Actions::SharedValues::BINARY_SIZE]
142
- api_token = params[:api_token]
143
- icon_url = params[:icon_url]
144
- release_notes = params[:release_notes]
145
-
146
- case platform
147
- when :ios
148
- info = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(params[:ipa])
149
- app_name = params[:app_name] || info['CFBundleDisplayName'] || info['CFBundleName']
150
- app_identifier = params[:bundle_id] || info['CFBundleIdentifier']
151
- version = params[:bundle_version] || info['CFBundleShortVersionString']
152
- href = itms_href(params[:plist_url])
153
- url_scheme = get_url_scheme(info)
154
- UI.user_error!("No prefix scheme found in Info.plist. Make sure `add_prefix_schema` action succeded before build action") if url_scheme.nil?
155
- when :android
156
- manifest = Android::Apk.new(params[:apk]).manifest
157
- app_name = params[:app_name] || manifest.label
158
- app_identifier = params[:package_name] || manifest.package_name
159
- version = params[:version_name] || manifest.version_name
160
- version_code = params[:version_code] || manifest.version_code
161
- href = params[:apk_url]
162
- end
163
-
164
- config = {
165
- api_token: api_token,
166
- app_name: app_name,
167
- app_identifier: app_identifier,
168
- version: version,
169
- version_code: version_code,
170
- icon_url: icon_url,
171
- href: href,
172
- release_notes: release_notes,
173
- binary_size: binary_size,
174
- url_scheme: url_scheme
175
- }
176
-
177
- return config
178
- end
179
-
180
- def self.notify(platform, params)
181
- uri = URI.parse(url(platform, params[:app_identifier]))
182
-
183
- version = {
184
- version: params[:version],
185
- releaseNotes: params[:release_notes],
186
- href: params[:href],
187
- bytes: params[:binary_size]
188
- }
189
-
190
- version[:prefixSchema] = params[:url_scheme] if platform == :ios
191
- version[:versionCode] = params[:version_code] if platform == :android
192
-
193
- http = Net::HTTP.new(uri.host, uri.port)
194
- http.use_ssl = true
195
-
196
- req = create_request(uri, params[:api_token], {
197
- name: params[:app_name],
198
- icon: {
199
- href: params[:icon_url]
200
- },
201
- versions: [version]
202
- })
203
-
204
- response = http.request(req)
205
- unless response.code == "204"
206
- UI.user_error! "Polidea Store backend responded with [#{response.code}] #{response.body}"
207
- end
208
-
209
- return params[:app_name], params[:app_identifier], params[:version]
210
- end
211
- private_class_method :notify
212
-
213
- def self.url(platform, app_identifier)
214
- "#{base_url}/#{platform}/apps/#{app_identifier}/versions"
215
- end
216
- private_class_method :url
217
-
218
- def self.base_url
219
- "https://polideastore.herokuapp.com"
220
- # "https://polideastore-staging.herokuapp.com"
221
- end
222
- private_class_method :base_url
223
-
224
- def self.create_request(uri, upload_token, params)
225
- req = Net::HTTP::Post.new(uri.request_uri)
226
- req['Content-Type'] = 'application/json'
227
- req['Upload-Token'] = upload_token
228
- req.body = JSON.generate(params)
229
- req
230
- end
231
- private_class_method :create_request
232
-
233
- def self.itms_href(plist_url)
234
- "itms-services://?action=download-manifest&url=#{URI.encode_www_form_component(plist_url)}"
235
- end
236
- private_class_method :itms_href
237
-
238
- def self.get_url_scheme(plist)
239
- url_scheme = nil
240
- url_types = plist['CFBundleURLTypes']
241
- unless url_types.nil?
242
- url_type = url_types[0]
243
- url_schemes = url_type['CFBundleURLSchemes']
244
- unless url_schemes.nil?
245
- url_scheme = url_schemes[0]
246
- end
247
- end
248
- url_scheme
249
- end
250
- private_class_method :get_url_scheme
251
- end
252
- end
253
- end
254
-
255
- # rubocop:enable Metrics/MethodLength