Are there options besides Apple and Google(?) that ~always deliver maintenance at least as long as the hardware warranty?
Latest phone that I've bought was https://www.oneplus.com/global/n100. This is one of the first OnePlus phones where they have made the update windows shorter for one year :( You can read more about that at https://www.androidcentral.com/oneplus-nord-n10-5g-n100-sing....
They also produce Android One phones, but for some reason they don't mention it explicitly anymore, even though it looks the same.
I used to have the Nokia 8.1 before I switched to iPhone, it was a great device, especially for the price, got monthly updates, and reasonable quick major version updates.
I think OnePlus might also have some decent update guarantees.