fastlane-plugin-fastci 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 412038fd44bc6d55aa20d9be09dd4501bef38e2050066ab808e8d88dc60994e7
4
- data.tar.gz: d6535653192f7f5b4aa0ef9a6126b6df85fb50fb1036daa686920b168f070652
3
+ metadata.gz: 53ec20d0f578e7220c03e65b98d1ca1907f40d4bdd973fd5bba59fa17870ef20
4
+ data.tar.gz: fe1eb5138294dc9e4a6130b57ed96074f1c0981a344b8272a5d758e9c9edfb74
5
5
  SHA512:
6
- metadata.gz: 3cb86329414a976f10e924e55f1961462e1e2342b904ecaad5a1ac60ea09b3bd285c81689f0babcbab24a0ce82eaad09f65cf4d7b0247ff0f7a1d3648e2f5b43
7
- data.tar.gz: 0fc6b479c8b969597e8354a3a20360150935a53581668e72cc34db2311567fec50f0ec86e4664bb41e449c6dbcb1599fce34a044d6caf7e32bf5142a69463fee
6
+ metadata.gz: f20bf4ddf3b51247b7e7be24ecadda56acb86f10232641db6d2033bcb363c084d121ddec80f92206b3c9d5a3c882273583b62b2f045df05cbfd2efc3a4e230ae
7
+ data.tar.gz: 9a6feee1d0e97c4147bc41d65f3c57330e91d972246a08577e583706114730574bce1b34a55d21a46288954da1263f55bf09ffbf38da46c8bf20287190c010df
data/README.md CHANGED
@@ -48,7 +48,7 @@ fastlane_cache/ # 插件缓存文件夹
48
48
 
49
49
  ### 1. 自动打包
50
50
  功能:自动编译并导出 ipa 包,支持多种打包方式和集成多项检查。
51
- 生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英参数会自动上传蒲公英,` app-store ` 配置了商店参数会自动上传商店。
51
+ 生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英或 fir 参数会自动上传蒲公英或 fir` app-store ` 配置了商店参数会自动上传商店。
52
52
 
53
53
  ` build `: 不指定的话内部有递增逻辑,格式为 ` 20250905.15(日期+当天包的次数) `
54
54
 
@@ -64,6 +64,7 @@ package(
64
64
  is_detect_duplicity_code: false, # 是否检测重复代码
65
65
  is_detect_unused_code: false, # 是否检测未使用代码
66
66
  is_detect_unused_image: false # 是否检测未使用图片
67
+ release_notes: options[:release_notes] # 配合 jenkins 传参上传 appstore { "zh-Hans" => "修复问题", "en-US" => "bugfix"} 格式
67
68
  )
