I looked up the last Android phone I owned: a Galaxy Nexus (2011), which shipped with 4.0, and stopped receiving OS updates after 4.3. Which is pretty much why I stopped using Android.
I think Google is doing a better job of supporting their own brand of phones these days, but it remains unfortunate for Android app developers that you have to either target a ~5 year old OS or cut off millions of users.