Coleraine won the Irish Cup for the first time since 2018, beating holders Dungannon Swifts 3-2 in an exciting final at Windsor Park in Belfast, Northern Ireland.