I think my answer to this post Anyone heard a saying about marriage being like cooking rice? answered your question about when to use 米已成炊.
There is an expression "米已成炊" (rice is cooked) It describes "既成事實" (a realized fact)
When raw rice is cooked, it cannot be changed back to raw again. Old Chinese thinking considered marriage is permanent, must be treated with caution. If a man and a woman get married, it is like raw rice boiled to be cooked rice-- It is permanent, cannot be undone. The only option is to eat it, meaning accept it
In the past, if a man and a woman had sex, they had no choice but to get marry. "米已成炊" can also describe this fact.
As for 木已成舟, it can be used more generally for describing something that has became a "realized fact" and the only option is to accept it. e.g. "就像木已成舟一樣, 最高法院法官就任後就不能被罷免"，(Just like a tree had turned into a boat, once a Supreme court judge is appointed, he cannot be removed from his position)
木已成舟 can also replace 米已成炊 for describing "marriage is permanent"
When you said you want to give a warning before you tell someone something, I presume you meant that person might not like what he will hear. If it is the case, I suggest "別說我沒警告你，一旦我把事情告訴了你，你就不能當没聽過" (Don't say I didn't warn you, once I told you the story, you cannot pretend you never heard it)
I can't think of an idiom that mean: "別說我沒警告你" (Don't say I didn't warn you), but you can use an idiomatic phrase like "事先警告" (be forewarned)