From Article lll, Section. 3. of the U.S. Constitution
"Treason against the United States, shall consist only in levying War against them, or in adhering to their Enemies, giving them Aid and Comfort. No Person shall be convicted of Treason unless on the Testimony of two Witnesses to the same overt Act, or on Confession in open Court., giving them Aid and Comfort. No Person shall be convicted of Treason unless on the Testimony of two Witnesses to the same overt Act, or on Confession in open Court."
The key phrases here (I think) are in adhering to their Enemies and overt.
Publishing a classified document is not in and of itself adhering to an Enemy - in fact, absent a specific set of circumstances, it could be quite the opposite.
And given the preceding to be true, then it would not be an overt act of giving an Enemy aid and comfort.
FYI, I've worked in a classified environment for 20+ years, 14 of them directly in intelligence, and I see a lot of stuff that's classified for no other reason than to keep it out of the public eye - and THAT'S not a good enough reason.
And BTW, I think the government does itself and the public a great disservice by over-classifying stuff, but that's not enough reason for me do disclose classified information.
All the best,
Rob