Class: Fastlane::Actions::DiscordAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::DiscordAction
- Defined in:
- lib/fastlane/plugin/discord/actions/discord_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .itunes_notification(params) ⇒ Object
- .play_notification(params) ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
50 51 52 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 50 def self. ["Matheus Gambati"] end |
.available_options ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 63 def self. [ FastlaneCore::ConfigItem.new(key: :url, env_name: "DISCORD_URL", description: "Discord Webhook URL", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :build_number, env_name: "DISCORD_BUILD_NUMBER", description: "New build number", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :version, env_name: "DISCORD_VERSION", description: "Version of the build", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :app_name, env_name: "DISCORD_APP_NAME", description: "Name of the app", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :store, env_name: "DISCORD_STORE", description: "Which app store the app has deployed (ios or android), default is android.", optional: true, type: String) ] end |
.description ⇒ Object
46 47 48 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 46 def self.description "Discord integration with Fastlane." end |
.details ⇒ Object
58 59 60 61 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 58 def self.details # Optional: "" end |
.is_supported?(platform) ⇒ Boolean
93 94 95 96 97 98 99 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 93 def self.is_supported?(platform) # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform # # [:ios, :mac, :android].include?(platform) true end |
.itunes_notification(params) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 18 def self.itunes_notification(params) client = Discordrb::Webhooks::Client.new(url: params[:url]) client.execute do |builder| builder. do || .title = params[:app_name] .colour = 0x3c9b00 .url = "https://itunesconnect.apple.com" .description = "New build uploaded to iTunes Connect with number **#{params[:build_number]}** and version **#{params[:version]}**. " . = Discordrb::Webhooks::EmbedAuthor.new(name: "iTunes Connect", url: "https://itunesconnect.apple.com", icon_url: "https://i.imgur.com/68CyCSp.png") . = Time.now end end end |
.play_notification(params) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 32 def self.play_notification(params) client = Discordrb::Webhooks::Client.new(url: params[:url]) client.execute do |builder| builder. do || .title = params[:app_name] .colour = 0x3c9b00 .url = "https://play.google.com/apps/publish" .description = "New build uploaded to Google Play with number **#{params[:build_number]}** and version **#{params[:version]}**. " . = Discordrb::Webhooks::EmbedAuthor.new(name: "Google Play", url: "https://play.google.com/apps/publish", icon_url: "https://i.imgur.com/yD82bnG.png") . = Time.now end end end |
.return_value ⇒ Object
54 55 56 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 54 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/fastlane/plugin/discord/actions/discord_action.rb', line 8 def self.run(params) UI.("Notifying Discord") if params[:store] == 'ios' return self.itunes_notification(params) end self.play_notification(params) end |