第一个好.第二个不太适合这种语境.因为only to do sth.往往表示惊讶,表示一个没有料到的结果,可译为“结果却意外地”.如:
I hurried to the supermarket,only to find it was closed.
我匆忙赶到超市,不料它已经关门了.
He made a long speech only to show his foolishness.
他讲了一大通,结果只是显露了他的愚蠢.
I went to see him,only to learn that he had left the city the night before.
我去看他,不料听人家说他已经在前夜离开这个城市.