Labor and Greens strike deal on climate legislation