fastlane-plugin-appcenter 1.11.1 → 2.1.0
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 +4 -4
- data/README.md +31 -1
- data/lib/fastlane/plugin/appcenter/actions/appcenter_codepush_release_react.rb +179 -0
- data/lib/fastlane/plugin/appcenter/actions/appcenter_fetch_devices_action.rb +1 -1
- data/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb +1 -1
- data/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb +2 -2
- data/lib/fastlane/plugin/appcenter/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678941e5b3f03b4d5b89d3ad1491342314a996fbb97e65a543f61709f142f426
|
4
|
+
data.tar.gz: dafeebaabaa42d5e20df0226680714f413e8cdd9a830c2fb987981c622ecece4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012b6080ce993cb77e8ed11c517e525ded5f684b37cbd8852adefc7dea0eeacbcdb5be86284874e26f431df5772c698aab771dca1a33fc67a3767b7d86bdf757
|
7
|
+
data.tar.gz: f89842ee90dccf84f3bb4cf63036967a9684f5f1df195d9c771f055879c4be79e994020e5af4eaac4cc3a8a0ff2bf10d67d4280d887eacdbd0a2c7cebf9cfba4
|
data/README.md
CHANGED
@@ -23,6 +23,8 @@ With [App Center](https://appcenter.ms) you can continuously build, test, releas
|
|
23
23
|
|
24
24
|
`appcenter_fetch_version_number` allows you to obtain the latest version number (short or full) for an app. This is useful for tasks such as getting the latest version of an app so that an increment action can take place on CI, or checking that an upload has been successful.
|
25
25
|
|
26
|
+
`appcenter_codepush_release_react` allows you to deploy app updates via CodePush.
|
27
|
+
|
26
28
|
## Usage
|
27
29
|
|
28
30
|
To get started, first, [obtain an API token](https://appcenter.ms/settings/apitokens) in App Center. The API Token is used to authenticate with the App Center API in each call.
|
@@ -63,6 +65,15 @@ The `appcenter_fetch_version_number` returns a hash that contains the id, the ve
|
|
63
65
|
{"id"=>588, "version"=>"1.2.0", "build_number"=>"1615"}
|
64
66
|
```
|
65
67
|
|
68
|
+
```ruby
|
69
|
+
appcenter_codepush_release_react(
|
70
|
+
api_token: "<appcenter token>",
|
71
|
+
owner_name: "<appcenter account name of the owner of the app (username or organization URL name)>",
|
72
|
+
app_name: "<appcenter app name (as seen in app URL)>",
|
73
|
+
deployment: "Staging"
|
74
|
+
)
|
75
|
+
```
|
76
|
+
|
66
77
|
### Help
|
67
78
|
|
68
79
|
Once installed, information and help for an action can be printed out with this command:
|
@@ -134,6 +145,25 @@ Here is the list of all existing parameters:
|
|
134
145
|
| `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
146
|
| `version` <br/> `APPCENTER_APP_VERSION` | App version to get the last release for instead of the last release of all versions |
|
136
147
|
|
148
|
+
#### `appcenter_codepush_release_react`
|
149
|
+
| Key & Env Var | Description |
|
150
|
+
|-----------------|--------------------|
|
151
|
+
| `api_token` <br/> `APPCENTER_API_TOKEN` | API Token for App Center |
|
152
|
+
| `owner_name` <br/> `APPCENTER_OWNER_NAME` | Owner name, as found in the App's URL in App Center |
|
153
|
+
| `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 |
|
154
|
+
| `deployment` <br/> `APPCENTER_CODEPUSH_DEPLOYMENT` | Name of deployment track (default: `Staging`) |
|
155
|
+
| `target_version` <br/> `APPCENTER_CODEPUSH_TARGET_VERSION` | Target binary app version |
|
156
|
+
| `mandatory` <br/> `APPCENTER_CODEPUSH_MANDATORY` | Specifies whether the update should be mandatory (default: `true`) |
|
157
|
+
| `description` <br/> `APPCENTER_CODEPUSH_DESCRIPTION` | Description of CodePush release |
|
158
|
+
| `dry_run` <br/> `APPCENTER_CODEPUSH_DRY_RUN` | Print command that would be run, don't run it (default: `false`) |
|
159
|
+
| `disabled` <br/> `APPCENTER_CODEPUSH_DISABLED` | Specifies whether this release should not be immediately available for download (default: `false`) |
|
160
|
+
| `no_duplicate_release_error` <br/> `APPCENTER_CODEPUSH_NO_DUPLICATE_ERROR` | Specifies whether to ignore errors if bundle is identical to the latest codepush release (default: `false`) |
|
161
|
+
| `bundle_name` <br/> `APPCENTER_CODEPUSH_BUNDLE_NAME` | Specifies the name of the bundle file |
|
162
|
+
| `output_dir` <br/> `APPCENTER_CODEPUSH_OUTPUT` | Specifies path to where the bundle and sourcemap should be written |
|
163
|
+
| `sourcemap_output` <br/> `APPCENTER_CODEPUSH_SOURCEMAP_OUTPUT` | Specifies path to write sourcemaps to |
|
164
|
+
| `development` <br/> `APPCENTER_CODEPUH_DEVELOPMENT` | Specifies whether to generate dev or release build (default: `false`) |
|
165
|
+
| `private_key_path` <br/> `APPCENTER_CODEPUSH_PRIVATE_KEY_PATH` | Specifies path to private key that will be used for signing bundles" |
|
166
|
+
|
137
167
|
## Example
|
138
168
|
|
139
169
|
Check out this [example `Fastfile`](fastlane/Fastfile) to see how to use the `appcenter_upload` action. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
@@ -186,4 +216,4 @@ Check out [SECURITY.md](SECURITY.md) for any security concern with this project.
|
|
186
216
|
|
187
217
|
## Contact
|
188
218
|
|
189
|
-
We're on Twitter as [@vsappcenter](https://www.twitter.com/vsappcenter). Additionally you can reach out to us on the [App Center](https://appcenter.ms/apps) portal. Open the "?" menu on the top right corner of screen, then use "Contact support" to file a support ticket. Our support team is there to answer your questions and help you solve your problems.
|
219
|
+
We're on Twitter as [@vsappcenter](https://www.twitter.com/vsappcenter). Additionally you can reach out to us on the [App Center](https://appcenter.ms/apps) portal. Open the "?" menu on the top right corner of screen, then use "Contact support" to file a support ticket. Our support team is there to answer your questions and help you solve your problems.
|
@@ -0,0 +1,179 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
5
|
+
|
6
|
+
module Actions
|
7
|
+
class AppcenterCodepushReleaseReactAction < Action
|
8
|
+
def self.description
|
9
|
+
"CodePush release react action"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.authors
|
13
|
+
["Ivan Sokolovskii"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.run(params)
|
17
|
+
app = params[:app_name]
|
18
|
+
owner = params[:owner_name]
|
19
|
+
token = params[:api_token]
|
20
|
+
deployment = params[:deployment]
|
21
|
+
dev = params[:development]
|
22
|
+
description = params[:description]
|
23
|
+
mandatory = params[:mandatory]
|
24
|
+
version = params[:target_version]
|
25
|
+
disabled = params[:disabled]
|
26
|
+
no_errors = params[:no_duplicate_release_error]
|
27
|
+
bundle = params[:bundle_name]
|
28
|
+
output = params[:output_dir]
|
29
|
+
sourcemap_output = params[:sourcemap_output]
|
30
|
+
private_key_path = params[:private_key_path]
|
31
|
+
dry_run = params[:dry_run]
|
32
|
+
use_local_appcenter_cli = params[:use_local_appcenter_cli]
|
33
|
+
|
34
|
+
base_executable = "appcenter "
|
35
|
+
|
36
|
+
if use_local_appcenter_cli
|
37
|
+
base_executable = "npm exec " + base_executable
|
38
|
+
end
|
39
|
+
|
40
|
+
command = base_executable + "codepush release-react --token #{token} --app #{owner}/#{app} --deployment-name #{deployment} --development #{dev} "
|
41
|
+
|
42
|
+
if description
|
43
|
+
command += "--description \"#{description}\" "
|
44
|
+
end
|
45
|
+
if mandatory
|
46
|
+
command += "--mandatory "
|
47
|
+
end
|
48
|
+
if version
|
49
|
+
command += "--target-binary-version #{version} "
|
50
|
+
end
|
51
|
+
if disabled
|
52
|
+
command += "--disabled "
|
53
|
+
end
|
54
|
+
if no_errors
|
55
|
+
command += "--disable-duplicate-release-error "
|
56
|
+
end
|
57
|
+
if bundle
|
58
|
+
command += "--bundle-name #{bundle} "
|
59
|
+
end
|
60
|
+
if output
|
61
|
+
command += "--output-dir #{output} "
|
62
|
+
end
|
63
|
+
if sourcemap_output
|
64
|
+
command += "--sourcemap-output #{sourcemap_output} "
|
65
|
+
end
|
66
|
+
if private_key_path
|
67
|
+
command += "--private-key-path #{private_key_path} "
|
68
|
+
end
|
69
|
+
if dry_run
|
70
|
+
UI.message("Dry run!".red + " Would have run: " + command + "\n")
|
71
|
+
else
|
72
|
+
sh(command.to_s)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.available_options
|
77
|
+
[
|
78
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
79
|
+
type: String,
|
80
|
+
env_name: "APPCENTER_API_TOKEN",
|
81
|
+
description: "API Token for App Center Access",
|
82
|
+
verify_block: proc do |value|
|
83
|
+
UI.user_error!("No API token for App Center given, pass using `api_token: 'token'`") unless value && !value.empty?
|
84
|
+
end),
|
85
|
+
FastlaneCore::ConfigItem.new(key: :owner_name,
|
86
|
+
type: String,
|
87
|
+
env_name: "APPCENTER_OWNER_NAME",
|
88
|
+
description: "Name of the owner of the application on App Center",
|
89
|
+
verify_block: proc do |value|
|
90
|
+
UI.user_error!("No owner name for App Center given, pass using `owner_name: 'owner name'`") unless value && !value.empty?
|
91
|
+
end),
|
92
|
+
FastlaneCore::ConfigItem.new(key: :app_name,
|
93
|
+
type: String,
|
94
|
+
env_name: "APPCENTER_APP_NAME",
|
95
|
+
description: "Name of the application on App Center",
|
96
|
+
verify_block: proc do |value|
|
97
|
+
UI.user_error!("No app name for App Center given, pass using `app_name: 'app name'`") unless value && !value.empty?
|
98
|
+
end),
|
99
|
+
FastlaneCore::ConfigItem.new(key: :deployment,
|
100
|
+
type: String,
|
101
|
+
env_name: "APPCENTER_CODEPUSH_DEPLOYMENT",
|
102
|
+
optional: true,
|
103
|
+
default_value: "Staging",
|
104
|
+
description: "Deployment name for releasing to"),
|
105
|
+
FastlaneCore::ConfigItem.new(key: :target_version,
|
106
|
+
type: String,
|
107
|
+
env_name: "APPCENTER_CODEPUSH_TARGET_VERSION",
|
108
|
+
optional: true,
|
109
|
+
description: "Target binary version for example 1.0.1"),
|
110
|
+
FastlaneCore::ConfigItem.new(key: :mandatory,
|
111
|
+
type: Boolean,
|
112
|
+
env_name: "APPCENTER_CODEPUSH_MANDATORY",
|
113
|
+
default_value: true,
|
114
|
+
optional: true,
|
115
|
+
description: "mandatory update or not"),
|
116
|
+
FastlaneCore::ConfigItem.new(key: :description,
|
117
|
+
type: String,
|
118
|
+
env_name: "APPCENTER_CODEPUSH_DESCRIPTION",
|
119
|
+
optional: true,
|
120
|
+
description: "Release description for CodePush"),
|
121
|
+
FastlaneCore::ConfigItem.new(key: :dry_run,
|
122
|
+
type: Boolean,
|
123
|
+
env_name: "APPCENTER_CODEPUSH_DRY_RUN",
|
124
|
+
default_value: false,
|
125
|
+
optional: true,
|
126
|
+
description: "Print the command that would be run, and don't run it"),
|
127
|
+
FastlaneCore::ConfigItem.new(key: :disabled,
|
128
|
+
type: Boolean,
|
129
|
+
env_name: "APPCENTER_CODEPUSH_DISABLED",
|
130
|
+
default_value: false,
|
131
|
+
optional: true,
|
132
|
+
description: "Specifies whether this release should be immediately downloadable"),
|
133
|
+
FastlaneCore::ConfigItem.new(key: :no_duplicate_release_error,
|
134
|
+
type: Boolean,
|
135
|
+
env_name: "APPCENTER_CODEPUSH_NO_DUPLICATE_ERROR",
|
136
|
+
default_value: false,
|
137
|
+
optional: true,
|
138
|
+
description: "Specifies whether to return an error if the main bundle is identical to the latest codepush release"),
|
139
|
+
FastlaneCore::ConfigItem.new(key: :bundle_name,
|
140
|
+
type: String,
|
141
|
+
env_name: "APPCENTER_CODEPUSH_BUNDLE_NAME",
|
142
|
+
optional: true,
|
143
|
+
description: "Specifies the name of the bundle file"),
|
144
|
+
FastlaneCore::ConfigItem.new(key: :output_dir,
|
145
|
+
type: String,
|
146
|
+
env_name: "APPCENTER_CODEPUSH_OUTPUT",
|
147
|
+
optional: true,
|
148
|
+
description: "Specifies path to where the bundle and sourcemap should be written"),
|
149
|
+
FastlaneCore::ConfigItem.new(key: :sourcemap_output,
|
150
|
+
type: String,
|
151
|
+
env_name: "APPCENTER_CODEPUSH_SOURCEMAP_OUTPUT",
|
152
|
+
optional: true,
|
153
|
+
description: "Specifies path to write sourcemap to"),
|
154
|
+
FastlaneCore::ConfigItem.new(key: :development,
|
155
|
+
type: Boolean,
|
156
|
+
env_name: "APPCENTER_CODEPUSH_DEVELOPMENT",
|
157
|
+
optional: true,
|
158
|
+
default_value: false,
|
159
|
+
description: "Specifies whether to generate a dev build"),
|
160
|
+
FastlaneCore::ConfigItem.new(key: :use_local_appcenter_cli,
|
161
|
+
type: Boolean,
|
162
|
+
env_name: "APPCENTER_CODEPUSH_USE_LOCAL_APPCENTER_CLI",
|
163
|
+
optional: true,
|
164
|
+
default_value: false,
|
165
|
+
description: "When true, the appcenter cli installed in the project directory is used"),
|
166
|
+
FastlaneCore::ConfigItem.new(key: :private_key_path,
|
167
|
+
type: String,
|
168
|
+
env_name: "APPCENTER_CODEPUSH_PRIVATE_KEY_PATH",
|
169
|
+
optional: true,
|
170
|
+
description: "Path to private key that will be used for signing bundles")
|
171
|
+
]
|
172
|
+
end
|
173
|
+
|
174
|
+
def self.is_supported?(platform)
|
175
|
+
[:ios, :android].include?(platform)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
@@ -11,7 +11,7 @@ module Fastlane
|
|
11
11
|
}
|
12
12
|
CONTENT_TYPES = {
|
13
13
|
apk: "application/vnd.android.package-archive",
|
14
|
-
aab: "application/
|
14
|
+
aab: "application/x-authorware-bin",
|
15
15
|
msi: "application/x-msi",
|
16
16
|
plist: "application/xml",
|
17
17
|
aetx: "application/c-x509-ca-cert",
|
@@ -379,7 +379,7 @@ module Fastlane
|
|
379
379
|
req.options.timeout = timeout
|
380
380
|
req.headers['internal-request-source'] = "fastlane"
|
381
381
|
req.headers['Content-Length'] = chunk.length.to_s
|
382
|
-
req.headers['Content-Type'] =
|
382
|
+
req.headers['Content-Type'] = content_type
|
383
383
|
req.body = chunk
|
384
384
|
end
|
385
385
|
UI.message("DEBUG: #{response.status} #{JSON.pretty_generate(response.body)}\n") if ENV['DEBUG']
|
@@ -955,7 +955,7 @@ module Fastlane
|
|
955
955
|
|
956
956
|
# add new created app to existing distribution group
|
957
957
|
def self.add_new_app_to_distribution_group(api_token:, owner_name:, app_name:, destination_name:)
|
958
|
-
url = URI.escape("/v0.1/orgs/#{owner_name}/distribution_groups/#{destination_name}/apps")
|
958
|
+
url = URI::Parser.new.escape("/v0.1/orgs/#{owner_name}/distribution_groups/#{destination_name}/apps")
|
959
959
|
body = {
|
960
960
|
apps: [
|
961
961
|
{ name: app_name }
|
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: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- LICENSE
|
132
132
|
- README.md
|
133
133
|
- lib/fastlane/plugin/appcenter.rb
|
134
|
+
- lib/fastlane/plugin/appcenter/actions/appcenter_codepush_release_react.rb
|
134
135
|
- lib/fastlane/plugin/appcenter/actions/appcenter_fetch_devices_action.rb
|
135
136
|
- lib/fastlane/plugin/appcenter/actions/appcenter_fetch_version_number.rb
|
136
137
|
- lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
- !ruby/object:Gem::Version
|
156
157
|
version: '0'
|
157
158
|
requirements: []
|
158
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.3.26
|
159
160
|
signing_key:
|
160
161
|
specification_version: 4
|
161
162
|
summary: Fastlane plugin for App Center
|