fastlane-plugin-zealot 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '094df9f916199c588e3d991874d996cbcde91fe1318c3ed59745ceeaab381b07'
4
- data.tar.gz: fb5dd2f76921dee9a2d144519c534d629927d8e8be3e21bfacb6c09420ba7635
3
+ metadata.gz: 5e3bacd2013042608e84e46e51c022b6cea7469876d37b84f044028bf4e591dc
4
+ data.tar.gz: 975d4ca4c3dc22f4d2466b5518675a14eebb797697aaa85f9d9f39e07f49fc5e
5
5
  SHA512:
6
- metadata.gz: 1e39a53958627bb1ba620320ef996ec2ef3cbc9fa9daa3048f2f80c5851495b92c8756b2db59bad512f375250596c0faf51a5066c19dc8e68a9f6effa54319bc
7
- data.tar.gz: 643294ce82684f55c3c82978b07273d9f0156de55bfee73284b597b2e4d5a48b9ee167633904672d657aefe9301315d504a05176f240b357a93f516bcaaf3d3a
6
+ metadata.gz: c4e2e25c7bbf317204dc6c8eb118f5ada4cc8397c1c10ebd6be4b5a7fbd089e3bde4207f7a07aebf32826d255dae2fc11ef5fc42dab01b3a7cde8233ce4a94dc
7
+ data.tar.gz: 71e61f001f6b684dad1060371e8bb71c542bb2bb2fcb4b21c706961abe70c063267319a0b785f2529a59a60b5183c720e9cdedef5f8cfe221c1d9ef7e5109773
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-zealot)
4
4
 
