fastlane-plugin-kmm_pusher 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc0dc39bb6d7296db350e7e9c7e34ba124dfeeea36e447392524bd6ebab7c9ad
4
- data.tar.gz: 9cff20f4ad7cb9480541516c72704f2c97a986626565f3a25db2b8378e243809
3
+ metadata.gz: 3816a3ea6a265c787800b1ec290c75ef133ce61e389eb004b6e4729ac7e1eeb2
4
+ data.tar.gz: bef07d91946be46f47d268a3fb20fe88eb76d0d7592a1a89b6a80d4b36c7a7b7
5
5
  SHA512:
6
- metadata.gz: d6579a39529f30de6625e51bb5a0e1965f1722ca64c010c48e82bc85490666de10289e0d6783509dd4be2911242b25fe52c1b2119fa9c7339d36ef571a87145d
7
- data.tar.gz: 62ab3f6d33b9d4217b0f26aeeff5e0685a839980cf24d1adcf3168a317acee9b6bb1033a58a2b5d410bc7605fbd475801d057f2614da44ce25e33d30008ef385
6
+ metadata.gz: b795b45ed5b055e026150a131b01221025abfa0279c59f5f5fbee9754754060d74ce5f3f911393db0ab794fb684c65c6d9a690e06b0ce015ee9d7d5301b047a7
7
+ data.tar.gz: 4f7799616c7ea5f99711faf38e985cd2e371f4f444c1203adae445e3453ddc7bb3b4ed73b6f05a9e21f6e85a08bb80ba3041007d6a54c1387a0b2e947fbebc4c
data/README.md CHANGED
@@ -10,8 +10,48 @@ A Fastlane plugin to streamline the build, distribution, and notification proces
10
10
 
11
11
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-kmm_pusher)
12
12
 
13
+ ## Installation
14
+
15
+ 1. Include in gem file
16
+ ```
17
+ gem 'fastlane-plugin-kmm_pusher', '~> 1.0'
18
+ ```
19
+
20
+ 2. Install via Fastlane
21
+ ```
22
+ Gemfile
23
+ gem 'fastlane-plugin-kmm_pusher', '0.0.20'
24
+ gem 'rubyzip'
25
+ gem 'fastlane'
26
+
27
+ Fastfile
28
+ default_platform(:android)
29
+
30
+ platform :android do
31
+ desc "Generate Build"
32
+ lane :generateBuild do
33
+ kmm_pusher(
34
+ project_name: "Module Name",
35
+ service_type: "slack",
36
+ commit_message: "New Build Version",
37
+ slack_channel: "Channel Id",
38
+ slack_app_token: "Token",
39
+ is_xc_framework_enabled: true,
40
+ is_commit_enabled: true
41
+ )
42
+ end
43
+
44
+ end
45
+
46
+ ```
47
+
13
48
  Commands
14
49
  ```
15
50
  gem build fastlane-plugin-kmm_pusher.gemspec
16
51
  gem install ./fastlane-plugin-kmm_pusher-0.0.14.gem
52
+
53
+ Push Command
54
+ rake install
55
+ rake build
56
+ sudo gem push pkg/fastlane-plugin-kmm_pusher-1.0.0.gem
17
57
  ```
@@ -1,5 +1,8 @@
1
1
  require 'fastlane_core/ui/ui'
2
2
  require 'zip'
3
+ require 'net/http'
4
+ require 'uri'
5
+ require 'json'
3
6
 
4
7
  module Fastlane
5
8
  UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
@@ -26,6 +29,14 @@ module Fastlane
26
29
  raise PluginMissingParamsException, print_error_message("slack_app_token is required in configuration!") if slack_app_token.nil? || slack_app_token.empty?
27
30
  end
28
31
 
32
+ if service_type == "slack"
33
+ send_slack_message(
34
+ "Pusher Triggered new Build with Number (#{get_git_reference})",
35
+ slack_app_token,
36
+ slack_channel
37
+ )
38
+ end
39
+
29
40
  # Print Plugin Params Start
30
41
  print_log_message("KMM Pusher Started with Project #{project_name} and Service Type #{service_type}")
31
42
 
@@ -57,6 +68,36 @@ module Fastlane
57
68
 
58
69
  end
59
70
 
71
+ def self.send_slack_message(message, token, channel_id)
72
+ # Slack API endpoint for posting messages
73
+ uri = URI.parse("https://slack.com/api/chat.postMessage")
74
+
75
+ # Create the HTTP request
76
+ request = Net::HTTP::Post.new(uri)
77
+ request.content_type = "application/json; charset=utf-8"
78
+ request["Authorization"] = "Bearer #{token}"
79
+
80
+ # Prepare the request body
81
+ body = {
82
+ channel: channel_id,
83
+ text: message
84
+ }
85
+ request.body = body.to_json
86
+
87
+ # Send the request
88
+ response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
89
+ http.request(request)
90
+ end
91
+
92
+ # Parse the response
93
+ if response.is_a?(Net::HTTPSuccess)
94
+ puts "Message sent successfully!"
95
+ puts JSON.parse(response.body)
96
+ else
97
+ puts "Failed to send message: #{response.body}"
98
+ end
99
+ end
100
+
60
101
  def self.push_slack_build(slack_channel, project_name, is_xc_framework_enabled, token)
61
102
  if is_xc_framework_enabled
62
103
  upload_file_to_slack(
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module KmmPusher
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-kmm_pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yazan Tarifi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-09 00:00:00.000000000 Z
11
+ date: 2025-03-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: yazantarifi989@gmail.com