What is the Calvinist perspective on John 5:28–29 in regard to earning salvation? John 5:28–29 seems to teach salvation by works:


  Do not marvel at this, for an hour is coming when all who are in the tombs will hear his voice and come out, those who have done good to the resurrection of life, and those who have done evil to the resurrection of judgment. (ESV)


How do Calvinists explain this passage?
The note for John 5:29 in the John MacArthur NASB Study Bible (MacArthur is Calvinist) says: 


  Jesus was not teaching for justification by works (see 6:29). In the context, the "good" is believing on the Son so as to receive a new nature that produces good works (3:21; Jas 2:14-20), while the "evil" done is to reject the Son (the unsaved) and hate the light, which is the result of evil deeds (3:18,19). In essence, works merely evidence one's nature as "saved" or unsaved (see notes on Ro 2:5-10), but human works never determine one's salvation.


There is no note specifically for John 5:28.