What is the best way to attach a pulley to a motor shaft?

Just bought a brushless for my Beetle, it has a shaft diameter of just over 3mm and is completely smooth. The timing pulley just has a pilot hole.

The motor is an outrunner, and Ewan advised bolting onto the casing (since that also rotates) but I could do with some more detail.

Any suggestions?

Thanks,

PJ