The following steps are based on a shell script that I wrote. It's not all automatically but you can see it in https://github.com/fredericobenevides/dotfiles/blob/master/files/python/tensorflow/tensorflow_gpu.sh.
macOs: 10.13.3 CUDA Toolkit: 9.1.128 cuDNN: 7.1 Xcode: 8.2 bazel: 0.11.1