Hi and thank you for your question.
There are 3 elements required to make an internal combustion engine run. They are, spark at the correct time, sufficient compression and fuel.
Since you have checked for spark through the wires, we can assume the ignition system is working, but the one question remains is it firing when it is supposed to (ignition timing)
You said you sprayed starter fluid in to the air cleaner, but that didn't help. My one question there would be what happens if you remove the air cleaner and spray it down the throat of the carb?
Last, you said it had compression, and assume it is ok since it ran for awhile. Since we appear to have the other 2, I suggest a compression test just to confirm.
The other point you made that jumps out at me is the battery. What you described could be 2 issues. 1st, the battery could be no good. If you have a volt meter, connect the leads across the battery and observe the voltage before cranking the bike and while cranking it in an attempt to start it. If the battery is in good condition, the voltage should be around 12.5 dcv with the key off, and should drop no lower than about 10.5dcv when cranking to start. If it drops down to 9, you need a new battery.
However, part 2 of that is the charging system. It is going to be easier to check this once the bike starts running.
If the bike has been sitting, the carb is going to need to be cleaned. If gas sits in a carb for more than 30 days, it is going to plug up the pilot jet. That is down the road a bit because we should be able to get the bike started on the choke and starter fluid for now.
Once we get it running, then we can analyze what is going on and chart a course to repair it.
My last question is, what made you suspect the bike was going to die? Did it start running bad? Making unusual noises? It sounds like something tipped you off as an indicator that it was about to quit.
Get back to me with those answers and we can go from there.