Self-consistent hybrid functionals for solids: a fully-automated implementation