All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
If you made a promise to Allah that if you commit a certain act then Allah will punish you with Shirk, then it seems – and Allah knows best – that this is a supplication against yourself to receive this punishment and great calamity if you do that act.
It does not appear to us that this requires doing anything, neither an expiation nor anything else, except repentance from supplicating against yourself and from committing what you have committed if it is forbidden, as seems to be the case based on the question.
Your statement that Allah punishes you with Shirk does not necessarily mean that you have committed Shirk, and we hope that Allah will not punish you by making you commit Shirk, but this is a very serious statement, so do not ever say that again!
Allah knows best.