Funnest ever scripts and actions to make use of fastlane and Xcode Bots.
These scripts make it easy to use fastlane within Xcode Bots to update your dependencies and report build status.
First, clone the Botlane scripts repository into your project.
git clone --depth=1 https://github.com/MontanaFlossCo/botlane.git
rm -Rf botlane/.git
NOTE: in future we'll use a github release zip for this
We clone the repository into your code base so that you can conmit the scripts to git yourself as part of your project. Use of submodules requires more Xcode Bot shenanigans and... you don't really want your CI server to be downloading code from some public repository you don't control do you? The correct answer is NO.
We remove the nested .git so you don't get problems with it looking like a submodule.
To update your version of botlane in future, simply rm -Rf botlane and clone it again as above.
Edit your fastlane/Fastfile and add import "../botlane/Botfile" to each platform block, or to global scope if you don't have per-platform lane configurations.
Example:
platform :ios do
# Add this to your Fastfile to import the Botlane lanes and actions
import "../botlane/Botfile"
...
You should also remove any cocoapods or carthage actions from your before_all lanes because the Xcode Bot will execute two fastlane lanes, which would mean your dependencies get updated twice. Which is lame at best, slow and problematic at worst.
Botlane will initialise your Carthage dependencies for you.
Now you should be able to run fastlane bot_start locally and check that works with no errors.
Edit/create your Bot and in the Triggers tab add a Run Script that tells the script what your project's root directory name is, and calls the start script that will update your dependencies before Xcode runs your builds.
Before trigger script
export PROJECT_ROOT="YourCoolAppProjectDirectoryName"
. ${PROJECT_ROOT}/botlane/bot_start.sh
After trigger script
export PROJECT_ROOT="YourCoolAppProjectDirectoryName"
. ${PROJECT_ROOT}/botlane/bot_complete.sh