Prepare syrup: In a saucepan, bring water and sugar to a boil. Add chopped pineapple and cook for 2–3 minutes. If using milk, add it now. Keep warm.
Roast semolina: In a heavy-bottomed pan, heat ghee. Add semolina and roast on low-medium heat until it turns light golden and aromatic (about 5–7 minutes).
Cook sheera: Slowly add the warm pineapple syrup mixture to the roasted semolina, stirring continuously to avoid lumps.
Flavor: Add cardamom powder and mix well. Cook until the mixture thickens and ghee starts to separate from the sides.
Garnish: In a small pan, roast cashews and raisins in a little ghee until golden. Add them to the sheera.
Serve: Serve warm as a dessert or festive sweet.