The shower ISN'T about you, your M, the OW etc. It is soley about the celebration of your gf's imminent blessed event.
The expectant mother IS your friend, and as your friend you 'owe' her (perhaps to strong a word) the 'gift' of your presence at the shower.
There's nothing that says you have to interact with OW or stay for the full duration of the party. You can enter with a huge hug and hello to the 'mom-to-be' and espouse your regrets that you can't stay long because you or you and H have another engagement in another hour of so. That way, you've shown your face, stood there proudly in the devil's space and been gracious to your friend.
Ultimately you must do what will feel RIGHT for you. But know that if YOU don't go and she does...she gets to feel smug in her ability to force you out. JMHO T2