5
- 上传移动应用(iPhone、Android)到 [Zealot](https://github.com/getzealot/zealot) 自建 App 分发系统。
5
+ 上传移动应用(iPhone、Android)到 [Zealot](https://github.com/tryzealot/zealot) 自建 App 分发系统。
6
6
 
7
- > Zealot 是一个开源、可自建服务的移动应用上传没有如此简单、解放开发打包的烦恼,轻松放权给测试、产品、运营等使用 App 的人员,深度与 Jenkins 和 Gitlab 集成。
7
+ > Zealot 是一个开源自部署移动应用分发平台,提供 iOS、Android SDK、fastlane 等丰富组件库,打包分发流程、上传应用竟然如此简单、解决开发人员频繁打包的烦恼 🖖
8
8
 
9
9
  ## 快速上手
10
10
 
@@ -202,38 +202,50 @@ end
202
202
 
203
203
  ### zealot_sync_device
204
204
 
205
- 同步指定 Apple 开发者账号的设备列表信息到 Zealot,主要是为了让使用者更清晰看到每个设备 udid 记录的名称
205
+ 同步指定 Apple 开发者账号的设备列表信息到 Zealot,主要是为了让使用者更清晰看到每个设备 udid 记录的名称,提供两种授权方式:
206
+
207
+ - [Apple API Key 授权](https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file) **强烈推荐**
208
+ - 密码授权
206
209
 
207
210
  #### 参数和返回值
208
211
 
209
212
  ```
210
- +---------------+-----------------------------------+------------------------+---------+
211
- | zealot_sync_devices Options |
212
- +---------------+-----------------------------------+------------------------+---------+
213
- | Key | Description | Env Var | Default |
214
- +---------------+-----------------------------------+------------------------+---------+
215
- | endpoint | The endpoint of zealot | ZEALOT_ENDPOINT | |
216
- | token | The token of user | ZEALOT_TOKEN | |
217
- | username | The apple id (username) of Apple | DELIVER_USER | * |
218
- | | Developer Portal | | |
219
- | team_id | The ID of your Developer Portal | ZEALOT_APPLE_TEAM_ID | * |
220
- | | team if you're in multiple teams | | |
221
- | team_name | The name of your Developer | ZEALOT_APPLE_TEAM_NAME | * |
222
- | | Portal team if you're in | | |
223
- | | multiple teams | | |
224
- | platform | The platform to use (optional) | ZEALOT_APPLE_PLATFORM | ios |
225
- | verify_ssl | Should verify SSL of zealot | ZEALOT_VERIFY_SSL | true |
226
- | | service | | |
227
- | timeout | Request timeout in seconds | ZEALOT_TIMEOUT | |
228
- | fail_on_error | Should an error http request | ZEALOT_FAIL_ON_ERROR | false |
229
- | | cause a failure? (true/false) | | |
230
- +---------------+-----------------------------------+------------------------+---------+
213
+ +---------------+-----------------------------------------------------------------------------+------------------------+---------+
214
+ | zealot_sync_devices Options |
215
+ +---------------+-----------------------------------------------------------------------------+------------------------+---------+
216
+ | Key | Description | Env Var(s) | Default |
217
+ +---------------+-----------------------------------------------------------------------------+------------------------+---------+
218
+ | endpoint | The endpoint of zealot | ZEALOT_ENDPOINT | |
219
+ | token | The token of user | ZEALOT_TOKEN | |
220
+ | username | The apple id (username) of Apple Developer Portal | ZEALOT_USERNAME | * |
221
+ | api_key_path | Path to your App Store Connect API Key JSON file | ZEALOT_API_PATH | |
222
+ | | (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key | | |
223
+ | | -json-file) | | |
224
+ | api_key | Your App Store Connect API Key information | ZEALOT_API_KEY | * |
225
+ | | (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key | | |
226
+ | | -hash-option) | | |
227
+ | team_id | The ID of your Developer Portal team if you're in multiple teams | ZEALOT_APPLE_TEAM_ID | * |
228
+ | team_name | The name of your Developer Portal team if you're in multiple teams | ZEALOT_APPLE_TEAM_NAME | * |
229
+ | platform | The platform to use (optional) | ZEALOT_APPLE_PLATFORM | ios |
230
+ | verify_ssl | Should verify SSL of zealot service | ZEALOT_VERIFY_SSL | true |
231
+ | timeout | Request timeout in seconds | ZEALOT_TIMEOUT | |
232
+ | fail_on_error | Should an error http request cause a failure? (true/false) | ZEALOT_FAIL_ON_ERROR | false |
233
+ +---------------+-----------------------------------------------------------------------------+------------------------+---------+
231
234
  ```
232
235
 
233
236
  #### 样例
234
237
 
235
238
  ```ruby
236
239
  lane :sync do
240
+ # 使用 Apple API Key 方式授权,无需密码和二次验证
241
+ zealot_sync_devices(
242
+ endpoint: "...",
243
+ token: "...",
244
+ api_key_path: "/path/to/your/api_key_json_file",
245
+ team_id: "..."
246
+ )
247
+
248
+ # 使用传统的密码授权
237
249
  zealot_sync_devices(
238
250
  endpoint: "...",
239
251
  token: "...",
@@ -13,19 +13,34 @@ module Fastlane
13
13
  def self.run(params)
14
14
  require 'spaceship'
15
15
 
16
- credentials = CredentialsManager::AccountManager.new(user: params[:username])
17
- Spaceship.login(credentials.user, credentials.password)
18
- Spaceship.select_team
19
-
20
- UI.message('Fetching list of currently registered devices...')
21
16
  all_platforms = Set[params[:platform]]
22
17
  supported_platforms = all_platforms.select { |platform| self.is_supported?(platform.to_sym) }
23
18
 
24
- devices = supported_platforms.flat_map { |platform| Spaceship::Device.all(mac: platform == "mac") }
19
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
20
+ UI.message('Creating authorization token for App Store Connect API')
21
+ Spaceship::ConnectAPI.token = api_token
22
+
23
+ devices = supported_platforms.flat_map do |platform|
24
+ Spaceship::ConnectAPI::Device.all(filter: { platform: platform == 'ios' ? 'IOS' : 'MAC_OS'})
25
+ end
26
+ else
27
+ username = params[:username]
28
+ UI.message("Login to App Store Connect (#{username})")
29
+ credentials = CredentialsManager::AccountManager.new(user: username)
30
+ Spaceship.login(credentials.user, credentials.password)
31
+ UI.message('Login successful')
32
+ Spaceship.select_team
33
+
34
+ # Fetches all devices includes macOS.
35
+
36
+ devices = supported_platforms.flat_map { |platform| Spaceship::Device.all(mac: platform == 'mac') }
37
+ end
38
+
39
+ UI.message('Fetching list of currently registered devices...')
25
40
 
26
41
  print_table(build_table_data(params, devices), title: 'zealot_sync_devices')
27
42
 
28
- UI.verbose("Syncing devices to #{params[:endpoint]} ...")
43
+ UI.message("Syncing devices to #{params[:endpoint]} ...")
29
44
  failed_devices = []
30
45
  devices.each do |device|
31
46
  begin
@@ -39,7 +54,7 @@ module Fastlane
39
54
 
40
55
  failed = failed_devices.size
41
56
  successed = devices.size - failed
42
- UI.success "Successful Synced devices. success: #{successed}, failed: #{failed}"
57
+ UI.success "Successful Synced devices, success: #{successed}, failed: #{failed}"
43
58
  UI.verbose "Failed devices: #{failed_devices}"
44
59
  end
45
60
 
@@ -66,11 +81,28 @@ module Fastlane
66
81
  end,
67
82
  type: String),
68
83
  FastlaneCore::ConfigItem.new(key: :username,
69
- env_name: 'DELIVER_USER',
84
+ env_name: 'ZEALOT_USERNAME',
70
85
  description: 'The apple id (username) of Apple Developer Portal',
71
86
  default_value_dynamic: true,
72
87
  optional: true,
73
88
  type: String),
89
+ FastlaneCore::ConfigItem.new(key: :api_key_path,
90
+ env_name: 'ZEALOT_API_PATH',
91
+ 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)',
92
+ optional: true,
93
+ conflicting_options: [:api_key],
94
+ verify_block: proc do |value|
95
+ UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
96
+ end),
97
+ FastlaneCore::ConfigItem.new(key: :api_key,
98
+ env_name: 'ZEALOT_API_KEY',
99
+ description: 'Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)',
100
+ type: Hash,
101
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
102
+ default_value_dynamic: true,
103
+ optional: true,
104
+ sensitive: true,
105
+ conflicting_options: [:api_key_path]),
74
106
  FastlaneCore::ConfigItem.new(key: :team_id,
75
107
  env_name: 'ZEALOT_APPLE_TEAM_ID',
76
108
  description: 'The ID of your Developer Portal team if you\'re in multiple teams',
@@ -79,7 +111,7 @@ module Fastlane
79
111
  optional: true,
80
112
  type: String,
81
113
  verify_block: proc do |value|
82
- ENV["FASTLANE_TEAM_ID"] = value.to_s
114
+ ENV['FASTLANE_TEAM_ID'] = value.to_s
83
115
  end),
84
116
  FastlaneCore::ConfigItem.new(key: :team_name,
85
117
  env_name: 'ZEALOT_APPLE_TEAM_NAME',
@@ -89,7 +121,7 @@ module Fastlane
89
121
  optional: true,
90
122
  type: String,
91
123
  verify_block: proc do |value|
92
- ENV["FASTLANE_TEAM_NAME"] = value.to_s
124
+ ENV['FASTLANE_TEAM_NAME'] = value.to_s
93
125
  end),
94
126
  FastlaneCore::ConfigItem.new(key: :platform,
95
127
  env_name: 'ZEALOT_APPLE_PLATFORM',
@@ -121,6 +153,12 @@ module Fastlane
121
153
 
122
154
  def self.example_code
123
155
  [
156
+ 'zealot_sync_devices(
157
+ endpoint: "...",
158
+ token: "...",
159
+ api_key_path: "...",
160
+ team_id: "..."
161
+ )',
124
162
  'zealot_sync_devices(
125
163
  endpoint: "...",
126
164
  token: "...",
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module Zealot
3
- VERSION = "0.7.1"
5
+ VERSION = '0.8.0'
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-zealot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 2.137.0
159
+ version: 2.172.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 2.137.0
166
+ version: 2.172.0
167
167
  description:
168
168
  email: icyleaf.cn@gmail.com
169
169
  executables: []
@@ -179,7 +179,7 @@ files:
179
179
  - lib/fastlane/plugin/zealot/actions/zealot_version_check.rb
180
180
  - lib/fastlane/plugin/zealot/helper/zealot_helper.rb
181
181
  - lib/fastlane/plugin/zealot/version.rb
182
- homepage: https://github.com/getzealot/fastlane-plugin-zealot
182
+ homepage: https://github.com/tryzealot/fastlane-plugin-zealot
183
183
  licenses:
184
184
  - MIT
185
185
  metadata: {}
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []
201
- rubygems_version: 3.1.2
201
+ rubygems_version: 3.1.4
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Upload IPA/APK/dSYM/Proguard files to Zealot which it provides a self-host