fastlane-plugin-fastci 0.0.20 → 0.0.30
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 +84 -0
- data/lib/fastlane/plugin/fastci/actions/check_zealot_version_action.rb +52 -0
- data/lib/fastlane/plugin/fastci/actions/package_action.rb +20 -0
- data/lib/fastlane/plugin/fastci/actions/sync_zealot_devices_action.rb +65 -0
- data/lib/fastlane/plugin/fastci/actions/upload_zealot_action.rb +58 -0
- data/lib/fastlane/plugin/fastci/actions/upload_zealot_dsym_action.rb +63 -0
- data/lib/fastlane/plugin/fastci/helper/environment.rb +12 -1
- data/lib/fastlane/plugin/fastci/helper/fastci_zealot_helper.rb +51 -0
- data/lib/fastlane/plugin/fastci/version.rb +1 -1
- metadata +21 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9eadcd995669c5cfd0d4d8a28b68667d0d18cdd710864eed98ed142e285c9b93
|
|
4
|
+
data.tar.gz: 2fa4908e62aedb5faa2ad21a5f6d4d5e210bf609848721c621856c84f80e9741
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1606d02bc136b88b61652ad9218f7a3428ba36a516eb578d738328b12750abeb04b9caa7f30eebe790efae4e4019961c6429089f8d0d247cdc8ebd76e5ad2252
|
|
7
|
+
data.tar.gz: 3cf569702228448922d1d20e296900fc2c7594d3c51d3f82ef6ea0e88addc85227f27c3ea050a81ad45ce0630e5a5647aeab82a800b3433e8430eb31fc555d7a
|
data/README.md
CHANGED
|
@@ -53,6 +53,7 @@ fastlane_cache/ # 插件缓存文件夹
|
|
|
53
53
|
功能:自动编译并导出 ipa 包,支持多种打包方式和集成多项检查。
|
|
54
54
|
生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英或 fir 参数会自动上传蒲公英或 fir。` app-store ` 和 ` testFlight ` 配置了商店参数会自动上传商店。
|
|
55
55
|
配置了 Sentry 参数会自动上传符号表。
|
|
56
|
+
配置了 Zealot 参数的非商店包也可自动上传,详见下方 Zealot 配置。
|
|
56
57
|
|
|
57
58
|
` build `: 不指定的话内部有递增逻辑,格式为 ` 20250905.15(日期+当天包的次数) `
|
|
58
59
|
|
|
@@ -124,6 +125,89 @@ detect_unused_image(
|
|
|
124
125
|
|
|
125
126
|
---
|
|
126
127
|
|
|
128
|
+
### 6. Zealot(仅 iOS)
|
|
129
|
+
|
|
130
|
+
通过官方 [fastlane-plugin-zealot](https://github.com/tryzealot/fastlane-plugin-zealot) 封装以下独立 Action:
|
|
131
|
+
|
|
132
|
+
| Action | 用途 |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `upload_zealot` | 上传 IPA,返回版本与下载地址 |
|
|
135
|
+
| `upload_zealot_dsym` | 上传 iOS dSYM,支持 zip 或 xcarchive |
|
|
136
|
+
| `check_zealot_version` | 按 Bundle ID、版本号或 commit 查询版本 |
|
|
137
|
+
| `sync_zealot_devices` | 将 Apple 开发者账号中的 iOS 设备同步到 Zealot |
|
|
138
|
+
|
|
139
|
+
在本机环境文件或 CI 密钥中配置,真实 token 不要提交到仓库:
|
|
140
|
+
|
|
141
|
+
```dotenv
|
|
142
|
+
ZEALOT_ENDPOINT=https://zealot.example.com
|
|
143
|
+
ZEALOT_TOKEN=your-user-token
|
|
144
|
+
ZEALOT_CHANNEL_KEY=your-ios-channel-key
|
|
145
|
+
ZEALOT_UPLOAD_DSYM=false
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`package` 与 Fir 一样按 token 判断是否上传:配置 `ZEALOT_TOKEN` 后,自动上传 `development`、`ad-hoc`、`enterprise` 包;token 留空时跳过。上传时必须同时提供 `ZEALOT_ENDPOINT` 和 `ZEALOT_CHANNEL_KEY`。`app-store` 和 `testFlight` 保持原上传流程。
|
|
149
|
+
|
|
150
|
+
```ruby
|
|
151
|
+
package(
|
|
152
|
+
export_method: "development",
|
|
153
|
+
is_upload_zealot_dsym: true, # 默认 false;仅 IPA 上传成功后执行
|
|
154
|
+
changelog: "iOS 更新说明"
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
也可以单独调用,不需要重新构建:
|
|
159
|
+
|
|
160
|
+
```ruby
|
|
161
|
+
result = upload_zealot(file: "./App.ipa", changelog: "iOS 更新说明")
|
|
162
|
+
# result:app_id、release_id、release_url、install_url、qrcode_url
|
|
163
|
+
|
|
164
|
+
upload_zealot_dsym(zip_file: "./App.app.dSYM.zip")
|
|
165
|
+
# 或指定 path: "./App.xcarchive";均未指定时使用本次 gym 产物。
|
|
166
|
+
|
|
167
|
+
exists = check_zealot_version(
|
|
168
|
+
bundle_id: "com.example.app",
|
|
169
|
+
release_version: "1.0",
|
|
170
|
+
build_version: "1"
|
|
171
|
+
)
|
|
172
|
+
# 也可用 git_commit 替代 release_version / build_version。
|
|
173
|
+
|
|
174
|
+
sync_zealot_devices(api_key_path: "./app_store_connect_api_key.json")
|
|
175
|
+
# 也可使用 username / team_id;设备同步不会在 package 中自动执行。
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
请求失败默认终止 lane,可传 `fail_on_error: false` 或设置 `ZEALOT_FAIL_ON_ERROR=false` 继续执行。版本查询返回 `true`(存在)、`false`(不存在)、`nil`(请求失败且允许继续);设备同步返回 `total`、`succeeded`、`failed`。token 在请求摘要中始终隐藏。
|
|
179
|
+
|
|
180
|
+
上传参数支持官方的 `password`、`timeout`、`verify_ssl`、`branch`、`git_commit` 等选项,使用 `bundle exec fastlane action upload_zealot` 查看。示例 Fastfile 也提供 `uploadZealot`、`uploadZealotDsym`、`checkZealotVersion`、`syncZealotDevices` 四个 lane。
|
|
181
|
+
|
|
182
|
+
依赖兼容:Zealot 的 `debug_file` 依赖 `ruby-macho < 3`,不能与 CocoaPods 1.17(依赖 4.x)放在同一 bundle。此类工程应将 CocoaPods 放入独立 Gemfile;使用 Faraday 1 的 Fastlane 工程还应将 `faraday-net_http` 限制为 `~> 1.0`。
|
|
183
|
+
|
|
184
|
+
## 发布到 RubyGems
|
|
185
|
+
|
|
186
|
+
工作流位于 [`.github/workflows/release.yml`](.github/workflows/release.yml)。使用 `1.0.0` 这样的纯版本标签,无需 `v` 前缀。推送数字开头的标签后,自动校验标签与 `lib/fastlane/plugin/fastci/version.rb` 中的 `VERSION` 完全一致,检查 Ruby 语法、构建 gem 并发布到 RubyGems。
|
|
187
|
+
|
|
188
|
+
首次使用需完成一次 [RubyGems Trusted Publishing 配置](https://guides.rubygems.org/trusted-publishing/):
|
|
189
|
+
|
|
190
|
+
用 gem 所有者账号打开 [fastlane-plugin-fastci](https://rubygems.org/gems/fastlane-plugin-fastci),进入 **Trusted publishers → Create**,填写:
|
|
191
|
+
|
|
192
|
+
| 字段 | 值 |
|
|
193
|
+
| --- | --- |
|
|
194
|
+
| Repository owner | `watermelon520` |
|
|
195
|
+
| Repository name | `fastlane-plugin-fastci` |
|
|
196
|
+
| Workflow filename | `release.yml` |
|
|
197
|
+
| Environment | 留空(可选) |
|
|
198
|
+
|
|
199
|
+
工作流使用官方 OIDC 短期凭据,不需要配置 `RUBYGEMS_API_KEY` 或创建 GitHub Environment。工作流文件在当前仓库内,Workflow Repository 两项留空。若以后设置 Environment,RubyGems 配置与工作流的 `environment` 必须保持一致。
|
|
200
|
+
|
|
201
|
+
每次发布先修改 `VERSION`,执行 `bundle install` 同步 `Gemfile.lock`,并提交本次拟发布的代码和工作流。然后推送对应标签,例如版本更新为 `0.0.30` 后:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
git push origin main
|
|
205
|
+
git tag -a 0.0.30 -m "Release 0.0.30"
|
|
206
|
+
git push origin 0.0.30
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
到 GitHub **Actions → Release to RubyGems** 查看结果。已发布版本不能覆盖;失败重跑前先确认该版本是否已经发布。只有打入标签提交的文件会被发布,本地未提交改动不会包含在内。
|
|
210
|
+
|
|
127
211
|
## 贡献与支持
|
|
128
212
|
|
|
129
213
|
如需更多帮助或贡献,请提交 Issue 或 PR。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'fastlane/plugin/fastci/helper/fastci_zealot_helper'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
# 查询 iOS 应用已上传版本,是否跳过后续打包由调用方决定。
|
|
6
|
+
class CheckZealotVersionAction < ZealotVersionCheckAction
|
|
7
|
+
extend Fastlane::Helper::FastciZealotHelper
|
|
8
|
+
|
|
9
|
+
def self.run(params)
|
|
10
|
+
validate_zealot_connection!(zealot_parameters(params))
|
|
11
|
+
[
|
|
12
|
+
SharedValues::ZEALOT_VERSION_EXISTED,
|
|
13
|
+
SharedValues::ZEAALOT_ERROR_MESSAGE,
|
|
14
|
+
SharedValues::ZEALOT_LATEST_RELEASE_ID,
|
|
15
|
+
SharedValues::ZEALOT_LATEST_RELEASE_VERSION,
|
|
16
|
+
SharedValues::ZEALOT_LATEST_VERSION,
|
|
17
|
+
SharedValues::ZEALOT_LATEST_RELEASE_URL,
|
|
18
|
+
SharedValues::ZEALOT_LATEST_INSTALL_URL,
|
|
19
|
+
SharedValues::ZEALOT_LATEST_QRCODE_URL,
|
|
20
|
+
SharedValues::ZEALOT_LATEST_CONTEXT
|
|
21
|
+
].each { |key| Actions.lane_context.delete(key) }
|
|
22
|
+
|
|
23
|
+
response = check_app_version(params)
|
|
24
|
+
# 上游非终止模式在网络错误时返回 false,不能继续读取 response.status。
|
|
25
|
+
return nil unless response
|
|
26
|
+
|
|
27
|
+
unless [200, 404].include?(response.status) && response.body.is_a?(Hash)
|
|
28
|
+
show_error("Zealot 版本查询失败(HTTP #{response.status})", params[:fail_on_error])
|
|
29
|
+
return nil
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
parse_response(response, params[:fail_on_error])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.available_options
|
|
36
|
+
zealot_options(ZealotVersionCheckAction)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.description
|
|
40
|
+
'按 Bundle ID 与版本号或 Git commit 查询 Zealot,返回是否已存在'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.example_code
|
|
44
|
+
['check_zealot_version(bundle_id: "com.example.app", release_version: "1.0", build_version: "1")']
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.is_supported?(platform)
|
|
48
|
+
platform == :ios
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -182,6 +182,18 @@ module Fastlane
|
|
|
182
182
|
end
|
|
183
183
|
end
|
|
184
184
|
|
|
185
|
+
# 上传 Zealot
|
|
186
|
+
if CommonHelper.is_validate_string(Environment.zealot_token)
|
|
187
|
+
zealot_upload_info = other_action.upload_zealot(
|
|
188
|
+
file: ipa_path,
|
|
189
|
+
changelog: params[:changelog]
|
|
190
|
+
)
|
|
191
|
+
# dSYM 仅在 IPA 上传成功且显式开启时上传。
|
|
192
|
+
if zealot_upload_info && params[:is_upload_zealot_dsym]
|
|
193
|
+
other_action.upload_zealot_dsym
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
185
197
|
send_dingding_notice.call(notiText)
|
|
186
198
|
end
|
|
187
199
|
|
|
@@ -261,6 +273,14 @@ module Fastlane
|
|
|
261
273
|
|
|
262
274
|
def self.available_options
|
|
263
275
|
[
|
|
276
|
+
FastlaneCore::ConfigItem.new(
|
|
277
|
+
key: :is_upload_zealot_dsym,
|
|
278
|
+
env_name: 'ZEALOT_UPLOAD_DSYM',
|
|
279
|
+
description: 'IPA 上传 Zealot 成功后继续上传 iOS dSYM',
|
|
280
|
+
optional: true,
|
|
281
|
+
default_value: false,
|
|
282
|
+
type: Boolean
|
|
283
|
+
),
|
|
264
284
|
FastlaneCore::ConfigItem.new(
|
|
265
285
|
key: :scheme,
|
|
266
286
|
description: '不采取默认配置,自定义 `scheme` 名称',
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require 'fastlane/plugin/fastci/helper/fastci_zealot_helper'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
# 手动同步 Apple 开发者账号中的 iOS 设备,不挂入自动打包流程。
|
|
6
|
+
class SyncZealotDevicesAction < ZealotSyncDevicesAction
|
|
7
|
+
extend Fastlane::Helper::FastciZealotHelper
|
|
8
|
+
|
|
9
|
+
def self.run(params)
|
|
10
|
+
validate_zealot_connection!(zealot_parameters(params))
|
|
11
|
+
Actions.lane_context.delete(SharedValues::ZEAALOT_ERROR_MESSAGE)
|
|
12
|
+
devices = fetch_ios_devices(params)
|
|
13
|
+
print_table(build_table_data(params, devices), title: 'sync_zealot_devices')
|
|
14
|
+
|
|
15
|
+
# 沿用官方的设备上传协议,按实际 HTTP 结果统计,避免失败被计为成功。
|
|
16
|
+
failed = devices.count { |device| !sync_ios_device(params, device) }
|
|
17
|
+
result = { total: devices.size, succeeded: devices.size - failed, failed: failed }
|
|
18
|
+
UI.message("Zealot iOS 设备同步:成功 #{result[:succeeded]},失败 #{failed}")
|
|
19
|
+
result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.fetch_ios_devices(params)
|
|
23
|
+
require 'spaceship'
|
|
24
|
+
|
|
25
|
+
token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path])
|
|
26
|
+
if token
|
|
27
|
+
Spaceship::ConnectAPI.token = token
|
|
28
|
+
return Spaceship::ConnectAPI::Device.all(filter: { platform: 'IOS' })
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
credentials = CredentialsManager::AccountManager.new(user: params[:username])
|
|
32
|
+
Spaceship.login(credentials.user, credentials.password)
|
|
33
|
+
Spaceship.select_team
|
|
34
|
+
Spaceship::Device.all(mac: false)
|
|
35
|
+
end
|
|
36
|
+
private_class_method :fetch_ios_devices
|
|
37
|
+
|
|
38
|
+
def self.sync_ios_device(params, device)
|
|
39
|
+
response = sync_deivce(params, device)
|
|
40
|
+
return true if response.success?
|
|
41
|
+
|
|
42
|
+
show_error("Zealot 设备同步失败(HTTP #{response.status})", params[:fail_on_error])
|
|
43
|
+
rescue Faraday::ConnectionFailed, Faraday::TimeoutError => error
|
|
44
|
+
show_error("Zealot 设备同步请求失败:#{error.class}", params[:fail_on_error])
|
|
45
|
+
end
|
|
46
|
+
private_class_method :sync_ios_device
|
|
47
|
+
|
|
48
|
+
def self.available_options
|
|
49
|
+
zealot_options(ZealotSyncDevicesAction, excluding: [:platform])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.description
|
|
53
|
+
'同步 Apple 开发者账号中的 iOS 设备到 Zealot'
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.example_code
|
|
57
|
+
['sync_zealot_devices(api_key_path: "./app_store_connect_api_key.json")']
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.is_supported?(platform)
|
|
61
|
+
platform == :ios
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require 'fastlane/plugin/fastci/helper/fastci_zealot_helper'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
# iOS IPA 上传:沿用官方传输与结果解析,避免复制 Zealot HTTP 协议。
|
|
6
|
+
class UploadZealotAction < ZealotAction
|
|
7
|
+
extend Fastlane::Helper::FastciZealotHelper
|
|
8
|
+
|
|
9
|
+
def self.run(params)
|
|
10
|
+
validate_zealot_connection!(zealot_parameters(params))
|
|
11
|
+
UI.user_error!('请指定 IPA 文件或先执行 gym/package') if params[:file].to_s.empty?
|
|
12
|
+
|
|
13
|
+
# 同一 lane 可多次上传,失败时不能返回上一次上传的地址。
|
|
14
|
+
output.each { |key, _description| Actions.lane_context.delete(key.to_sym) }
|
|
15
|
+
super(params)
|
|
16
|
+
return nil unless Actions.lane_context[SharedValues::ZEALOT_RELEASE_ID]
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
app_id: Actions.lane_context[SharedValues::ZEALOT_APP_ID],
|
|
20
|
+
release_id: Actions.lane_context[SharedValues::ZEALOT_RELEASE_ID],
|
|
21
|
+
release_url: Actions.lane_context[SharedValues::ZEALOT_RELEASE_URL],
|
|
22
|
+
install_url: Actions.lane_context[SharedValues::ZEALOT_INSTALL_URL],
|
|
23
|
+
qrcode_url: Actions.lane_context[SharedValues::ZEALOT_QRCODE_URL]
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.available_options
|
|
28
|
+
options = zealot_options(ZealotAction, excluding: [:file])
|
|
29
|
+
options << FastlaneCore::ConfigItem.new(
|
|
30
|
+
key: :file,
|
|
31
|
+
env_name: 'ZEALOT_FILE',
|
|
32
|
+
description: 'iOS IPA 路径,默认使用本次 gym 的产物',
|
|
33
|
+
optional: true,
|
|
34
|
+
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
|
|
35
|
+
type: String,
|
|
36
|
+
verify_block: proc do |value|
|
|
37
|
+
unless File.file?(value) && File.extname(value).casecmp('.ipa').zero?
|
|
38
|
+
UI.user_error!("不是有效的 IPA 文件:#{value}")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
)
|
|
42
|
+
options
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.description
|
|
46
|
+
'上传 iOS IPA 到 Zealot,返回应用、版本和下载地址'
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def self.example_code
|
|
50
|
+
['upload_zealot(file: "./App.ipa", changelog: "iOS 更新说明")']
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.is_supported?(platform)
|
|
54
|
+
platform == :ios
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
require 'fastlane/plugin/fastci/helper/fastci_zealot_helper'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Actions
|
|
5
|
+
# 固定走官方 iOS dSYM 流程,不暴露 Android 或 macOS 参数。
|
|
6
|
+
class UploadZealotDsymAction < ZealotDebugFileAction
|
|
7
|
+
extend Fastlane::Helper::FastciZealotHelper
|
|
8
|
+
|
|
9
|
+
def self.run(params)
|
|
10
|
+
values = zealot_parameters(params)
|
|
11
|
+
validate_zealot_connection!(values)
|
|
12
|
+
values[:platform] = 'ios'
|
|
13
|
+
values[:zip_file] ||= Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] unless values[:path]
|
|
14
|
+
values[:path] ||= Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] unless values[:zip_file]
|
|
15
|
+
|
|
16
|
+
unless values[:zip_file] || values[:path]
|
|
17
|
+
UI.user_error!('请指定 dSYM zip_file、xcarchive path,或先执行 gym/package')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
if values[:zip_file] && !File.file?(values[:zip_file])
|
|
21
|
+
UI.user_error!("dSYM 压缩文件不存在:#{values[:zip_file]}")
|
|
22
|
+
end
|
|
23
|
+
if values[:path] && !File.directory?(values[:path])
|
|
24
|
+
UI.user_error!("Xcode archive 不存在:#{values[:path]}")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Actions.lane_context.delete(SharedValues::ZEAALOT_ERROR_MESSAGE)
|
|
28
|
+
super(FastlaneCore::Configuration.create(ZealotDebugFileAction.available_options, values))
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# 上游只检查响应中的 error 字段;非成功 HTTP 状态不能计为上传成功。
|
|
32
|
+
def self.parse_response(response, upload_url, fail_on_error)
|
|
33
|
+
return unless response
|
|
34
|
+
|
|
35
|
+
unless response.success? && response.body.is_a?(Hash)
|
|
36
|
+
return show_error("Zealot dSYM 上传失败(HTTP #{response.status})", fail_on_error)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
super
|
|
40
|
+
end
|
|
41
|
+
private_class_method :parse_response
|
|
42
|
+
|
|
43
|
+
def self.available_options
|
|
44
|
+
zealot_options(
|
|
45
|
+
ZealotDebugFileAction,
|
|
46
|
+
excluding: [:platform, :android_build_type, :android_flavor]
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def self.description
|
|
51
|
+
'上传 iOS dSYM 到 Zealot,支持 zip_file、xcarchive 或本次 gym 产物'
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def self.example_code
|
|
55
|
+
['upload_zealot_dsym(zip_file: "./App.app.dSYM.zip")']
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.is_supported?(platform)
|
|
59
|
+
platform == :ios
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -91,6 +91,17 @@ module Fastlane
|
|
|
91
91
|
ENV['FIR_SWITCH_QINIU'] == "true"
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
# Zealot 配置;可选上传渠道,未配置时不影响现有打包流程。
|
|
95
|
+
def self.zealot_endpoint
|
|
96
|
+
ENV['ZEALOT_ENDPOINT']
|
|
97
|
+
end
|
|
98
|
+
def self.zealot_token
|
|
99
|
+
ENV['ZEALOT_TOKEN']
|
|
100
|
+
end
|
|
101
|
+
def self.zealot_channel_key
|
|
102
|
+
ENV['ZEALOT_CHANNEL_KEY']
|
|
103
|
+
end
|
|
104
|
+
|
|
94
105
|
# 钉钉配置
|
|
95
106
|
def self.dingdingToken
|
|
96
107
|
ENV['DINGDING_TOKEN']
|
|
@@ -112,4 +123,4 @@ module Fastlane
|
|
|
112
123
|
|
|
113
124
|
end
|
|
114
125
|
end
|
|
115
|
-
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require 'fastlane/plugin/zealot'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module Helper
|
|
5
|
+
# 复用官方 Action 的协议与参数,仅收口 FastCI 的 iOS 边界和日志脱敏。
|
|
6
|
+
module FastciZealotHelper
|
|
7
|
+
def zealot_options(action, excluding: [])
|
|
8
|
+
options = action.available_options.reject do |option|
|
|
9
|
+
excluding.include?(option.key) || option.key == :fail_on_error
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# 新增上传渠道默认明确报错,避免 CI 把失败当作上传完成。
|
|
13
|
+
options << FastlaneCore::ConfigItem.new(
|
|
14
|
+
key: :fail_on_error,
|
|
15
|
+
env_name: 'ZEALOT_FAIL_ON_ERROR',
|
|
16
|
+
description: 'Zealot 请求失败时终止当前任务',
|
|
17
|
+
optional: true,
|
|
18
|
+
default_value: true,
|
|
19
|
+
type: Boolean
|
|
20
|
+
)
|
|
21
|
+
options
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def zealot_parameters(params)
|
|
25
|
+
params.all_keys.each_with_object({}) do |key, values|
|
|
26
|
+
value = params[key]
|
|
27
|
+
values[key] = value unless value.nil?
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def validate_zealot_connection!(values)
|
|
32
|
+
keys = [:endpoint, :token]
|
|
33
|
+
keys << :channel_key if values.key?(:channel_key)
|
|
34
|
+
keys.each do |key|
|
|
35
|
+
UI.user_error!("缺少 Zealot #{key}") if values[key].to_s.strip.empty?
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# 官方部分 Action 未隐藏 token;只改变当前封装的输出,不修改上游全局实现。
|
|
40
|
+
def print_table(form, title: 'zealot', hidden_keys: [], remove_empty_value: true)
|
|
41
|
+
super(
|
|
42
|
+
form,
|
|
43
|
+
title: title,
|
|
44
|
+
hidden_keys: hidden_keys + [:token, :Token],
|
|
45
|
+
remove_empty_value: remove_empty_value
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastlane-plugin-fastci
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.30
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- watermelon
|
|
@@ -65,6 +65,20 @@ dependencies:
|
|
|
65
65
|
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: 2.5.1
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: fastlane-plugin-zealot
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: 1.0.1
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 1.0.1
|
|
68
82
|
email: watermelon_lp@163.com
|
|
69
83
|
executables: []
|
|
70
84
|
extensions: []
|
|
@@ -74,6 +88,7 @@ files:
|
|
|
74
88
|
- README.md
|
|
75
89
|
- lib/fastlane/plugin/fastci.rb
|
|
76
90
|
- lib/fastlane/plugin/fastci/actions/analyze_swiftlint_action.rb
|
|
91
|
+
- lib/fastlane/plugin/fastci/actions/check_zealot_version_action.rb
|
|
77
92
|
- lib/fastlane/plugin/fastci/actions/detect_duplicity_code_action.rb
|
|
78
93
|
- lib/fastlane/plugin/fastci/actions/detect_unused_code_action.rb
|
|
79
94
|
- lib/fastlane/plugin/fastci/actions/detect_unused_image_action.rb
|
|
@@ -81,14 +96,18 @@ files:
|
|
|
81
96
|
- lib/fastlane/plugin/fastci/actions/install_profile_action.rb
|
|
82
97
|
- lib/fastlane/plugin/fastci/actions/package_action.rb
|
|
83
98
|
- lib/fastlane/plugin/fastci/actions/sentry_upload_dsym.rb
|
|
99
|
+
- lib/fastlane/plugin/fastci/actions/sync_zealot_devices_action.rb
|
|
84
100
|
- lib/fastlane/plugin/fastci/actions/update_build_number_action.rb
|
|
85
101
|
- lib/fastlane/plugin/fastci/actions/upload_fir_action.rb
|
|
86
102
|
- lib/fastlane/plugin/fastci/actions/upload_pgy_action.rb
|
|
87
103
|
- lib/fastlane/plugin/fastci/actions/upload_store_action.rb
|
|
104
|
+
- lib/fastlane/plugin/fastci/actions/upload_zealot_action.rb
|
|
105
|
+
- lib/fastlane/plugin/fastci/actions/upload_zealot_dsym_action.rb
|
|
88
106
|
- lib/fastlane/plugin/fastci/helper/common_helper.rb
|
|
89
107
|
- lib/fastlane/plugin/fastci/helper/constants.rb
|
|
90
108
|
- lib/fastlane/plugin/fastci/helper/dingding_helper.rb
|
|
91
109
|
- lib/fastlane/plugin/fastci/helper/environment.rb
|
|
110
|
+
- lib/fastlane/plugin/fastci/helper/fastci_zealot_helper.rb
|
|
92
111
|
- lib/fastlane/plugin/fastci/helper/fir_helper.rb
|
|
93
112
|
- lib/fastlane/plugin/fastci/version.rb
|
|
94
113
|
- lib/fastlane/plugin/python/generate_duplicity_code_html.py
|
|
@@ -114,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
114
133
|
- !ruby/object:Gem::Version
|
|
115
134
|
version: '0'
|
|
116
135
|
requirements: []
|
|
117
|
-
rubygems_version:
|
|
136
|
+
rubygems_version: 4.0.23
|
|
118
137
|
specification_version: 4
|
|
119
138
|
summary: supports multiple functions such as packaging, uploading, and code detection.
|
|
120
139
|
test_files: []
|