fastlane-plugin-pgyer_jvtd 0.1.0 → 0.1.1

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: 73304d741a91ccb8ee5752f369ec80cef862375b75cef4d357f0df6d4d677e50
4
- data.tar.gz: b91168a4ebe765fff06261f0d3bedad0788f0a2526299cbc8d7a55f9b258424f
3
+ metadata.gz: '05439c9337f5353db8893f1b731f362254c6a93932890b704d3c47d397625642'
4
+ data.tar.gz: 6d746780cda1746e05b286e9749cf72535f997010a4f6537d13b7e229c53c7a7
5
5
  SHA512:
6
- metadata.gz: 0fe5c23c26212f9dee6b93f2e8acedcf6b46af21a4b2f2f2bf23279b388f58abd9ee91f325b0d1f4bb4081de4973c5cdbd5c0ce43bd69a93da4bb117f403baf7
7
- data.tar.gz: 8bf0db151c7efc32597404737cb58e759653b3d7dad3fee4be50e9656c47b6079d4c11aa7284ee11a33000f927d54c2d0daf20387b317cbb56ca763eaaafaba1
6
+ metadata.gz: 5d1080f6d06142bed4547cadb2eaa09f077ee18bf7f311cacb0bdc845d1cf844e6f3808185f634356eaf0ae2fe36c866d89838d3326429376be2960ccb260a6a
7
+ data.tar.gz: 97cea366c93a1a748f08a91a5c3df7d1ce8e7f76c7bdd85493284d68710c0ff8aa9bd452fb7b7f2e0e42ce0c5dcb86f5c4084823f94bd6220d66afd7d6489c90
@@ -10,6 +10,12 @@ module Fastlane
10
10
  api_host = "http://qiniu-storage.pgyer.com/apiv1/app/upload"
11
11
  api_key = params[:api_key]
12
12
  user_key = params[:user_key]
13
+ access_token = params[:dingtalk_access_token]
14
+ is_at_all = params[:is_at_all]
15
+
16
+ if is_at_all.nil?
17
+ is_at_all = "0"
18
+ end
13
19
 
14
20
  build_file = [
15
21
  params[:ipa],
@@ -77,6 +83,46 @@ module Fastlane
77
83
  end
78
84
 
79
85
  UI.success "Upload success. Visit this URL to see: https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
86
+
87
+
88
+ # 应用类型
89
+ appType = "Android";
90
+ if info['data']['appType'] == 1
91
+ appType = "iOS"
92
+ end
93
+
94
+ # 应用名称
95
+ appName = info['data']['appName']
96
+ # 应用版本信息
97
+ appVersion = info['data']['appVersion']
98
+ # 应用蒲公英版本
99
+ appBuildVersion = info['data']['appBuildVersion']
100
+ # 图标
101
+ appIcon = "https://appicon.pgyer.com/image/view/app_icons/#{info['data']['appIcon']}"
102
+ # 地址
103
+ appUrl = "https://www.pgyer.com/#{info['data']['appShortcutUrl']"
104
+
105
+ unless access_token.nil?
106
+ DingBot.endpoint = 'https://oapi.dingtalk.com/robot/send'
107
+ DingBot.access_token = access_token
108
+
109
+ message = DingBot::Message::Link.new(
110
+ "#{appType} App发布",
111
+ "请下载最新版本#{appVersion}(#{appBuildVersion})",
112
+ appUrl,
113
+ appIcon
114
+ )
115
+ DingBot.send_msg(message)
116
+
117
+ message = DingBot::Message::Text.new(
118
+ "#{appType} App最新版本已发布",
119
+ [],
120
+ is_at_all == "1"
121
+ )
122
+ DingBot.send_msg(message)
123
+ UI.success "Message send success."
124
+ end
125
+
80
126
  end
81
127
 
82
128
  def self.description
@@ -84,7 +130,7 @@ module Fastlane
84
130
  end
85
131
 
86
132
  def self.authors
87
- ["rexshi"]
133
+ ["chenlei"]
88
134
  end
89
135
 
90
136
  def self.return_value
@@ -151,7 +197,17 @@ module Fastlane
151
197
  env_name: "PGYER_CHANNEL",
152
198
  description: "Use channel short link. Please set as a string",
153
199
  optional: true,
154
- type: String)
200
+ type: String),
201
+ FastlaneCore::ConfigItem.new(key: :dingtalk_access_token,
202
+ env_name: "DINGTALK_ACCESS_TOKEN",
203
+ description: "Set up webhook and push update messages. Please set as a string",
204
+ optional: true,
205
+ type: String),
206
+ FastlaneCore::ConfigItem.new(key: :is_at_all,
207
+ env_name: "DINGTALK_IS_AT_ALL",
208
+ description: "set is at all for dingtalk (0=not_all, 1=all). Please set as a string",
209
+ optional: true,
210
+ type: String)
155
211
  ]
156
212
  end
157
213
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module PgyerJvtd
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-pgyer_jvtd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 陈磊的MacBook Pro