fastlane-plugin-dingtalk_notice_push 0.0.1
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/dingtalk_notice_push/actions/dingtalk_notice_push_action.rb +135 -0
- data/lib/fastlane/plugin/dingtalk_notice_push/helper/dingtalk_notice_push_helper.rb +16 -0
- data/lib/fastlane/plugin/dingtalk_notice_push/version.rb +5 -0
- data/lib/fastlane/plugin/dingtalk_notice_push.rb +16 -0
- metadata +170 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e8ac7a844e6d22849c5c159beaeaeceadc0e53b5fb72a767e4e43e46e874cc42
|
|
4
|
+
data.tar.gz: 122dcf8d1a99f63695e814e76c88eb47ff710e96fcd2a3bd11f6f0baad7518cc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 4bc3dfcb0f2975e17f7f9ee9d6dc144caabbb91bd51da3c43893fe0db17d32efeac6dda7eb0a9f456ffb990a48d69fe5d953eda49f18fde13489148dd4a9d2ea
|
|
7
|
+
data.tar.gz: c8c20f08adc7957747163e203858129422762d6ac0d377ea31f00c11be5da51640dcd97e4c59489c3ad4a2949dac09d1347aaac706df90d9f2b02a11b1f43f24
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 WZY <wzyhelloworld@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,52 @@
|
|
|
1
|
+
# dingtalk_notice_push plugin
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-dingtalk_notice_push)
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-dingtalk_notice_push`, add it to your project by running:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
fastlane add_plugin dingtalk_notice_push
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## About dingtalk_notice_push
|
|
14
|
+
|
|
15
|
+
dingtalk_notice_push
|
|
16
|
+
|
|
17
|
+
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
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`.
|
|
22
|
+
|
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
|
24
|
+
|
|
25
|
+
## Run tests for this plugin
|
|
26
|
+
|
|
27
|
+
To run both the tests, and code style validation, run
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
rake
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To automatically fix many of the styling issues, use
|
|
34
|
+
```
|
|
35
|
+
rubocop -a
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Issues and Feedback
|
|
39
|
+
|
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
|
41
|
+
|
|
42
|
+
## Troubleshooting
|
|
43
|
+
|
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
|
45
|
+
|
|
46
|
+
## Using _fastlane_ Plugins
|
|
47
|
+
|
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
|
49
|
+
|
|
50
|
+
## About _fastlane_
|
|
51
|
+
|
|
52
|
+
_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,135 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/dingtalk_notice_push_helper'
|
|
3
|
+
|
|
4
|
+
module Fastlane
|
|
5
|
+
module Actions
|
|
6
|
+
class DingtalkNoticePushAction < Action
|
|
7
|
+
def self.run(params)
|
|
8
|
+
UI.message("The dingtalk_notice_push plugin is working!")
|
|
9
|
+
|
|
10
|
+
api_key = params[:api_key]
|
|
11
|
+
app_key = params[:app_key]
|
|
12
|
+
access_token = params[:access_token]
|
|
13
|
+
markdown_desc = params[:markdown_desc]
|
|
14
|
+
is_at_all = params[:is_at_all]
|
|
15
|
+
at_mobiles = params[:at_mobiles]
|
|
16
|
+
at_user_ids = params[:at_user_ids]
|
|
17
|
+
|
|
18
|
+
params = {
|
|
19
|
+
'_api_key' => api_key,
|
|
20
|
+
'appKey' => app_key
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
UI.message("Start get app information from pgyer...")
|
|
24
|
+
|
|
25
|
+
# 获取App详细信息
|
|
26
|
+
response = Net::HTTP.post_form URI('https://www.pgyer.com/apiv2/app/view'), params
|
|
27
|
+
result = JSON.parse(response.body)
|
|
28
|
+
|
|
29
|
+
status_code = result["code"]
|
|
30
|
+
status_message = result["message"]
|
|
31
|
+
|
|
32
|
+
if status_code != 0
|
|
33
|
+
UI.error('pgyer error message: ' + status_message)
|
|
34
|
+
return
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
UI.success("Successfully get app information!")
|
|
38
|
+
# 应用二维码地址
|
|
39
|
+
buildQRCodeURL = result["data"]["buildQRCodeURL"]
|
|
40
|
+
|
|
41
|
+
# 将应用信息发送到钉钉
|
|
42
|
+
uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
|
|
43
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
|
44
|
+
https.use_ssl = true
|
|
45
|
+
req = Net::HTTP::Post.new(uri.request_uri)
|
|
46
|
+
req.body = {
|
|
47
|
+
'msgtype' => 'markdown',
|
|
48
|
+
'markdown' => {
|
|
49
|
+
'title': 'A new app update from fastlane.',
|
|
50
|
+
'text': "#{markdown_desc} <br> "
|
|
51
|
+
},
|
|
52
|
+
'at': {
|
|
53
|
+
'atMobiles': at_mobiles,
|
|
54
|
+
'atUserIds': at_user_ids,
|
|
55
|
+
'isAtAll': is_at_all
|
|
56
|
+
}
|
|
57
|
+
}.to_json
|
|
58
|
+
req.content_type = 'application/json'
|
|
59
|
+
resp = https.request(req)
|
|
60
|
+
json = JSON.parse(resp.body)
|
|
61
|
+
|
|
62
|
+
if json["errcode"] != 0
|
|
63
|
+
UI.error('ding talk error message: ' + json["errmsg"])
|
|
64
|
+
return
|
|
65
|
+
end
|
|
66
|
+
UI.success("Successfully send qr code to ding talk!")
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.description
|
|
70
|
+
"dingtalk_notice_push"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def self.authors
|
|
74
|
+
["WZY"]
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def self.return_value
|
|
78
|
+
# If your method provides a return value, you can describe here what it does
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.details
|
|
82
|
+
# Optional:
|
|
83
|
+
"通过 Fastlane 将构建和发布结果发送到钉钉群通知。"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def self.available_options
|
|
87
|
+
[
|
|
88
|
+
FastlaneCore::ConfigItem.new(key: :api_key,
|
|
89
|
+
env_name: "PGYER_API_KEY",
|
|
90
|
+
description: "api_key in your pgyer account",
|
|
91
|
+
optional: false,
|
|
92
|
+
type: String),
|
|
93
|
+
FastlaneCore::ConfigItem.new(key: :app_key,
|
|
94
|
+
env_name: "PGYER_APP_KEY",
|
|
95
|
+
description: "app_key for your app",
|
|
96
|
+
optional: false,
|
|
97
|
+
type: String),
|
|
98
|
+
FastlaneCore::ConfigItem.new(key: :access_token,
|
|
99
|
+
env_name: "DING_TALK_ROBOT_ACCESS_TOKEN",
|
|
100
|
+
description: "access_token for your ding talk robot",
|
|
101
|
+
optional: false,
|
|
102
|
+
type: String),
|
|
103
|
+
FastlaneCore::ConfigItem.new(key: :markdown_desc,
|
|
104
|
+
env_name: "DING_TALK_APP_DESCRIPTION",
|
|
105
|
+
description: "description for your app",
|
|
106
|
+
optional: true,
|
|
107
|
+
type: String),
|
|
108
|
+
FastlaneCore::ConfigItem.new(key: :is_at_all,
|
|
109
|
+
env_name: "DING_TALK_APP_@ALL",
|
|
110
|
+
description: "is @all for your app",
|
|
111
|
+
optional: true,
|
|
112
|
+
type: Boolean),
|
|
113
|
+
FastlaneCore::ConfigItem.new(key: :at_mobiles,
|
|
114
|
+
env_name: "DING_TALK_APP_ACCOUNT_PHONE_@MENTION",
|
|
115
|
+
description: "@account for your app by phone",
|
|
116
|
+
optional: true,
|
|
117
|
+
type: Array),
|
|
118
|
+
FastlaneCore::ConfigItem.new(key: :at_user_ids,
|
|
119
|
+
env_name: "DING_TALK_APP_ACCOUNT_USER_ID_@MENTION",
|
|
120
|
+
description: "@account for your app by user ID",
|
|
121
|
+
optional: true,
|
|
122
|
+
type: Array)
|
|
123
|
+
]
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def self.is_supported?(platform)
|
|
127
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
|
128
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
|
129
|
+
#
|
|
130
|
+
[:ios, :mac, :android].include?(platform)
|
|
131
|
+
true
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
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 DingtalkNoticePushHelper
|
|
8
|
+
# class methods that you define here become available in your action
|
|
9
|
+
# as `Helper::DingtalkNoticePushHelper.your_method`
|
|
10
|
+
#
|
|
11
|
+
def self.show_message
|
|
12
|
+
UI.message("Hello from the dingtalk_notice_push plugin helper!")
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'fastlane/plugin/dingtalk_notice_push/version'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module DingtalkNoticePush
|
|
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::DingtalkNoticePush.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-dingtalk_notice_push
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- WZY
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2025-09-26 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/dingtalk_notice_push.rb
|
|
146
|
+
- lib/fastlane/plugin/dingtalk_notice_push/actions/dingtalk_notice_push_action.rb
|
|
147
|
+
- lib/fastlane/plugin/dingtalk_notice_push/helper/dingtalk_notice_push_helper.rb
|
|
148
|
+
- lib/fastlane/plugin/dingtalk_notice_push/version.rb
|
|
149
|
+
licenses:
|
|
150
|
+
- MIT
|
|
151
|
+
metadata:
|
|
152
|
+
rubygems_mfa_required: 'true'
|
|
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: '2.6'
|
|
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: dingtalk_notice_push
|
|
170
|
+
test_files: []
|