I'd try to encourage my friend to give themselves up, and if they don't, I am not willing to allow an innocent bystander to be convicted in their place, so I would turn them in myself. It's even in criminal law as Blackstone's ratio: "It is better that ten guilty persons escape than that one innocent suffer"
If the law is doing their job properly, they'd catch my friend in the first place, most of my friends are dumb. However, if the case turns to having an innocent taking the place of my friend, I would turn my friend in, despite the fact that they trusted me, before that said innocent's trial.