fastlane-plugin-ding_talk_notice 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c730e849481a67dd9c39aa61641f73a251769cca969662bbc1c9b5b237cc5cf9
4
+ data.tar.gz: 22b4e97266c952799653045f4807ca0269d1986159f45c9571426fbc5fdec0a8
5
+ SHA512:
6
+ metadata.gz: 1e33a3704ca4fb4984ecd5592b0cff69b60ee6317dc8d76b4367e4ce95644f640287dc9c1d4cbe2c761ab43790fa68fd339b47299cb917d4a76478983d83c90e
7
+ data.tar.gz: a3a8e8b54da9701eb2ecd83899f4c767de89a4f151378acf9ed273759c39fa2b85f1f6699a513cebc7b882219d4f0d23b9153c1425e32107b286f91e7adffbb1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 gaoxiang <gao497868860@163.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # ding_talk plugin
2
+
3
+ ## 改造[_fastlane-plugin-ding-talk_](https://github.com/Pircate/fastlane-plugin-ding-talk).新增了is_at_all、at_mobiles和at_user_ids功能
4
+
5
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ding_talk)
6
+
7
+ ## Getting Started
8
+
9
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ding_talk_notice`, add it to your project by running:
10
+
11
+ ```bash
12
+ Pluginfile
13
+ gem 'fastlane-plugin-ding_talk_notice', :git => 'https://github.com/zxc120301945/fastlane-plugin-ding-talk-notice.git'
14
+ 调用 bundle exec fastlane 执行 ding_talk_notice 加载所有插件(官方和私有)
15
+ 调用 fastlane 执行 ding_talk_notice 只能调用官方插件
16
+ ```
17
+
18
+ ## About ding_talk
19
+
20
+ Auto send the pgyer app qr code to the ding talk.
21
+
22
+ ## Example
23
+
24
+ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
25
+
26
+ ```ruby
27
+ ding_talk_notice(
28
+ api_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # 蒲公英用户api_key
29
+ app_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # 蒲公英应用app_key
30
+ access_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # 钉钉机器人access_token
31
+ is_at_all: true, # 是否@所有人
32
+ at_mobiles: ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"], # @手机号
33
+ at_user_ids: ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"],# @用户ID
34
+ markdown_desc: "### App安装二维码") # 二维码描述(markdown格式)
35
+ ```
36
+
37
+ ## Run tests for this plugin
38
+
39
+ To run both the tests, and code style validation, run
40
+
41
+ ```
42
+ rake
43
+ ```
44
+
45
+ To automatically fix many of the styling issues, use
46
+ ```
47
+ rubocop -a
48
+ ```
49
+
50
+ ## Issues and Feedback
51
+
52
+ For any other issues and feedback about this plugin, please submit it to this repository.
53
+
54
+ ## Troubleshooting
55
+
56
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
57
+
58
+ ## Using _fastlane_ Plugins
59
+
60
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
61
+
62
+ ## About _fastlane_
63
+
64
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,137 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/ding_talk_helper'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class DingTalkNoticeAction < Action
7
+ def self.run(params)
8
+
9
+ UI.message("The ding_talk plugin is working!")
10
+
11
+ api_key = params[:api_key]
12
+ app_key = params[:app_key]
13
+ access_token = params[:access_token]
14
+ markdown_desc = params[:markdown_desc]
15
+ is_at_all = params[:is_at_all]
16
+ at_mobiles = params[:at_mobiles]
17
+ at_user_ids = params[:at_user_ids]
18
+
19
+ params = {
20
+ '_api_key' => api_key,
21
+ 'appKey' => app_key
22
+ }
23
+
24
+ UI.message("Start get app information from pgyer...")
25
+
26
+ # 获取App详细信息
27
+ response = Net::HTTP.post_form URI('https://www.pgyer.com/apiv2/app/view'), params
28
+ result = JSON.parse(response.body)
29
+
30
+ status_code = result["code"]
31
+ status_message = result["message"]
32
+
33
+ if status_code != 0
34
+ UI.error('pgyer error message: ' + status_message)
35
+ return
36
+ end
37
+
38
+ UI.success("Successfully get app information!")
39
+ # 应用二维码地址
40
+ buildQRCodeURL = result["data"]["buildQRCodeURL"]
41
+
42
+ # 将应用信息发送到钉钉
43
+ uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
44
+ https = Net::HTTP.new(uri.host, uri.port)
45
+ https.use_ssl = true
46
+ req = Net::HTTP::Post.new(uri.request_uri)
47
+ req.body = {
48
+ 'msgtype' => 'markdown',
49
+ 'markdown' => {
50
+ 'title': 'A new app update from fastlane.',
51
+ 'text': "#{markdown_desc} <br> ![](#{buildQRCodeURL})"
52
+ },
53
+ 'at': {
54
+ 'atMobiles': at_mobiles,
55
+ 'atUserIds': at_user_ids,
56
+ 'isAtAll': is_at_all
57
+ }
58
+ }.to_json
59
+ req.content_type = 'application/json'
60
+ resp = https.request(req)
61
+ json = JSON.parse(resp.body)
62
+
63
+ if json["errcode"] != 0
64
+ UI.error('ding talk error message: ' + json["errmsg"])
65
+ return
66
+ end
67
+ UI.success("Successfully send qr code to ding talk!")
68
+
69
+ end
70
+
71
+ def self.description
72
+ "Send the packaging information to the ding talk."
73
+ end
74
+
75
+ def self.authors
76
+ ["gaoxiang"]
77
+ end
78
+
79
+ def self.return_value
80
+ # If your method provides a return value, you can describe here what it does
81
+ end
82
+
83
+ def self.details
84
+ # Optional:
85
+ "Send the packaging information to the ding talk, and provide the qr code for others to install."
86
+ end
87
+
88
+ def self.available_options
89
+ [
90
+ FastlaneCore::ConfigItem.new(key: :api_key,
91
+ env_name: "PGYER_API_KEY",
92
+ description: "api_key in your pgyer account",
93
+ optional: false,
94
+ type: String),
95
+ FastlaneCore::ConfigItem.new(key: :app_key,
96
+ env_name: "PGYER_APP_KEY",
97
+ description: "app_key for your app",
98
+ optional: false,
99
+ type: String),
100
+ FastlaneCore::ConfigItem.new(key: :access_token,
101
+ env_name: "DING_TALK_ROBOT_ACCESS_TOKEN",
102
+ description: "access_token for your ding talk robot",
103
+ optional: false,
104
+ type: String),
105
+ FastlaneCore::ConfigItem.new(key: :markdown_desc,
106
+ env_name: "DING_TALK_APP_DESCRIPTION",
107
+ description: "description for your app",
108
+ optional: true,
109
+ type: String),
110
+ FastlaneCore::ConfigItem.new(key: :is_at_all,
111
+ env_name: "DING_TALK_APP_@ALL",
112
+ description: "is @all for your app",
113
+ optional: true,
114
+ type: Boolean),
115
+ FastlaneCore::ConfigItem.new(key: :at_mobiles,
116
+ env_name: "DING_TALK_APP_ACCOUNT_PHONE_@MENTION",
117
+ description: "@account for your app by phone",
118
+ optional: true,
119
+ type: Array),
120
+ FastlaneCore::ConfigItem.new(key: :at_user_ids,
121
+ env_name: "DING_TALK_APP_ACCOUNT_USER_ID_@MENTION",
122
+ description: "@account for your app by user ID",
123
+ optional: true,
124
+ type: Array)
125
+ ]
126
+ end
127
+
128
+ def self.is_supported?(platform)
129
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
130
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
131
+ #
132
+ [:ios, :mac, :android].include?(platform)
133
+ true
134
+ end
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
+
6
+ module Helper
7
+ class DingTalkHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::DingTalkHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the ding_talk plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module DingTalk
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/ding_talk/version'
2
+
3
+ module Fastlane
4
+ module DingTalkNotice
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::DingTalkNotice.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,170 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-ding_talk_notice
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - WZY
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-09-25 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: pry
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: bundler
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rspec
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rspec_junit_formatter
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rake
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: rubocop
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '='
87
+ - !ruby/object:Gem::Version
88
+ version: 0.49.1
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '='
94
+ - !ruby/object:Gem::Version
95
+ version: 0.49.1
96
+ - !ruby/object:Gem::Dependency
97
+ name: rubocop-require_tools
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: simplecov
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: fastlane
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 2.89.0
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: 2.89.0
138
+ email: wzyhelloworld@163.com
139
+ executables: []
140
+ extensions: []
141
+ extra_rdoc_files: []
142
+ files:
143
+ - LICENSE
144
+ - README.md
145
+ - lib/fastlane/plugin/ding_talk_notice.rb
146
+ - lib/fastlane/plugin/ding_talk_notice/actions/ding_talk_notice_action.rb
147
+ - lib/fastlane/plugin/ding_talk_notice/helper/ding_talk_helper.rb
148
+ - lib/fastlane/plugin/ding_talk_notice/version.rb
149
+ homepage: https://github.com/zxc120301945/fastlane-plugin-ding-talk-notice
150
+ licenses:
151
+ - MIT
152
+ metadata: {}
153
+ rdoc_options: []
154
+ require_paths:
155
+ - lib
156
+ required_ruby_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ required_rubygems_version: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ requirements: []
167
+ rubygems_version: 3.6.2
168
+ specification_version: 4
169
+ summary: Auto send the pgyer app qr code to the ding talk.
170
+ test_files: []