Regardless of the manner or ways in which you publish (assuming that you do, or intend to), writing and publishing are different. Not just because they are different steps. But also many parts of publishing are outside your control. Sorry, my control freak friends, but it is true.
And so the things that you can do to separate the processes in your head will help. You may never want to write anything that doesn't get published. You may never write anything that doesn't get published. But various things from weather, to reader taste shifts, to wild world events, will impact sales in ways you cannot prepare for.
So you need to know why you write. The answer can change over your writing career. It can be the joy of storytelling. It can be the burning need to get these impatient characters out of your head. It can be the love of setting up and revealing a puzzle. It can be many things.
But if it's to be a bestseller, or to make oodles of money, you might or might not. And if a story doesn't perform the way you had hoped, and you plan to keep writing, you need to know how to be a writer.