Fastlane 与 Slack Bot 之间的绑定
Slack部分
创建 Slack Apps进到 slack api - Your Apps 点击 "Create New App"填写 App Name 并选择你要添加到的 Workspace新增完毕后会直接导转至 Basic Information,点选 Add features and functionality 底下的 "Incoming Webhooks"把 Active Incoming Webhooks "On" 起来点选下方 Add New Webhook to Workspace选择你想要接收通知的 Channel 后点选 Allow回到 Incoming Webhooks 后会发现底下多了刚刚创建的 Webhook URL 和指定收到通知的 Channel複製 Webhook URL
Fastlane部分
安装 Plugin: slack_bot
fastlane add_plugin slack_bot
打开 fastfile新增全域变数 SLACK_URL = "刚刚複製的Webhook URL"新增一个 lane 处里发送 slack message
desc "Send Message to Slack"lane :send_slack_message do |options| msg = options[:msg] puts "Slack Message: #{msg}" #Ruby下Log的方式用puts slack(message: msg, slack_url: SLACK_URL)end
把上面的 lane 加到 release 的 lane 中测试完成