To be honest, I always determine my build units after determining all my attacks. Actually screwed me up in a F2F game because I couldnt move the pieces into the territory being attacked without giving up my right to buy units.
But in PBF it’s easier. No one is looking over your shoulder, so you can write out all your attacks, move the pieces on the board, look at the situation, determine what your NCMs are going to be (most likely - or even permanently if none of your attacks need dice) then see what the board looks like and figure out what you will build from that.