The first sentence is correct.
The second sentence would be better as:
"I promised that I would never do it again."
Intentions have two form:to-infinitive or that-clause
The first sentence is the to-infinitive form
The second should be the that-claus form