fast_pack 0.3.1 → 0.3.2

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: 961562f8d95682a46c2f9ad8b8fb086898fd854dc0f54b4a485b12a60c082d0f
4
- data.tar.gz: e1047b517bef568796d2d0b231d2e1d03efccdbacfef316cdf40b320ee92d60b
3
+ metadata.gz: 6f1d465cf6282eb85d5c89f7bd38fe35a312a645b80db13f52e4e0c8082d0f90
4
+ data.tar.gz: 8ec99d3632959d380921ce009ac87fdcb3e39bc18a8f553c9b98488fdefb52ed
5
5
  SHA512:
6
- metadata.gz: 5501a5de9d3f5ba309a3f11d5230f573e9546b59d85094c9ec0bbe95e41c15c14dfae7854e8e96710823ba401d5287e3601f229f91e78ced68ac001b604af873
7
- data.tar.gz: c998a9d1a4299be0ea0d7ede83873a5cc8449825608c838a58be26ca84aeae708f01b1b0d39fc739cc34bd9811ca07dfd9796ea0bc85d97c312fd34443c56865
6
+ metadata.gz: 053e7d08cc9af8814d8eed3f42848c65cc0a9fcee229263c85b2b834bca65f73197778c4eebecce608d987015b2bb62c38ef32b2b3cab3d7bf4aefe688cbbc5c
7
+ data.tar.gz: '095654f7f64e94dcdda62be7de6f0c0604bbb2dba360806a764b16cd3ad0c17dce2c6e32601e270cbc3812fa67be4f3cd1c896b274b3537c9b62b0f95cc99416'
@@ -41,6 +41,8 @@ module Pod
41
41
  uki_config.dsym = @dsym
42
42
  uki_config.release = @release
43
43
  uki_config.no_build = @no_build
44
+ uki_config.build_time = Time.now.to_i
45
+ uki_config.upload_time = 0
44
46
 
45
47
  end
46
48
 
@@ -1,5 +1,10 @@
1
1
  require 'cocoapods-uki-packager/uki_config.rb'
2
2
  require 'cocoapods'
3
+ require 'net/https'
4
+ require 'uri'
5
+ require 'json'
6
+ require 'socket'
7
+
3
8
 
4
9
  class Shell_Command
5
10
 
@@ -34,7 +39,6 @@ class Shell_Command
34
39
  # 需安装Fir 不太友好
35
40
  # 安装命令 sudo gem install fir-cli
36
41
  def export
37
-
38
42
  unless uki_config.build_exe_path
39
43
  puts "未生成目标文件目录"
40
44
  return
@@ -55,9 +59,6 @@ class Shell_Command
55
59
 
56
60
  fir_log="fir auto release"
57
61
 
58
- #计时
59
- SECONDS=0
60
-
61
62
  APP=$(find $product_path -type d | grep ".app$" | head -n 1)
62
63
  APP=${APP%.*}
63
64
 
@@ -70,11 +71,13 @@ class Shell_Command
70
71
  zip -r -q "$APP.ipa" ./Payload;
71
72
  rm -rf ./Payload;
72
73
 
73
- echo "===生成ipa开始上传 time: ${SECONDS}s==="
74
+ # echo "===生成ipa开始上传 ==="
74
75
 
76
+ #计时
77
+ SECONDS=0
75
78
 
76
79
  fir_token="207c7aad886da8009a73486d5154a7a6"
77
- fir publish "$APP.ipa" -T $fir_token -c "$fir_log" -Q -q
80
+ fir publish "$APP.ipa" -T $fir_token -c "$fir_log" -R
78
81
 
79
82
  size=$(ls -l $APP.ipa | awk '{ print $5 }')
80
83
 
@@ -83,9 +86,11 @@ class Shell_Command
83
86
  echo -e "===size=${sizeM}m==="
84
87
 
85
88
  notification="Did uploaded to fir caost time:${SECONDS}s"
86
- echo "===$notification==="
89
+ echo "===$notification===%"
87
90
 
