fastlane-plugin-appcenter 1.9.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/fastlane/plugin/appcenter/actions/appcenter_fetch_version_number.rb +35 -16
- data/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb +9 -2
- data/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb +11 -5
- data/lib/fastlane/plugin/appcenter/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c1262b958ae0ddbf9a6bfa6d63b4f032f1518c706154e6c70b35adbe2c441e2
|
4
|
+
data.tar.gz: c2ffa81d7a6e4c8fb369c5d4612a0aea7c02c2cd589a3fdcb900d8b407f2eaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb06867a95f13d484796bd47be5cad11df03e949ffffbcbf8cbe14d675c8577506e184176248ba8102fc338ab934e9d03e06938030591d9d9a72beec557f7894
|
7
|
+
data.tar.gz: b1fadb157505f3138621dffd8e95a64d306f89439ab25259c60c6a9e08d9a9dbe97d0b09b4c1daf8db70e2c9241d87225523784cb3f9c5e900c98d3a85b0b05f
|
data/README.md
CHANGED
@@ -52,7 +52,8 @@ appcenter_upload(
|
|
52
52
|
appcenter_fetch_version_number(
|
53
53
|
api_token: "<appcenter token>",
|
54
54
|
owner_name: "<appcenter account name of the owner of the app (username or organization URL name)>",
|
55
|
-
app_name: "<appcenter app name (as seen in app URL)>"
|
55
|
+
app_name: "<appcenter app name (as seen in app URL)>",
|
56
|
+
version: "a specific version to get the last release for" # optional, don't set this value to get the last upload of all versions
|
56
57
|
)
|
57
58
|
```
|
58
59
|
|
@@ -121,6 +122,7 @@ Here is the list of all existing parameters:
|
|
121
122
|
| `version` <br/> `APPCENTER_DISTRIBUTE_VERSION` | The build version, required for .pkg, .dmg, .zip and .msi builds, as well as Android ProGuard `mapping.txt` when using `upload_mapping_only` |
|
122
123
|
| `timeout` <br/> `APPCENTER_DISTRIBUTE_TIMEOUT` | Request timeout in seconds applied to individual HTTP requests. Some commands use multiple HTTP requests, large file uploads are also split in multiple HTTP requests |
|
123
124
|
| `dsa_signature` <br/> `APPCENTER_DISTRIBUTE_DSA_SIGNATURE` | DSA signature of the macOS or Windows release for Sparkle update feed |
|
125
|
+
| `ed_signature` <br/> `APPCENTER_DISTRIBUTE_ED_SIGNATURE` | EdDSA signature of the macOS or Windows release for Sparkle update feed |
|
124
126
|
| `strict` <br/> `APPCENTER_STRICT_MODE` | Strict mode, set to 'true' to fail early in case a potential error was detected |
|
125
127
|
|
126
128
|
#### `appcenter_fetch_version_number`
|
@@ -130,6 +132,7 @@ Here is the list of all existing parameters:
|
|
130
132
|
| `api_token` <br/> `APPCENTER_API_TOKEN` | API Token for App Center |
|
131
133
|
| `owner_name` <br/> `APPCENTER_OWNER_NAME` | Owner name, as found in the App's URL in App Center |
|
132
134
|
| `app_name` <br/> `APPCENTER_APP_NAME` | App name as found in the App's URL in App Center. If there is no app with such name, you will be prompted to create one |
|
135
|
+
| `version` <br/> `APPCENTER_APP_VERSION` | App version to get the last release for instead of the last release of all versions |
|
133
136
|
|
134
137
|
## Example
|
135
138
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "json"
|
2
|
+
require "net/http"
|
3
|
+
require "fastlane_core/ui/ui"
|
4
4
|
|
5
5
|
module Fastlane
|
6
6
|
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
@@ -8,38 +8,51 @@ module Fastlane
|
|
8
8
|
module Actions
|
9
9
|
class AppcenterFetchVersionNumberAction < Action
|
10
10
|
def self.description
|
11
|
-
"Fetches the latest version number of an app from App Center"
|
11
|
+
"Fetches the latest version number of an app or the last build number of a version from App Center"
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.authors
|
15
|
-
["jspargo", "ShopKeep"]
|
15
|
+
["jspargo", "ShopKeep", "Qutaibah"]
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.run(params)
|
19
19
|
api_token = params[:api_token]
|
20
20
|
app_name = params[:app_name]
|
21
21
|
owner_name = params[:owner_name]
|
22
|
+
version = params[:version]
|
22
23
|
|
23
24
|
releases = Helper::AppcenterHelper.fetch_releases(
|
24
25
|
api_token: api_token,
|
25
26
|
owner_name: owner_name,
|
26
|
-
app_name: app_name
|
27
|
+
app_name: app_name,
|
27
28
|
)
|
28
29
|
|
29
30
|
UI.abort_with_message!("No versions found for '#{app_name}' owned by #{owner_name}") unless releases
|
30
|
-
|
31
|
-
|
31
|
+
|
32
|
+
sorted_releases = releases
|
33
|
+
|
34
|
+
if version.nil?
|
35
|
+
sorted_releases = releases.sort_by { |release| release["id"] }
|
36
|
+
else
|
37
|
+
sorted_releases = releases.select { |release| release["short_version"] == version }.sort_by { |release| release["id"] }
|
38
|
+
end
|
39
|
+
|
40
|
+
latest_release = sorted_releases.last
|
32
41
|
|
33
42
|
if latest_release.nil?
|
34
|
-
|
43
|
+
if version.nil?
|
44
|
+
UI.user_error!("This app has no releases yet")
|
45
|
+
return nil
|
46
|
+
end
|
47
|
+
UI.user_error!("The provided version (#{version}) has no releases yet")
|
35
48
|
return nil
|
36
49
|
end
|
37
50
|
|
38
51
|
return {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
52
|
+
"id" => latest_release["id"],
|
53
|
+
"version" => latest_release["short_version"],
|
54
|
+
"build_number" => latest_release["version"],
|
55
|
+
}
|
43
56
|
end
|
44
57
|
|
45
58
|
def self.available_options
|
@@ -61,7 +74,13 @@ module Fastlane
|
|
61
74
|
description: "Name of the application on App Center",
|
62
75
|
verify_block: proc do |value|
|
63
76
|
UI.user_error!("No app name for App Center given, pass using `app_name: 'app name'`") unless value && !value.empty?
|
64
|
-
end)
|
77
|
+
end),
|
78
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
79
|
+
env_name: "APPCENTER_APP_VERSION",
|
80
|
+
description: "The version to get the latest release for",
|
81
|
+
optional: true,
|
82
|
+
type: String),
|
83
|
+
|
65
84
|
]
|
66
85
|
end
|
67
86
|
|
@@ -70,11 +89,11 @@ module Fastlane
|
|
70
89
|
end
|
71
90
|
|
72
91
|
def self.get_apps(api_token)
|
73
|
-
host_uri = URI.parse(
|
92
|
+
host_uri = URI.parse("https://api.appcenter.ms")
|
74
93
|
http = Net::HTTP.new(host_uri.host, host_uri.port)
|
75
94
|
http.use_ssl = true
|
76
95
|
apps_request = Net::HTTP::Get.new("/v0.1/apps")
|
77
|
-
apps_request[
|
96
|
+
apps_request["X-API-Token"] = api_token
|
78
97
|
apps_response = http.request(apps_request)
|
79
98
|
return [] unless apps_response.kind_of?(Net::HTTPOK)
|
80
99
|
return JSON.parse(apps_response.body)
|
@@ -143,6 +143,7 @@ module Fastlane
|
|
143
143
|
build_number = params[:build_number]
|
144
144
|
version = params[:version]
|
145
145
|
dsa_signature = params[:dsa_signature]
|
146
|
+
ed_signature = params[:ed_signature]
|
146
147
|
|
147
148
|
if release_notes.length >= Constants::MAX_RELEASE_NOTES_LENGTH
|
148
149
|
unless should_clip
|
@@ -230,7 +231,7 @@ module Fastlane
|
|
230
231
|
UI.message("Release '#{release_id}' committed: #{release_url}")
|
231
232
|
|
232
233
|
release = Helper::AppcenterHelper.update_release(api_token, owner_name, app_name, release_id, release_notes)
|
233
|
-
Helper::AppcenterHelper.update_release_metadata(api_token, owner_name, app_name, release_id, dsa_signature)
|
234
|
+
Helper::AppcenterHelper.update_release_metadata(api_token, owner_name, app_name, release_id, dsa_signature, ed_signature)
|
234
235
|
|
235
236
|
destinations_array = []
|
236
237
|
if destinations == '*'
|
@@ -643,7 +644,13 @@ module Fastlane
|
|
643
644
|
description: "DSA signature of the macOS or Windows release for Sparkle update feed",
|
644
645
|
optional: true,
|
645
646
|
type: String),
|
646
|
-
|
647
|
+
|
648
|
+
FastlaneCore::ConfigItem.new(key: :ed_signature,
|
649
|
+
env_name: "APPCENTER_DISTRIBUTE_ED_SIGNATURE",
|
650
|
+
description: "EdDSA signature of the macOS or Windows release for Sparkle update feed",
|
651
|
+
optional: true,
|
652
|
+
type: String),
|
653
|
+
|
647
654
|
FastlaneCore::ConfigItem.new(key: :strict,
|
648
655
|
env_name: "APPCENTER_STRICT_MODE",
|
649
656
|
description: "Strict mode, set to 'true' to fail early in case a potential error was detected",
|
@@ -324,6 +324,7 @@ module Fastlane
|
|
324
324
|
req.options.timeout = timeout
|
325
325
|
req.headers['internal-request-source'] = "fastlane"
|
326
326
|
req.headers['Content-Length'] = chunk.length.to_s
|
327
|
+
req.headers['Content-Type'] = 'application/octet-stream'
|
327
328
|
req.body = chunk
|
328
329
|
end
|
329
330
|
UI.message("DEBUG: #{response.status} #{JSON.pretty_generate(response.body)}\n") if ENV['DEBUG']
|
@@ -545,15 +546,20 @@ module Fastlane
|
|
545
546
|
end
|
546
547
|
|
547
548
|
# updates release metadata
|
548
|
-
def self.update_release_metadata(api_token, owner_name, app_name, release_id, dsa_signature)
|
549
|
-
return if dsa_signature.to_s == ''
|
549
|
+
def self.update_release_metadata(api_token, owner_name, app_name, release_id, dsa_signature = '', ed_signature = '')
|
550
|
+
return if dsa_signature.to_s == '' && ed_signature.to_s == ''
|
550
551
|
|
551
552
|
url = "v0.1/apps/#{owner_name}/#{app_name}/releases/#{release_id}"
|
552
553
|
body = {
|
553
|
-
metadata: {
|
554
|
-
dsa_signature: dsa_signature
|
555
|
-
}
|
554
|
+
metadata: {}
|
556
555
|
}
|
556
|
+
|
557
|
+
if dsa_signature.to_s != ''
|
558
|
+
body[:metadata]["dsa_signature"] = dsa_signature
|
559
|
+
end
|
560
|
+
if ed_signature.to_s != ''
|
561
|
+
body[:metadata]["ed_signature"] = ed_signature
|
562
|
+
end
|
557
563
|
|
558
564
|
UI.message("DEBUG: PATCH #{url}") if ENV['DEBUG']
|
559
565
|
UI.message("DEBUG: PATCH body #{JSON.pretty_generate(body)}\n") if ENV['DEBUG']
|
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.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,8 +122,8 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description:
|
126
|
-
email:
|
125
|
+
description:
|
126
|
+
email:
|
127
127
|
executables: []
|
128
128
|
extensions: []
|
129
129
|
extra_rdoc_files: []
|
@@ -140,7 +140,7 @@ homepage: https://github.com/microsoft/fastlane-plugin-appcenter
|
|
140
140
|
licenses:
|
141
141
|
- MIT
|
142
142
|
metadata: {}
|
143
|
-
post_install_message:
|
143
|
+
post_install_message:
|
144
144
|
rdoc_options: []
|
145
145
|
require_paths:
|
146
146
|
- lib
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
158
|
rubygems_version: 3.0.3
|
159
|
-
signing_key:
|
159
|
+
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: Fastlane plugin for App Center
|
162
162
|
test_files: []
|