Apple pledges to invest $30b and pay $38b tax bill