What if we need to get everyone into space, ASAP?

Besides technological progress the main limitting factor of space travel is huge amount of money and work needed. What if we knew the Earth was to explode in a year or even 10 years? Could we save anybody? Where would they go?

We will never be able to achieve getting everyone off the planet, or even most people. Only a few people will be able to leave. The rest of us will die.
It’s lights out.
Given enough resources, a base on the moon would be the best option, I suppose. Mars perhaps, but 10 years isn’t much time. We could do more on the moon in 10 years than we could on Mars.
For most of us, though, lights out. Time to say your prayers.