Both.
This is my point of view, everyone else can think differently:
Step 1: Piano Singing
So that you know where's the melody, where to start and how the melody will turn into.
Step 2: Piano Playing
After you successfully complete the singing, and complete your song's melody, and know when to turn it louder (Cresc) or softer (dim.), then try playing it and fix the notes and stuff.
Step 3: Perfection
After you complete both steps, perfect it so that what you produce in the piano is what you have in mind of the song will become.
IF I take an example it would be Glenn Gould, which sings WHILE he plays. I'm not saying to follow him but, you will need to complete both steps first, then you can do what he does (But don't sing too loud, as it will disturb the listeners)