fast_pack 0.3.0 → 0.3.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e61f1caa8b1813df1588ded6692135f24b6a075e5efb0195010ea8141adafc9d
|
4
|
+
data.tar.gz: 5ef5980b8b344555d9cc568a9e82e30fd6e10a82d9ac3309c33210465a645742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25301cc42ce4ff9814190f05e0a2d8cc9bb650e9e8b079b95d0e7aa25b4fd000bc5c2b972d78b60f950d4607c8e3bf68fbf74e3d39830241ee9ddb60e598f8af
|
7
|
+
data.tar.gz: 801f9a88e127489a647dc5149454344ec2a057e832b7145113e146b650defc0ffed8ee4e6147ba90cec2358b3d081c97ce221b76bc8871dc9db62db10902cca9
|
@@ -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开始上传
|
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" -
|
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/d150c5fa-7522-448a-9424-60f40c001720"
|
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
|
-
|
21
|
-
|
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
|
|
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.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 耿磊
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.0.14
|
47
|
-
description:
|
47
|
+
description: 支持国内海外一键快速出包
|
48
48
|
email:
|
49
49
|
- glworkfine@gmail.com
|
50
50
|
executables:
|
@@ -81,5 +81,5 @@ requirements: []
|
|
81
81
|
rubygems_version: 3.0.9
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
|
-
summary:
|
84
|
+
summary: TT-Uki快速打包工具
|
85
85
|
test_files: []
|