Welsh rugby legend Leigh Halfpenny has announced his retirement at 37, ending a career celebrated for humble excellence.