I believe that we are all forgetting something here. Mages can (potentially) fly to an infinite high (warlock and catnap) and simply use the creation spell to conjure massive rocks, which, after falling, would do huge amounts of damage (ask the dinosaurs). This would (potentially) allow us to do near-infinite amounts of damage (if we can assume crits we can assume our target stays still) by using gravity. If we have to hit the target, all we need to do is (somehow) carry it with us thousands of meters into the air, wait for fly to run out, then bop it on the head as hard as we can. If you're looking to speed up the whole ascension thing, use dimension door/speed boosts. However, if we are not allowed to make gravity do all the work for us, we are more limited. I am aware that there are other exploits we could use, such as conjuring explosives and 'punching' our victim into those, but I think those also don't count.
So, I propose a solution to the whole problem: The wish spell. Simply wish to be able to (once) do 1 million damage on a crit hit, and your problem is solved.
Here is another cheaty solution: Create a button which, once pressed, casts wall of stone. Then, get a friend to use a build similar to this "Pushing the Speed Limit" one, and let him sacrifice his character running into the wall. Poof.
Problem is, all these builds have one thing in common: they use 'cheats'. It could be argued that it wasn't your attack which did the damage, but the aftermath. If you are looking for a 'Legit' way to one-hit mobs, these... might not cut it. So, here is a new build which might help:
The build is for the maximum amount of damage in a single melee attack. However, what all of the previous builds are forgetting is that damage done to the attacker(technically) counts too. So take one of those previous builds and give the monster a flame shield and Armor of Agathys, and the damage goes up by a bit. With the Armor maxed, at most 61.
However, we can go one step further. lets say that we have thousands of insects, controlled by pixies with spell scrolls, and each of those insects had investiture of flame cast on them. Then, those pack themselves 15 feet away from where your foe is, and they line up, packed as closely as then can be( you could probable get thousand of them.
The investiture of flame spell says that whenever a creature moves within 5 feet of you they take 1d10 fire damage. So, then, you, a third-level Battlemaster fighter with Pushing Attack whack the poor goblin(or whoever it is.) it the insects, and he takes 1d10 damage per insect (you could probably fit tens of thousands of them in there). At least around ten thousand d10, which is around 50 thousand. True sphere of annihilation.