fastlane-plugin-fastci 0.0.7 → 0.0.9
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 +6 -7
- data/lib/fastlane/plugin/fastci/actions/package_action.rb +48 -18
- data/lib/fastlane/plugin/fastci/actions/upload_fir_action.rb +10 -1
- data/lib/fastlane/plugin/fastci/actions/upload_store_action.rb +25 -10
- data/lib/fastlane/plugin/fastci/helper/environment.rb +4 -0
- data/lib/fastlane/plugin/fastci/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92cd2eecab7638219676828631ffb4ca3b81074629ce70e6e9eaf053e2778e99
|
|
4
|
+
data.tar.gz: f7d32780ee6b2582b7cd2a19bbfdf766627af508b9622526ed4185c311041cc8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f93414a9ca171e561674ed6bfacb4a0e1aecb18514d24e2c812f19aa288a16d2e707c2474b98cd44f651fce23deb9debcffdfe3becb3f7d7bebd020924807e0
|
|
7
|
+
data.tar.gz: '0287e0c10faffe56b080040da482d45f0654264725a63ad09245114275bed2bba6b958c26791d200388d12d8c0f63fe92fee4a7e426f3ce1a075adafeebbdf89'
|
data/README.md
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
简单快速的集成,5 分钟即可上手。
|
|
8
8
|
配合 Jenkins 实现高度自定义。
|
|
9
9
|
|
|
10
|
-
目前还在 Beta 测试阶段!!!
|
|
11
|
-
|
|
12
10
|
---
|
|
13
11
|
|
|
14
12
|
## 安装方法
|
|
@@ -28,8 +26,8 @@
|
|
|
28
26
|
## 使用方法
|
|
29
27
|
|
|
30
28
|
参考 [` Fastfile `](fastlane/Fastfile) 和 [` .env.default `](fastlane/.env.default) 替换项目内 fastlane 文件夹下文件;
|
|
31
|
-
项目根目录新建 ` PACKAGE_FILE_FOLDER_NAME `
|
|
32
|
-
|
|
29
|
+
项目根目录新建 ` PACKAGE_FILE_FOLDER_NAME ` 配置对应名字文件夹,将描述文件、p12 证书、p8 密钥等文件放入该文件夹下。
|
|
30
|
+
然后终端进入项目根目录即可使用 ` fastlane `
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
### 使用后会在项目根目录生成文件夹
|
|
@@ -49,7 +47,7 @@ fastlane_cache/ # 插件缓存文件夹
|
|
|
49
47
|
|
|
50
48
|
### 1. 自动打包
|
|
51
49
|
功能:自动编译并导出 ipa 包,支持多种打包方式和集成多项检查。
|
|
52
|
-
生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英或 fir 参数会自动上传蒲公英或 fir` app-store ` 配置了商店参数会自动上传商店。
|
|
50
|
+
生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英或 fir 参数会自动上传蒲公英或 fir` app-store ` 和 ` testFlight ` 配置了商店参数会自动上传商店。
|
|
53
51
|
|
|
54
52
|
` build `: 不指定的话内部有递增逻辑,格式为 ` 20250905.15(日期+当天包的次数) `
|
|
55
53
|
|
|
@@ -58,13 +56,14 @@ fastlane_cache/ # 插件缓存文件夹
|
|
|
58
56
|
```ruby
|
|
59
57
|
package(
|
|
60
58
|
configuration: "Debug", # 编译环境 Release/Debug
|
|
61
|
-
export_method: "development", # 打包方式 ad-hoc, enterprise, app-store, development
|
|
59
|
+
export_method: "development", # 打包方式 ad-hoc, enterprise, app-store, development, testFlight
|
|
62
60
|
version: nil, # 指定 version
|
|
63
61
|
build: nil, # 指定 build 号
|
|
64
62
|
is_analyze_swiftlint: false, # 是否代码分析
|
|
65
63
|
is_detect_duplicity_code: false, # 是否检测重复代码
|
|
66
64
|
is_detect_unused_code: false, # 是否检测未使用代码
|
|
67
|
-
is_detect_unused_image: false # 是否检测未使用图片
|
|
65
|
+
is_detect_unused_image: false, # 是否检测未使用图片
|
|
66
|
+
changelog: options[:changelog], # fir 更新日志
|
|
68
67
|
release_notes: options[:release_notes] # 配合 jenkins 传参上传 appstore 格式为 { \"zh-Hans\": \"修复问题\", \"en-US\": \"bugfix\"} JSON 字符串
|
|
69
68
|
)
|
|
70
69
|
```
|
|
@@ -19,7 +19,7 @@ module Fastlane
|
|
|
19
19
|
is_detect_unused_code = params[:is_detect_unused_code] || false
|
|
20
20
|
is_detect_unused_image = params[:is_detect_unused_image] || false
|
|
21
21
|
release_notes = params[:release_notes] || ""
|
|
22
|
-
if export_method == "app-store"
|
|
22
|
+
if export_method == "app-store" || export_method == "testFlight"
|
|
23
23
|
configuration = "Release"
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -32,7 +32,7 @@ module Fastlane
|
|
|
32
32
|
# 安装 provisioningProfile
|
|
33
33
|
other_action.install_profile()
|
|
34
34
|
|
|
35
|
-
scheme = Environment.scheme
|
|
35
|
+
scheme = params[:scheme] || Environment.scheme
|
|
36
36
|
|
|
37
37
|
# 更改项目version
|
|
38
38
|
other_action.increment_version_number(
|
|
@@ -47,7 +47,7 @@ module Fastlane
|
|
|
47
47
|
version = Actions::GetVersionNumberAction.run(target: Environment.target)
|
|
48
48
|
build = Actions::GetBuildNumberAction.run({})
|
|
49
49
|
# 生成ipa包的名字格式
|
|
50
|
-
ipaName = "#{
|
|
50
|
+
ipaName = "#{scheme}_#{export_method}_#{version}_#{build}.ipa"
|
|
51
51
|
|
|
52
52
|
# 获取 Extension 的 Bundle ID(可能有多个,用逗号分隔)
|
|
53
53
|
extension_bundle_ids = Environment.extension_bundle_ids
|
|
@@ -62,7 +62,7 @@ module Fastlane
|
|
|
62
62
|
when "ad-hoc"
|
|
63
63
|
profile_name = Environment.provisioningProfiles_adhoc
|
|
64
64
|
extension_profile_names = Environment.extension_profiles_adhoc
|
|
65
|
-
when "app-store"
|
|
65
|
+
when "app-store", "testFlight"
|
|
66
66
|
profile_name = Environment.provisioningProfiles_appstore
|
|
67
67
|
extension_profile_names = Environment.extension_profiles_appstore
|
|
68
68
|
else
|
|
@@ -79,7 +79,10 @@ module Fastlane
|
|
|
79
79
|
|
|
80
80
|
UI.message("*************| 开始打包 |*************")
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
# 对于 testFlight,使用 app-store 方法
|
|
83
|
+
gym_method = export_method == "testFlight" ? "app-store" : export_method
|
|
84
|
+
|
|
85
|
+
gym_options = {
|
|
83
86
|
clean: true,
|
|
84
87
|
silent: true,
|
|
85
88
|
workspace: Environment.workspace,
|
|
@@ -89,10 +92,17 @@ module Fastlane
|
|
|
89
92
|
output_name: ipaName,
|
|
90
93
|
output_directory: Constants.IPA_OUTPUT_DIR,
|
|
91
94
|
export_options: {
|
|
92
|
-
method:
|
|
93
|
-
provisioningProfiles: provisioningProfiles_map
|
|
95
|
+
method: gym_method
|
|
94
96
|
}
|
|
95
|
-
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if Environment.is_auto_update_provisioning
|
|
100
|
+
gym_options[:xcargs] = '-allowProvisioningUpdates'
|
|
101
|
+
else
|
|
102
|
+
gym_options[:export_options][:provisioningProfiles] = provisioningProfiles_map
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
other_action.gym(gym_options)
|
|
96
106
|
|
|
97
107
|
UI.message("*************| 打包完成 |*************")
|
|
98
108
|
|
|
@@ -114,13 +124,18 @@ module Fastlane
|
|
|
114
124
|
|
|
115
125
|
ipa_path = "#{Constants.IPA_OUTPUT_DIR}/#{ipaName}"
|
|
116
126
|
|
|
117
|
-
if export_method == "app-store"
|
|
127
|
+
if export_method == "app-store" || export_method == "testFlight"
|
|
118
128
|
notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-打包完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
|
|
119
129
|
DingdingHelper.sendMarkdown(notiText)
|
|
120
130
|
|
|
121
131
|
if CommonHelper.is_validate_string(Environment.connect_key_id) && CommonHelper.is_validate_string(Environment.connect_issuer_id)
|
|
122
|
-
|
|
123
|
-
|
|
132
|
+
# 根据 export_method 决定是否为 TestFlight
|
|
133
|
+
is_test_flight = export_method == "testFlight"
|
|
134
|
+
|
|
135
|
+
other_action.upload_store(
|
|
136
|
+
release_notes: release_notes,
|
|
137
|
+
isTestFlight: is_test_flight
|
|
138
|
+
)
|
|
124
139
|
notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-上传完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
|
|
125
140
|
DingdingHelper.sendMarkdown(notiText)
|
|
126
141
|
end
|
|
@@ -140,7 +155,9 @@ module Fastlane
|
|
|
140
155
|
|
|
141
156
|
# 上传 fir
|
|
142
157
|
if CommonHelper.is_validate_string(Environment.fir_api_token)
|
|
143
|
-
fir_upload_info = other_action.upload_fir(
|
|
158
|
+
fir_upload_info = other_action.upload_fir(
|
|
159
|
+
changelog: params[:changelog]
|
|
160
|
+
)
|
|
144
161
|
download_url = fir_upload_info[:download_url]
|
|
145
162
|
|
|
146
163
|
if CommonHelper.is_validate_string(download_url)
|
|
@@ -152,7 +169,7 @@ module Fastlane
|
|
|
152
169
|
end
|
|
153
170
|
|
|
154
171
|
# 代码分析
|
|
155
|
-
if is_analyze_swiftlint &&
|
|
172
|
+
if is_analyze_swiftlint && gym_method != "app-store"
|
|
156
173
|
analyze_swiftlint(is_from_package: true, configuration: configuration)
|
|
157
174
|
# 结果复制到桌面
|
|
158
175
|
FileUtils.cp(SWIFTLINT_HTML_FILE, target_path)
|
|
@@ -163,7 +180,7 @@ module Fastlane
|
|
|
163
180
|
end
|
|
164
181
|
|
|
165
182
|
# 重复代码检查
|
|
166
|
-
if is_detect_duplicity_code &&
|
|
183
|
+
if is_detect_duplicity_code && gym_method != "app-store"
|
|
167
184
|
detect_code_duplicity(is_all: true)
|
|
168
185
|
# 结果复制到桌面
|
|
169
186
|
FileUtils.cp(DUPLICITY_CODE_HTML_FILE, target_path)
|
|
@@ -173,7 +190,7 @@ module Fastlane
|
|
|
173
190
|
end
|
|
174
191
|
|
|
175
192
|
# 无用代码检查
|
|
176
|
-
if is_detect_unused_code &&
|
|
193
|
+
if is_detect_unused_code && gym_method != "app-store"
|
|
177
194
|
DetectUnusedCodeAction.run(
|
|
178
195
|
is_from_package: true,
|
|
179
196
|
configuration: configuration
|
|
@@ -186,7 +203,7 @@ module Fastlane
|
|
|
186
203
|
end
|
|
187
204
|
|
|
188
205
|
# 无用图片检查
|
|
189
|
-
if is_detect_unused_image &&
|
|
206
|
+
if is_detect_unused_image && gym_method != "app-store"
|
|
190
207
|
DetectUnusedImageAction.run({})
|
|
191
208
|
# 结果复制到桌面
|
|
192
209
|
FileUtils.cp(Constants.UNUSED_IMAGE_HTML_FILE, target_path)
|
|
@@ -215,6 +232,13 @@ module Fastlane
|
|
|
215
232
|
|
|
216
233
|
def self.available_options
|
|
217
234
|
[
|
|
235
|
+
FastlaneCore::ConfigItem.new(
|
|
236
|
+
key: :scheme,
|
|
237
|
+
description: "不采取默认配置,自定义 `scheme` 名称",
|
|
238
|
+
optional: true,
|
|
239
|
+
default_value: nil,
|
|
240
|
+
type: String
|
|
241
|
+
),
|
|
218
242
|
FastlaneCore::ConfigItem.new(
|
|
219
243
|
key: :configuration,
|
|
220
244
|
description: "编译环境 Release or Debug",
|
|
@@ -230,12 +254,12 @@ module Fastlane
|
|
|
230
254
|
),
|
|
231
255
|
FastlaneCore::ConfigItem.new(
|
|
232
256
|
key: :export_method,
|
|
233
|
-
description: "打包方式 ad-hoc, enterprise, app-store, development",
|
|
257
|
+
description: "打包方式 ad-hoc, enterprise, app-store, development, testFlight",
|
|
234
258
|
optional: true,
|
|
235
259
|
default_value: "development",
|
|
236
260
|
type: String,
|
|
237
261
|
verify_block: proc do |value|
|
|
238
|
-
valid_params = ["ad-hoc", "enterprise", "app-store", "development"]
|
|
262
|
+
valid_params = ["ad-hoc", "enterprise", "app-store", "development", "testFlight"]
|
|
239
263
|
unless valid_params.include?(value)
|
|
240
264
|
UI.user_error!("无效的打包方式: #{value}。支持的方式: #{valid_params.join(', ')}")
|
|
241
265
|
end
|
|
@@ -283,6 +307,12 @@ module Fastlane
|
|
|
283
307
|
default_value: false,
|
|
284
308
|
type: Boolean
|
|
285
309
|
),
|
|
310
|
+
FastlaneCore::ConfigItem.new(
|
|
311
|
+
key: :changelog,
|
|
312
|
+
description: "更新日志",
|
|
313
|
+
optional: true,
|
|
314
|
+
type: String
|
|
315
|
+
),
|
|
286
316
|
FastlaneCore::ConfigItem.new(
|
|
287
317
|
key: :release_notes,
|
|
288
318
|
description: "更新文案, 格式为 { \"zh-Hans\": \"修复问题\", \"en-US\": \"bugfix\"} JSON 字符串",
|
|
@@ -12,6 +12,8 @@ module Fastlane
|
|
|
12
12
|
firinfo = other_action.fir_cli(
|
|
13
13
|
api_token: Environment.fir_api_token,
|
|
14
14
|
password: Environment.fir_password,
|
|
15
|
+
changelog: params[:changelog],
|
|
16
|
+
switch_to_qiniu: true
|
|
15
17
|
)
|
|
16
18
|
|
|
17
19
|
return firinfo
|
|
@@ -22,7 +24,14 @@ module Fastlane
|
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
def self.available_options
|
|
25
|
-
[
|
|
27
|
+
[
|
|
28
|
+
FastlaneCore::ConfigItem.new(
|
|
29
|
+
key: :changelog,
|
|
30
|
+
description: "更新日志",
|
|
31
|
+
optional: true,
|
|
32
|
+
type: String
|
|
33
|
+
),
|
|
34
|
+
]
|
|
26
35
|
end
|
|
27
36
|
|
|
28
37
|
def self.is_supported?(platform)
|
|
@@ -6,7 +6,6 @@ module Fastlane
|
|
|
6
6
|
# 上传 AppStore
|
|
7
7
|
class UploadStoreAction < Action
|
|
8
8
|
def self.run(params)
|
|
9
|
-
UI.message("*************| 开始上传 AppStore |*************")
|
|
10
9
|
|
|
11
10
|
release_notes = JSON.parse(params[:release_notes] || "") rescue ""
|
|
12
11
|
|
|
@@ -17,15 +16,25 @@ module Fastlane
|
|
|
17
16
|
duration: 1200, # optional (maximum 1200)
|
|
18
17
|
in_house: false # optional but may be required if using match/sigh
|
|
19
18
|
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
|
|
20
|
+
if params[:isTestFlight]
|
|
21
|
+
UI.message("*************| 开始上传 TestFlight |*************")
|
|
22
|
+
other_action.upload_to_testflight(
|
|
23
|
+
skip_waiting_for_build_processing: true
|
|
24
|
+
)
|
|
25
|
+
else
|
|
26
|
+
UI.message("*************| 开始上传 AppStore |*************")
|
|
27
|
+
other_action.upload_to_app_store(
|
|
28
|
+
skip_metadata: false,
|
|
29
|
+
skip_screenshots: true,
|
|
30
|
+
run_precheck_before_submit: false,
|
|
31
|
+
precheck_include_in_app_purchases: false,
|
|
32
|
+
force: true,
|
|
33
|
+
submit_for_review: false,
|
|
34
|
+
automatic_release: false,
|
|
35
|
+
release_notes: release_notes
|
|
36
|
+
)
|
|
37
|
+
end
|
|
29
38
|
end
|
|
30
39
|
|
|
31
40
|
def self.description
|
|
@@ -39,6 +48,12 @@ module Fastlane
|
|
|
39
48
|
description: "更新文案, 格式为 { \"zh-Hans\": \"修复问题\", \"en-US\": \"bugfix\"} JSON 字符串",
|
|
40
49
|
optional: false,
|
|
41
50
|
type: String
|
|
51
|
+
),
|
|
52
|
+
FastlaneCore::ConfigItem.new(
|
|
53
|
+
key: :isTestFlight,
|
|
54
|
+
description: "是否为 TestFlight 打包",
|
|
55
|
+
optional: false,
|
|
56
|
+
type: Boolean
|
|
42
57
|
)
|
|
43
58
|
]
|
|
44
59
|
end
|
|
@@ -33,6 +33,10 @@ module Fastlane
|
|
|
33
33
|
def self.package_file_folder_name
|
|
34
34
|
ENV['PACKAGE_FILE_FOLDER_NAME']
|
|
35
35
|
end
|
|
36
|
+
# 是否自动更新描述文件
|
|
37
|
+
def self.is_auto_update_provisioning
|
|
38
|
+
ENV['IS_AUTO_UPDATE_PROVISIONING'] == "true"
|
|
39
|
+
end
|
|
36
40
|
|
|
37
41
|
# 描述文件配置
|
|
38
42
|
def self.provisioningProfiles_development
|