(CNN) Arizona Republican Sen. Jeff Flake announced Tuesday that he won't run for a second term in the Senate . But he made the decision about his political career months ago -- when he decided to go public (in book form, no less!) with his indictment of both President Donald Trump and a GOP that had accepted such an interloper into its ranks.

"If by 2017 the conservative bargain was to go along for the very bumpy ride because with congressional hegemony and the White House we had the numbers to achieve some long-held policy goals — even as we put at risk our institutions and our values — then it was a very real question whether any such policy victories wouldn't be Pyrrhic ones," Flake wrote in "The Conscience of a Conservative: A Rejection of Destructive Politics and a Return to Principle". "If this was our Faustian bargain, then it was not worth it."

Flake's book -- and the candor about Trump and his party he exhibited in it -- drew him widespread national attention and, in some circles, considerable praise.

Trump wasn't among those laurel throwers. Neither were potential 2018 Republican primary voters.

"Phoenix crowd last night was amazing - a packed house," Trump tweeted in August . "I love the Great State of Arizona. Not a fan of Jeff Flake, weak on crime & border!"

Trump went further. He met with several potential Republican primary challengers to Flake -- an absolutely unheard of act for an incumbent President against a member of his own party. Steve Bannon, Trump's former chief strategist, is aiding the candidacy of former state Sen. Kelli Ward, who ran an unsuccessful primary against Republican Sen. John McCain in 2016.

"Today, Steve Bannon added another scalp to his collection as another establishment domino falls," one Bannon ally told CNN's Kaitlin Collins

It quickly became clear that in a fight between Trump/Bannon and Flake, the senator was going to lose -- and lose badly. Polling suggested that Ward started the primary with a double-digit lead over Flake.

The conversations within GOP circles over the past few months was not whether Flake could win reelection. It was whether he would retire (as he did on Tuesday) or be beaten by Ward in a primary.

This was not a surprise to Flake. From the moment he conceived of writing the book he wrote, he knew this was not only a possibility but maybe the only possibility for how his political career would end. He said as much in his speech announcing his retirement on the Senate floor.

"There are times when we must risk our careers in favor of our principles," he said in the opening moments of his address. "Now is such a time."

Flake's fatalism screams through those lines. He simply wasn't willing to be a Republican senator in the Republican party of Donald Trump. He determined that holding the office -- or running to hold the office -- just wasn't worth what he would have to sacrifice in terms of principle.

This will be touted by the Trump forces as a victory. A chance to get rid of one of the burrs in the President's saddle. A chance to further destroy the GOP establishment.

And maybe it is. There's little indication that outside of the likes of Flake, Tennessee Sen. Bob Corker and McCain, Flake's retirement -- and the speech he gave announcing it -- will have any significant impact on how Republican leaders in the Senate and House react to Trump's presidency. If anything, they may look to Flake as a cautionary tale of what happens when you publicly cross Trump and his base.

If so, Flake will have failed. But he will have failed trying to show his party that, in his mind, following Trump blindly down the path he is heading could lead to the end of the Republican Party as currently compromised.

Flake sacrificed himself -- and his political career -- to try to shake Republicans out of their stupor.