I think I played this within the last five years. The basic concept was of someone trying to defend their kingdom against oncoming hordes. The method for providing that defense involved doing a "match 3" kind of game to summon various spells. I remember there was a spell for creating a rock, and one for creating a golem. The rock provided a static defense against the creatures coming upon a row, and I think the golem cleared out a row. The assaults happened in stages, I think involving a backstory of conflicts of mage kings. At least one level involved an assault of the undead, and I think Ogres and Genies played into it. Completing a match had an effect in and of itself, but additional spells were available via scrolls for past victories.
I think I acquired this via IndieRoyale/Desura before that collapsed, which suggests it might exist as a Steam game.