fastlane-plugin-appcenter 1.0.0 → 1.0.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9440d71c43f62ccae7c488cbd00b0aeef150abfa8ec5910e650a1c35d6087e20
|
4
|
+
data.tar.gz: 04ee877a3a4bd5835c5134b7354e9385ffcb98aeb53b6d39caa8d70d5fe3bc0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a3529b0ed5e6ff582daeea5dceb8c1af8cd78dd80a94cf7bfd1fb86518b71da5c6891d82de7acadcf6e22b2456ce5f9b50c871941db5d2c356d44592cbe7d4c
|
7
|
+
data.tar.gz: e980942bf5addbf026fd42c5ccbb276806584c748f69cb4d97d23b77a127526bc9ac8028afbf96183c915037cc24f6872a1968643ed48884fbcd95f590db09e7
|
data/README.md
CHANGED
@@ -36,9 +36,12 @@ The action parameters `api_token` and `owner_name` can also be omitted when thei
|
|
36
36
|
- `APPCENTER_APP_NAME` - App name. If there is no app with such name, you will be prompted to create one
|
37
37
|
- `APPCENTER_DISTRIBUTE_APK` - Build release path for android build
|
38
38
|
- `APPCENTER_DISTRIBUTE_IPA` - Build release path for ios build
|
39
|
-
- `APPCENTER_DISTRIBUTE_DSYM` - Path to your symbols
|
39
|
+
- `APPCENTER_DISTRIBUTE_DSYM` - Path to your symbols (app.dSYM.zip) file
|
40
40
|
- `APPCENTER_DISTRIBUTE_UPLOAD_DSYM_ONLY` - Flag to upload only the dSYM file to App Center
|
41
|
-
- `
|
41
|
+
- `APPCENTER_DISTRIBUTE_ANDROID_MAPPING` - Path to your Android mapping.txt file
|
42
|
+
- `APPCENTER_DISTRIBUTE_UPLOAD_ANDROID_MAPPING_ONLY` - Flag to upload only the mapping file to App Center
|
43
|
+
- `APPCENTER_DISTRIBUTE_DESTINATIONS` - Comma separated list of destination names. Both distribution groups and stores are supported. All names are required to be of the same destination type. Default is `Collaborators`.
|
44
|
+
- `APPCENTER_DISTRIBUTE_DESTINATION_TYPE` - Destination type of distribution destination. `group` and `store` are supported. Default is `group`
|
42
45
|
- `APPCENTER_DISTRIBUTE_MANDATORY_UPDATE` - Require users to update to this release
|
43
46
|
- `APPCENTER_DISTRIBUTE_NOTIFY_TESTERS` - Send email notification about release (default: `false`)
|
44
47
|
- `APPCENTER_DISTRIBUTE_RELEASE_NOTES` - Release notes
|
@@ -45,6 +45,7 @@ module Fastlane
|
|
45
45
|
|
46
46
|
UI.message("Starting dSYM upload...")
|
47
47
|
|
48
|
+
# TODO: this should eventually be removed once we have warned of deprecation for long enough
|
48
49
|
if File.extname(dsym_path) == ".txt"
|
49
50
|
file_name = File.basename(dsym_path)
|
50
51
|
dsym_upload_details = Helper::AppcenterHelper.create_mapping_upload(api_token, owner_name, app_name, file_name ,build_number, version)
|
@@ -57,11 +58,37 @@ module Fastlane
|
|
57
58
|
upload_url = dsym_upload_details['upload_url']
|
58
59
|
|
59
60
|
UI.message("Uploading dSYM...")
|
60
|
-
Helper::AppcenterHelper.
|
61
|
+
Helper::AppcenterHelper.upload_symbol(api_token, owner_name, app_name, dsym_path, "Apple", symbol_upload_id, upload_url)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
66
|
+
def self.run_mapping_upload(params)
|
67
|
+
values = params.values
|
68
|
+
api_token = params[:api_token]
|
69
|
+
owner_name = params[:owner_name]
|
70
|
+
app_name = params[:app_name]
|
71
|
+
mapping = params[:mapping]
|
72
|
+
build_number = params[:build_number]
|
73
|
+
version = params[:version]
|
74
|
+
|
75
|
+
if mapping == nil
|
76
|
+
return
|
77
|
+
end
|
78
|
+
|
79
|
+
UI.message("Starting mapping upload...")
|
80
|
+
mapping_name = File.basename(mapping)
|
81
|
+
symbol_upload_details = Helper::AppcenterHelper.create_mapping_upload(api_token, owner_name, app_name, mapping_name, build_number, version)
|
82
|
+
|
83
|
+
if symbol_upload_details
|
84
|
+
symbol_upload_id = symbol_upload_details['symbol_upload_id']
|
85
|
+
upload_url = symbol_upload_details['upload_url']
|
86
|
+
|
87
|
+
UI.message("Uploading mapping...")
|
88
|
+
Helper::AppcenterHelper.upload_symbol(api_token, owner_name, app_name, mapping, "Android", symbol_upload_id, upload_url)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
65
92
|
# run whole upload process for release
|
66
93
|
def self.run_release_upload(params)
|
67
94
|
values = params.values
|
@@ -134,6 +161,9 @@ module Fastlane
|
|
134
161
|
api_token = params[:api_token]
|
135
162
|
owner_name = params[:owner_name]
|
136
163
|
app_name = params[:app_name]
|
164
|
+
app_display_name = params[:app_display_name]
|
165
|
+
app_os = params[:app_os]
|
166
|
+
app_platform = params[:app_platform]
|
137
167
|
|
138
168
|
platforms = {
|
139
169
|
"Android" => ['Java', 'React-Native', 'Xamarin'],
|
@@ -141,28 +171,37 @@ module Fastlane
|
|
141
171
|
}
|
142
172
|
|
143
173
|
if Helper::AppcenterHelper.get_app(api_token, owner_name, app_name)
|
144
|
-
true
|
145
|
-
|
146
|
-
if Helper.test? || UI.confirm("App with name #{app_name} not found, create one?")
|
147
|
-
os = Helper.test? ? "Android" : UI.select("Select OS", ["Android", "iOS"])
|
148
|
-
platform = Helper.test? ? "Java" : UI.select("Select Platform", platforms[os])
|
174
|
+
return true
|
175
|
+
end
|
149
176
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
177
|
+
should_create_app = !app_display_name.to_s.empty? || !app_os.to_s.empty? || !app_platform.to_s.empty?
|
178
|
+
|
179
|
+
if Helper.test? || should_create_app || UI.confirm("App with name #{app_name} not found, create one?")
|
180
|
+
app_display_name = app_name if app_display_name.to_s.empty?
|
181
|
+
os = app_os.to_s.empty? ?
|
182
|
+
(Helper.test? ? "Android" : UI.select("Select OS", ["Android", "iOS"])) :
|
183
|
+
app_os
|
184
|
+
platform = app_platform.to_s.empty? ?
|
185
|
+
(Helper.test? ? "Java" : UI.select("Select Platform", platforms[os])) :
|
186
|
+
app_platform
|
187
|
+
|
188
|
+
Helper::AppcenterHelper.create_app(api_token, owner_name, app_name, app_display_name, os, platform)
|
189
|
+
else
|
190
|
+
UI.error("Lane aborted")
|
191
|
+
false
|
155
192
|
end
|
156
193
|
end
|
157
194
|
|
158
195
|
def self.run(params)
|
159
196
|
values = params.values
|
160
197
|
upload_dsym_only = params[:upload_dsym_only]
|
198
|
+
upload_mapping_only = params[:upload_mapping_only]
|
161
199
|
|
162
200
|
# if app found or successfully created
|
163
201
|
if self.get_or_create_app(params)
|
164
|
-
self.run_release_upload(params) unless upload_dsym_only
|
165
|
-
self.run_dsym_upload(params)
|
202
|
+
self.run_release_upload(params) unless upload_dsym_only || upload_mapping_only
|
203
|
+
self.run_dsym_upload(params) unless upload_mapping_only
|
204
|
+
self.run_mapping_upload(params) unless upload_dsym_only
|
166
205
|
end
|
167
206
|
|
168
207
|
return values if Helper.test?
|
@@ -209,6 +248,24 @@ module Fastlane
|
|
209
248
|
UI.user_error!("No App name given, pass using `app_name: 'app name'`") unless value && !value.empty?
|
210
249
|
end),
|
211
250
|
|
251
|
+
FastlaneCore::ConfigItem.new(key: :app_display_name,
|
252
|
+
env_name: "APPCENTER_APP_DISPLAY_NAME",
|
253
|
+
description: "App display name to use when creating a new app",
|
254
|
+
optional: true,
|
255
|
+
type: String),
|
256
|
+
|
257
|
+
FastlaneCore::ConfigItem.new(key: :app_os,
|
258
|
+
env_name: "APPCENTER_APP_OS",
|
259
|
+
description: "App OS. Used for new app creation, if app with 'app_name' name was not found",
|
260
|
+
optional: true,
|
261
|
+
type: String),
|
262
|
+
|
263
|
+
FastlaneCore::ConfigItem.new(key: :app_platform,
|
264
|
+
env_name: "APPCENTER_APP_PLATFORM",
|
265
|
+
description: "App Platform. Used for new app creation, if app with 'app_name' name was not found",
|
266
|
+
optional: true,
|
267
|
+
type: String),
|
268
|
+
|
212
269
|
FastlaneCore::ConfigItem.new(key: :apk,
|
213
270
|
env_name: "APPCENTER_DISTRIBUTE_APK",
|
214
271
|
description: "Build release path for android build",
|
@@ -246,8 +303,10 @@ module Fastlane
|
|
246
303
|
optional: true,
|
247
304
|
type: String,
|
248
305
|
verify_block: proc do |value|
|
306
|
+
deprecated_files = [".txt"]
|
249
307
|
if value
|
250
308
|
UI.user_error!("Couldn't find dSYM file at path '#{value}'") unless File.exist?(value)
|
309
|
+
UI.message("Support for *.txt has been deprecated. Please use --mapping parameter or APPCENTER_DISTRIBUTE_ANDROID_MAPPING environment variable instead.") if deprecated_files.include? File.extname(value)
|
251
310
|
end
|
252
311
|
end),
|
253
312
|
|
@@ -258,6 +317,26 @@ module Fastlane
|
|
258
317
|
is_string: false,
|
259
318
|
default_value: false),
|
260
319
|
|
320
|
+
FastlaneCore::ConfigItem.new(key: :mapping,
|
321
|
+
env_name: "APPCENTER_DISTRIBUTE_ANDROID_MAPPING",
|
322
|
+
description: "Path to your Android mapping.txt",
|
323
|
+
optional: true,
|
324
|
+
type: String,
|
325
|
+
verify_block: proc do |value|
|
326
|
+
accepted_formats = [".txt"]
|
327
|
+
if value
|
328
|
+
UI.user_error!("Couldn't find mapping file at path '#{value}'") unless File.exist?(value)
|
329
|
+
UI.user_error!("Only \"*.txt\" formats are allowed, you provided \"#{File.name(value)}\"") unless accepted_formats.include? File.extname(value)
|
330
|
+
end
|
331
|
+
end),
|
332
|
+
|
333
|
+
FastlaneCore::ConfigItem.new(key: :upload_mapping_only,
|
334
|
+
env_name: "APPCENTER_DISTRIBUTE_UPLOAD_ANDROID_MAPPING_ONLY",
|
335
|
+
description: "Flag to upload only the mapping.txt file to App Center",
|
336
|
+
optional: true,
|
337
|
+
is_string: false,
|
338
|
+
default_value: false),
|
339
|
+
|
261
340
|
FastlaneCore::ConfigItem.new(key: :group,
|
262
341
|
env_name: "APPCENTER_DISTRIBUTE_GROUP",
|
263
342
|
description: "Comma separated list of Distribution Group names",
|
@@ -354,6 +433,9 @@ module Fastlane
|
|
354
433
|
apk: "./app-release.apk",
|
355
434
|
destinations: "Testers",
|
356
435
|
destination_type: "group",
|
436
|
+
build_number: "3",
|
437
|
+
version: "1.0.0",
|
438
|
+
mapping: "./mapping.txt",
|
357
439
|
release_notes: "release notes",
|
358
440
|
notify_testers: false
|
359
441
|
)',
|
@@ -123,8 +123,8 @@ module Fastlane
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
# committs or aborts
|
127
|
-
def self.
|
126
|
+
# committs or aborts symbol upload
|
127
|
+
def self.update_symbol_upload(api_token, owner_name, app_name, symbol_upload_id, status)
|
128
128
|
connection = self.connection
|
129
129
|
|
130
130
|
response = connection.patch do |req|
|
@@ -146,27 +146,30 @@ module Fastlane
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
-
# upload dSYM files to specified upload url
|
149
|
+
# upload symbol (dSYM or mapping) files to specified upload url
|
150
150
|
# if succeed, then commits the upload
|
151
151
|
# otherwise aborts
|
152
|
-
def self.
|
152
|
+
def self.upload_symbol(api_token, owner_name, app_name, symbol, symbol_type, symbol_upload_id, upload_url)
|
153
153
|
connection = self.connection(upload_url, true)
|
154
154
|
|
155
155
|
response = connection.put do |req|
|
156
156
|
req.headers['x-ms-blob-type'] = "BlockBlob"
|
157
|
-
req.headers['Content-Length'] = File.size(
|
157
|
+
req.headers['Content-Length'] = File.size(symbol).to_s
|
158
158
|
req.headers['internal-request-source'] = "fastlane"
|
159
|
-
req.body = Faraday::UploadIO.new(
|
159
|
+
req.body = Faraday::UploadIO.new(symbol, 'application/octet-stream') if symbol && File.exist?(symbol)
|
160
160
|
end
|
161
161
|
|
162
|
+
logType = "dSYM" if (symbol_type == "Apple")
|
163
|
+
logType = "mapping" if (symbol_type == "Android")
|
164
|
+
|
162
165
|
case response.status
|
163
166
|
when 200...300
|
164
|
-
self.
|
165
|
-
UI.success("
|
167
|
+
self.update_symbol_upload(api_token, owner_name, app_name, symbol_upload_id, 'committed')
|
168
|
+
UI.success("#{logType} uploaded")
|
166
169
|
else
|
167
|
-
UI.error("Error uploading
|
168
|
-
self.
|
169
|
-
UI.error("
|
170
|
+
UI.error("Error uploading #{logType} #{response.status}: #{response.body}")
|
171
|
+
self.update_symbol_upload(api_token, owner_name, app_name, symbol_upload_id, 'aborted')
|
172
|
+
UI.error("#{logType} upload aborted")
|
170
173
|
false
|
171
174
|
end
|
172
175
|
end
|
@@ -367,13 +370,13 @@ module Fastlane
|
|
367
370
|
UI.message("DEBUG: #{JSON.pretty_generate(response.body)}\n") if ENV['DEBUG']
|
368
371
|
false
|
369
372
|
else
|
370
|
-
UI.error("Error #{response.status}: #{response.body}")
|
373
|
+
UI.error("Error getting app #{owner}/#{app_name}, #{response.status}: #{response.body}")
|
371
374
|
false
|
372
375
|
end
|
373
376
|
end
|
374
377
|
|
375
378
|
# returns true if app exists, false in case of 404 and error otherwise
|
376
|
-
def self.create_app(api_token, owner_name, app_name, os, platform)
|
379
|
+
def self.create_app(api_token, owner_name, app_name, app_display_name, os, platform)
|
377
380
|
connection = self.connection
|
378
381
|
|
379
382
|
response = connection.post do |req|
|
@@ -381,7 +384,7 @@ module Fastlane
|
|
381
384
|
req.headers['X-API-Token'] = api_token
|
382
385
|
req.headers['internal-request-source'] = "fastlane"
|
383
386
|
req.body = {
|
384
|
-
"display_name" =>
|
387
|
+
"display_name" => app_display_name,
|
385
388
|
"name" => app_name,
|
386
389
|
"os" => os,
|
387
390
|
"platform" => platform
|
@@ -392,7 +395,7 @@ module Fastlane
|
|
392
395
|
when 200...300
|
393
396
|
created = response.body
|
394
397
|
UI.message("DEBUG: #{JSON.pretty_generate(created)}") if ENV['DEBUG']
|
395
|
-
UI.success("Created #{os}/#{platform} app with name \"#{created['name']}\"")
|
398
|
+
UI.success("Created #{os}/#{platform} app with name \"#{created['name']}\" and display name \"#{created['display_name']}\"")
|
396
399
|
true
|
397
400
|
else
|
398
401
|
UI.error("Error creating app #{response.status}: #{response.body}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-appcenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|