We present models of giant planet migration in evolving protoplanetary discs. We show that disc clearing by extreme-ultraviolet photoevaporation can have a strong effect on the distribution of giant planet semimajor axes. During disc clearing, planet migration is slowed or accelerated in the region where photoevaporation opens a gap in the disc, resulting in ‘deserts’ where few giant planets are found and corresponding ‘pile-ups’ at smaller and larger radii. However, the precise locations and sizes of these features are strong functions of the efficiency of planetary accretion, and therefore also strongly dependent on planet mass. We suggest that photoevaporative disc clearing may be responsible for the pile-up of ∼Jupiter-mass planets at ∼1 au seen in exoplanet surveys, and show that observations of the distribution of exoplanet semimajor axes can be used to test models of both planet migration and disc clearing.