This expression has nothing to do with the modern-day process of die-casting of metal - the
die here is the singular of dice. Julius Caesar is supposed to have spoken this
phrase when crossing the Rubicon. Such stories are difficult to verify at this long remove and, of course, Caesar wouldn't have uttered the expression in English. The earliest English version of the phrase doesn't refer back to Roman history, so we have to take the above story with a pinch of salt.
The earliest citation of the phrase that I can find is in Sir Thomas Herbert,
A relation of some yeares travaile begunne anno 1626, into Afrique and the greater Asia, 1634:
"Aiijb, Is the die cast, must At this one throw all thou hast gaind be lost?"