88
91
  osascript -e 'display notification "size:'$sizeM'm\ncaost:'$SECONDS's" with title "Uploaded to fir!" sound name "default" '
92
+
93
+ echo "upload_time=${SECONDS}"
89
94
  }
90
95
 
91
96
  puts("恭喜打包完成")
@@ -93,6 +98,118 @@ class Shell_Command
93
98
  if uki_config.verbose?
94
99
  puts(log)
95
100
  end
101
+
102
+ url = log[/http:.*$/]
103
+ array = log.split('%')
104
+ uki_config.upload_time = array.last.split("=").last.to_i
105
+ uki_config.build_time = Time.now.to_i - uki_config.build_time - uki_config.upload_time
106
+ uki_config.fir_url = url
107
+
108
+ send_notifi
109
+ end
110
+
111
+ def send_notifi
112
+
113
+ branch = %x{
114
+ if branch=$(git symbolic-ref --short -q HEAD)
115
+ then
116
+ echo $branch
117
+ else
118
+ echo "未知分支"
119
+ fi
120
+ }
121
+
122
+ hostname = Socket.gethostname
123
+ project_name = uki_config.project_sea ? "iOS海外极速打包已完成": "iOS国内极速打包已完成"
124
+ project_env = uki_config.release ? "Release": "Debug"
125
+ project_dsym = uki_config.dsym ? "已上传": "无符号表"
126
+
127
+ message = {
128
+ "msg_type": "interactive",
129
+ "card": {
130
+ "elements": [
131
+ {
132
+ "fields": [
133
+ {
134
+ "is_short": true,
135
+ "text": {
136
+ "content": "**打包分支**\n#{branch}",
137
+ "tag": "lark_md"
138
+ }
139
+ },
140
+ {
141
+ "is_short": true,
142
+ "text": {
143
+ "content": "**打包环境**\n#{project_env}",
144
+ "tag": "lark_md"
145
+ }
146
+ },
147
+ {
148
+ "is_short": true,
149
+ "text": {
150
+ "content": "**打包机器**\n#{hostname}",
151
+ "tag": "lark_md"
152
+ }
153
+ },
154
+ {
155
+ "is_short": true,
156
+ "text": {
157
+ "content": "**dsym**\n#{project_dsym}",
158
+ "tag": "lark_md"
159
+ }
160
+ },
161
+ {
162
+ "is_short": true,
163
+ "text": {
164
+ "content": "**编译耗时**\n#{uki_config.build_time}s",
165
+ "tag": "lark_md"
166
+ }
167
+ },
168
+ {
169
+ "is_short": true,
170
+ "text": {
171
+ "content": "**上传耗时**\n#{uki_config.upload_time}s",
172
+ "tag": "lark_md"
173
+ }
174
+ }
175
+ ],
176
+ "tag": "div"
177
+ },
178
+ {
179
+ "tag": "hr"
180
+ },
181
+ {
182
+ "tag": "action",
183
+ "actions": [
184
+ {
185
+ "tag": "button",
186
+ "text": {
187
+ "tag": "lark_md",
188
+ "content": "点击下载"
189
+ },
190
+ "type": "default",
191
+ "url": "#{uki_config.fir_url}"
192
+ }
193
+ ]
194
+ }
195
+ ],
196
+ "header": {
197
+ "template": "green",
198
+ "title": {
199
+ "content": "#{project_name}",
200
+ "tag": "plain_text"
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ log = %x{
207
+ curl -X POST -H "Content-Type: application/json" -d '#{message.to_json}' "https://open.feishu.cn/open-apis/bot/v2/hook/68c47d38-fc65-4cc5-a386-885a1fbff11b"
208
+ }
209
+
210
+ if uki_config.verbose?
211
+ puts(log)
212
+ end
96
213
  end
97
214
 
98
215
  def self.instance
@@ -17,8 +17,14 @@ class Uki_config
17
17
  attr_accessor :release
18
18
  # 是否产生dsym
19
19
  attr_accessor :dsym
20
- # 自动workspace名称
21
- attr_accessor :workspace_name
20
+ # 自动workspace名称
21
+ attr_accessor :workspace_name
22
+ # 编译耗时
23
+ attr_accessor :build_time
24
+ # 上传耗时
25
+ attr_accessor :upload_time
26
+ # 上传Url
27
+ attr_accessor :fir_url
22
28
 
23
29
  alias_method :verbose?, :verbose
24
30
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Packager
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
data/lib/packager.rb CHANGED
@@ -0,0 +1,12 @@
1
+
2
+
3
+
4
+
5
+ {"msg_type":"interactive","card":{"elements":[{"fields":[{"is_short":true,"text":{"content":"**打包分支**\nRelease","tag":"lark_md"}},{"is_short":true,"text":{"content":"**打包环境**\nDebug","tag":"lark_md"}},{"is_short":true,"text":{"content":"**打包机器**\nxx的Mac","tag":"lark_md"}},{"is_short":true,"text":{"content":"**dsym**\n无","tag":"lark_md"}},{"is_short":true,"text":{"content":"**编译耗时**\n12s","tag":"lark_md"}},{"is_short":true,"text":{"content":"**上传耗时**\n60s","tag":"lark_md"}}],"tag":"div"},{"tag":"hr"},{"tag":"action","actions":[{"tag":"button","text":{"tag":"lark_md","content":"点击下载"},"type":"default","url":"https://www.baidu.com/"}]}],"header":{"template":"green","title":{"content":"打包已完成","tag":"plain_text"}}}}
6
+ {:msg_type=>"interactive", :card=>{:elements=>[{:fields=>[{:is_short=>true, :text=>{:content=>"**打包分支**\nRelease", :tag=>"lark_md"}}, {:is_short=>true, :text=>{:content=>"**打包环境**\nDebug", :tag=>"lark_md"}}, {:is_short=>true, :text=>{:content=>"**打包机器**\nxx的Mac", :tag=>"lark_md"}}, {:is_short=>true, :text=>{:content=>"**dsym**\n无", :tag=>"lark_md"}}, {:is_short=>true, :text=>{:content=>"**编译耗时**\n12s", :tag=>"lark_md"}}, {:is_short=>true, :text=>{:content=>"**上传耗时**\n60s", :tag=>"lark_md"}}], :tag=>"div"}, {:tag=>"hr"}, {:tag=>"action", :actions=>[{:tag=>"button", :text=>{:tag=>"lark_md", :content=>"点击下载"}, :type=>"default", :url=>"https://www.baidu.com/"}]}], :header=>{:template=>"green", :title=>{:content=>"打包已完成", :tag=>"plain_text"}}}}
7
+
8
+
9
+
10
+ curl -X POST -H "Content-Type: application/json" \
11
+ -d '{"msg_type":"interactive","card":{"elements":[{"fields":[{"is_short":true,"text":{"content":"**打包分支**\nRelease","tag":"lark_md"}},{"is_short":true,"text":{"content":"**打包环境**\nDebug","tag":"lark_md"}},{"is_short":true,"text":{"content":"**打包机器**\nxx的Mac","tag":"lark_md"}},{"is_short":true,"text":{"content":"**dsym**\n无","tag":"lark_md"}},{"is_short":true,"text":{"content":"**编译耗时**\n12s","tag":"lark_md"}},{"is_short":true,"text":{"content":"**上传耗时**\n60s","tag":"lark_md"}}],"tag":"div"},{"tag":"hr"},{"tag":"action","actions":[{"tag":"button","text":{"tag":"lark_md","content":"点击下载"},"type":"default","url":"https://www.baidu.com/"}]}],"header":{"template":"green","title":{"content":"打包已完成","tag":"plain_text"}}}}' \
12
+ https://open.feishu.cn/open-apis/bot/v2/hook/be340a71-08b3-4541-8cc6-2f733dd6f257
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 耿磊
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-31 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods