Either way, you need a programmer for that particular type of chip -- in your case, this'd be an SWD programmer. It would be used once, to upload bootloader, and then never again.
If your PCB has a space for it, the easier way to to make a SWD header (this only needs 4 pins, or only 2 pins if you have power/ground already available elsewhere).
If you don't like extra headers, and you are assembling the board yourself, you can get a socket -- you put the unsolderd chip in, close the lid, program it, then remove chip and solder it in:

Another alternative is a small set of test pads (exposed copper with nothing connect to it) with the programming signals. You can then connect either via special "bed of nails" rig, or hand-held device like TagConnect:

Image source: CompuPhase - ICSP programming tool/adapter

Image source: Tag-Connect - What is Tag-Connect?