Purcell-enhanced generation of indistinguishable on-chip single photons