Twenty to one it was caused by a seatpost not inserted deep enough into the frame.
The minimum insertion marks reference the minimum insertion for the seat post not to cam out of the seat tube. But that's only one half of the equation. On designs like this one where the seat tube extends beyond the top the post must extend to a depth of about one inch below the bottom of the top tube, which is usually beyond the seat post's mark.
A post inserted only to the 2.5" minimum mark will end above the top tube, or very close to that creating a major stress concentration right at the weld, which is the worst possible scenario.
Your good luck is you spotted it before it let go completely with seri-ass consequences.
Step one if you want to keep the frame, get a seat post that extends at least 3" below the crack, so it carries your weight well below the damaged area and transfers the load to the frame. Next use JB weld, or epoxy and a piece of fiberglass to reinforce the crack and prevent it's spreading and you should be OK, but keep an eye on it. It doesn't have to be a super strong repair since now the extended tube's only function is to support the clamp.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.