68
69
  ```
69
70
 
@@ -11,7 +11,7 @@ module Fastlane
11
11
  certificate_paths = Dir.glob(File.expand_path("#{Environment.certificate_folder_name}/*.p12"))
12
12
  certificate_paths.each do |path|
13
13
  other_action.import_certificate(
14
- certificate_path: File.expand_path(path),
14
+ certificate_path: path,
15
15
  certificate_password: "#{Environment.certificate_password}",
16
16
  keychain_name: "login.keychain",
17
17
  keychain_password: "#{Environment.keychain_password}"
@@ -11,7 +11,7 @@ module Fastlane
11
11
  provisioning_profile_paths = Dir.glob(File.expand_path("#{Environment.provisioningProfile_folder_name}/*.mobileprovision"))
12
12
  provisioning_profile_paths.each do |path|
13
13
  other_action.install_provisioning_profile(
14
- path: File.expand_path(path)
14
+ path: path
15
15
  )
16
16
  end
17
17
  end
@@ -27,9 +27,9 @@ module Fastlane
27
27
  FileUtils.rm_rf(Dir.glob("#{Constants.IPA_OUTPUT_DIR}/*"))
28
28
 
29
29
  # 安装证书
30
- InstallCertificateAction.run({})
30
+ other_action.install_certificate()
31
31
  # 安装 provisioningProfile
32
- InstallProfileAction.run({})
32
+ other_action.install_profile()
33
33
 
34
34
  scheme = Environment.scheme
35
35
 
@@ -115,27 +115,39 @@ module Fastlane
115
115
 
116
116
  if export_method == "app-store"
117
117
  notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-打包完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
118
- NotiDingdingAction.run(notiText: notiText)
118
+ DingdingHelper.sendMarkdown(notiText)
119
119
 
120
120
  if CommonHelper.is_validate_string(Environment.connect_key_id) && CommonHelper.is_validate_string(Environment.connect_issuer_id)
121
121
 
122
- UploadStoreAction.run({})
122
+ other_action.upload_store()
123
123
  notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-上传完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
124
- NotiDingdingAction.run(notiText: notiText)
124
+ DingdingHelper.sendMarkdown(notiText)
125
125
  end
126
126
  else
127
- # 上传蒲公英
128
- pgy_upload_info = UploadPgyAction.run(
129
- "ipa_path": ipa_path
130
- )
131
- qrCode = pgy_upload_info["buildQRCodeURL"]
132
-
133
127
  # 钉钉通知
134
128
  notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-打包完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
135
- if CommonHelper.is_validate_string(qrCode)
136
- notiText << "\n\n⬇️⬇️⬇️ 扫码安装 ⬇️⬇️⬇️\n\n![screenshot](#{qrCode})"
129
+
130
+ # 上传蒲公英
131
+ if CommonHelper.is_validate_string(Environment.pgy_api_key)
132
+ pgy_upload_info = other_action.upload_pgy()
133
+ qrCode = pgy_upload_info[:buildQRCodeURL]
134
+
135
+ if CommonHelper.is_validate_string(qrCode)
136
+ notiText << "\n\n⬇️⬇️⬇️ 扫码安装 ⬇️⬇️⬇️\n\n\n密码: #{Environment.pgy_password}\n![screenshot](#{qrCode})"
137
+ end
137
138
  end
138
- NotiDingdingAction.run(notiText: notiText)
139
+
140
+ # 上传 fir
141
+ if CommonHelper.is_validate_string(Environment.fir_api_token)
142
+ fir_upload_info = other_action.upload_fir()
143
+ download_url = fir_upload_info[:download_url]
144
+
145
+ if CommonHelper.is_validate_string(download_url)
146
+ notiText << "\n\n⬇️⬇️⬇️ 点击链接安装 ⬇️⬇️⬇️\n\n\n密码: #{Environment.fir_password}\n[_点击下载_](#{download_url})"
147
+ end
148
+ end
149
+
150
+ DingdingHelper.sendMarkdown(notiText)
139
151
  end
140
152
 
141
153
  # 代码分析
@@ -188,7 +200,7 @@ module Fastlane
188
200
  is_detect_unused_image
189
201
  # 钉钉通知
190
202
  notiText = "🚀🚀🚀🚀🚀🚀\n\n#{scheme}-iOS-代码检查完成\n\n#{version}_#{build}_#{export_method}\n\n🚀🚀🚀🚀🚀🚀"
191
- NotiDingdingAction.run(notiText: notiText)
203
+ DingdingHelper.sendMarkdown(notiText)
192
204
  else
193
205
  UI.message("*************| 跳过代码检查 |*************")
194
206
  end
@@ -270,6 +282,12 @@ module Fastlane
270
282
  default_value: false,
271
283
  type: Boolean
272
284
  ),
285
+ FastlaneCore::ConfigItem.new(
286
+ key: :release_notes,
287
+ description: "更新文案, 格式为 { \"zh-Hans\" => \"修复问题\", \"en-US\" => \"bugfix\"} ",
288
+ optional: true,
289
+ type: Hash
290
+ )
273
291
  ]
274
292
  end
275
293
 
@@ -0,0 +1,38 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane/plugin/fir_cli'
3
+ include Fastlane::Helper
4
+
5
+ module Fastlane
6
+ module Actions
7
+ # 上传Fir
8
+ class UploadFirAction < Action
9
+ def self.run(params)
10
+ UI.message("*************| 开始上传Fir |*************")
11
+
12
+ firinfo = other_action.fir_cli(
13
+ api_token: Environment.fir_api_token,
14
+ password: Environment.fir_password,
15
+ )
16
+
17
+ return firinfo
18
+ end
19
+
20
+ def self.description
21
+ "上传Fir"
22
+ end
23
+
24
+ def self.available_options
25
+ []
26
+ end
27
+
28
+ def self.is_supported?(platform)
29
+ platform == :ios
30
+ end
31
+
32
+ def self.category
33
+ :building
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -9,15 +9,7 @@ module Fastlane
9
9
  def self.run(params)
10
10
  UI.message("*************| 开始上传蒲公英 |*************")
11
11
 
12
- unless CommonHelper.is_validate_string(Environment.pgy_api_key)
13
- UI.message("*************| 没有配置 pgy_api_key |*************")
14
- return
15
- end
16
-
17
- ipa_path = params[:ipa_path] || ""
18
-
19
- pgyinfo = PgyerAction.run(
20
- ipa: ipa_path,
12
+ pgyinfo = other_action.pgyer(
21
13
  api_key: Environment.pgy_api_key,
22
14
  password: Environment.pgy_password,
23
15
  install_type: "2"
@@ -21,7 +21,7 @@ module Fastlane
21
21
  force: true,
22
22
  submit_for_review: false,
23
23
  automatic_release: false,
24
- release_notes: params[:release_notes]
24
+ release_notes: params[:release_notes] || ""
25
25
  )
26
26
 
27
27
  end
@@ -0,0 +1,27 @@
1
+ require 'fastlane_core/ui/ui'
2
+ require 'fileutils'
3
+
4
+ module Fastlane
5
+ module Helper
6
+ class DingdingHelper
7
+
8
+ def self.sendMarkdown(text)
9
+ UI.message("*************| 开始钉钉消息通知 |*************")
10
+
11
+ curl = %Q{
12
+ curl 'https://oapi.dingtalk.com/robot/send?access_token=#{Environment.dingdingToken}' \
13
+ -H 'Content-Type:application/json' \
14
+ -d '{
15
+ "msgtype":"markdown",
16
+ "markdown":{
17
+ "title":"#{Environment.scheme} 打包通知",
18
+ "text":"#{text}"
19
+ }
20
+ }'
21
+ }
22
+ system curl
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -77,6 +77,14 @@ module Fastlane
77
77
  ENV['PGY_PASSWORD']
78
78
  end
79
79
 
80
+ # Fir配置
81
+ def self.fir_api_token
82
+ ENV['FIR_API_TOKEN']
83
+ end
84
+ def self.fir_password
85
+ ENV['FIR_PASSWORD']
86
+ end
87
+
80
88
  # 钉钉配置
81
89
  def self.dingdingToken
82
90
  ENV['DINGDING_TOKEN']
@@ -0,0 +1,29 @@
1
+ require 'fastlane_core/ui/ui'
2
+ require 'fastlane/plugin/fir_cli'
3
+ require 'fileutils'
4
+
5
+ module Fastlane
6
+ module Helper
7
+ class FirHelper
8
+
9
+ # def self.get_download_url(download_domain, short)
10
+ # "https://#{download_domain}/#{short}"
11
+ # end
12
+
13
+ # def self.get_qrcode(download_url)
14
+ # filePath = File.expand_path(Constants.IPA_OUTPUT_DIR)
15
+ # qrcode_path = "#{filePath}/fir-qrcode.png"
16
+ # generate_rqrcode(download_url, qrcode_path)
17
+
18
+ # qrcode_path
19
+ # end
20
+
21
+ # def self.generate_rqrcode(string, png_file_path)
22
+ # qrcode = ::RQRCode::QRCode.new(string.to_s)
23
+ # qrcode.as_png(size: 500, border_modules: 2, file: png_file_path)
24
+ # png_file_path
25
+ # end
26
+
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Fastci
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  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
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - watermelon
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.6
18
+ version: 0.3.2
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.6
25
+ version: 0.3.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: fastlane-plugin-versioning
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: 0.7.1
40
+ - !ruby/object:Gem::Dependency
41
+ name: fastlane-plugin-fir_cli
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 2.0.21
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 2.0.21
40
54
  email: watermelon_lp@163.com
41
55
  executables: []
42
56
  extensions: []
@@ -51,14 +65,16 @@ files:
51
65
  - lib/fastlane/plugin/fastci/actions/detect_unused_image_action.rb
52
66
  - lib/fastlane/plugin/fastci/actions/install_certificate_action.rb
53
67
  - lib/fastlane/plugin/fastci/actions/install_profile_action.rb
54
- - lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb
55
68
  - lib/fastlane/plugin/fastci/actions/package_action.rb
56
69
  - lib/fastlane/plugin/fastci/actions/update_build_number_action.rb
70
+ - lib/fastlane/plugin/fastci/actions/upload_fir_action.rb
57
71
  - lib/fastlane/plugin/fastci/actions/upload_pgy_action.rb
58
72
  - lib/fastlane/plugin/fastci/actions/upload_store_action.rb
59
73
  - lib/fastlane/plugin/fastci/helper/common_helper.rb
60
74
  - lib/fastlane/plugin/fastci/helper/constants.rb
75
+ - lib/fastlane/plugin/fastci/helper/dingding_helper.rb
61
76
  - lib/fastlane/plugin/fastci/helper/environment.rb
77
+ - lib/fastlane/plugin/fastci/helper/fir_helper.rb
62
78
  - lib/fastlane/plugin/fastci/version.rb
63
79
  - lib/fastlane/plugin/python/generate_duplicity_code_html.py
64
80
  - lib/fastlane/plugin/python/generate_lint_html.py
@@ -1,51 +0,0 @@
1
- require 'fastlane/action'
2
- include Fastlane::Helper
3
-
4
- module Fastlane
5
- module Actions
6
- # 钉钉通知
7
- class NotiDingdingAction < Action
8
- def self.run(params)
9
- UI.message("*************| 开始钉钉消息通知 |*************")
10
- notiText = params[:notiText] || ""
11
-
12
- curl = %Q{
13
- curl 'https://oapi.dingtalk.com/robot/send?access_token=#{Environment.dingdingToken}' \
14
- -H 'Content-Type:application/json' \
15
- -d '{
16
- "msgtype":"markdown",
17
- "markdown":{
18
- "title":"#{Environment.scheme} 打包通知",
19
- "text":"#{notiText}"
20
- }
21
- }'
22
- }
23
- system curl
24
- end
25
-
26
- def self.description
27
- "钉钉通知"
28
- end
29
-
30
- def self.available_options
31
- [
32
- FastlaneCore::ConfigItem.new(
33
- key: :notiText,
34
- description: "要发送的钉钉通知内容",
35
- optional: false, # 是否可选
36
- type: String
37
- ),
38
- ]
39
- end
40
-
41
- def self.is_supported?(platform)
42
- platform == :ios
43
- end
44
-
45
- def self.category
46
- :notifications
47
- end
48
-
49
- end
50
- end
51
- end